Back to index

texmacs  1.0.7.15
Functions
glue.hpp File Reference
#include "tree.hpp"
#include "path.hpp"
#include "url.hpp"
#include "widget.hpp"
#include "object.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void initialize_glue ()
bool tmscm_is_tree (tmscm obj)
bool tmscm_is_list_string (tmscm obj)
bool tmscm_is_list_tree (tmscm obj)
bool tmscm_is_path (tmscm obj)
bool tmscm_is_url (tmscm obj)
bool tmscm_is_widget (tmscm obj)
tmscm bool_to_tmscm (bool b)
tmscm int_to_tmscm (int i)
tmscm double_to_tmscm (double i)
tmscm string_to_tmscm (string s)
tmscm symbol_to_tmscm (string s)
tmscm tree_to_tmscm (tree t)
tmscm list_string_to_tmscm (list< string > l)
tmscm list_tree_to_tmscm (list< tree > l)
tmscm path_to_tmscm (path p)
tmscm url_to_tmscm (url u)
tmscm scheme_tree_to_tmscm (scheme_tree t)
int tmscm_to_int (tmscm obj)
double tmscm_to_double (tmscm i)
string tmscm_to_string (tmscm obj)
string tmscm_to_symbol (tmscm obj)
tree tmscm_to_tree (tmscm obj)
tree tmscm_to_content (tmscm obj)
list< stringtmscm_to_list_string (tmscm obj)
list< treetmscm_to_list_tree (tmscm obj)
path tmscm_to_path (tmscm obj)
url tmscm_to_url (tmscm obj)
scheme_tree tmscm_to_scheme_tree (tmscm obj)
widget tmscm_to_widget (tmscm widget_smob)

Function Documentation

tmscm bool_to_tmscm ( bool  b) [inline]

Definition at line 243 of file guile_tm.hpp.

{ return bool_to_scm (b); }

Here is the call graph for this function:

tmscm double_to_tmscm ( double  i) [inline]

Definition at line 245 of file guile_tm.hpp.

{ return double_to_scm (i); }

Here is the call graph for this function:

Here is the caller graph for this function:

void initialize_glue ( )

Definition at line 1062 of file glue.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

tmscm int_to_tmscm ( int  i) [inline]

Definition at line 244 of file guile_tm.hpp.

{   return int_to_scm (i); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 967 of file glue.cpp.

                                     {
  if (is_nil (l)) return tmscm_null ();
  return tmscm_cons (string_to_tmscm (l->item),
           list_string_to_tmscm (l->next));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 453 of file glue.cpp.

                       {
  if (is_nil (p)) return tmscm_null ();
  else return tmscm_cons (int_to_tmscm (p->item), path_to_tmscm (p->next));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 356 of file glue.cpp.

                                     {
  if (is_atomic (t)) {
    string s= t->label;
    if (s == "#t") return tmscm_true ();
    if (s == "#f") return tmscm_false ();
    if (is_int (s)) return int_to_tmscm (as_int (s));
    if (is_quoted (s))
      return string_to_tmscm (scm_unquote (s));
    //if ((N(s)>=2) && (s[0]=='\42') && (s[N(s)-1]=='\42'))
    //return string_to_tmscm (s (1, N(s)-1));
    return symbol_to_tmscm (s);
  }
  else {
    int i;
    tmscm  p= tmscm_null ();
    for (i=N(t)-1; i>=0; i--)
      p= tmscm_cons (scheme_tree_to_tmscm (t[i]), p);
    return p;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 317 of file guile_tm.cpp.

                           {
       char* _s= as_charp (s);
       SCM r= scm_str2scm (_s, N(s));
       tm_delete_array (_s);
       return r;
}

Here is the call graph for this function:

Definition at line 348 of file guile_tm.cpp.

                           {
       char* _s= as_charp (s);
       SCM r= scm_symbol2scm (_s);
       tm_delete_array (_s);
       return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_list_string ( tmscm  obj)

Definition at line 956 of file glue.cpp.

                                {
  if (tmscm_is_null (p)) return true;
  else return tmscm_is_pair (p) &&
    tmscm_is_string (tmscm_car (p)) &&
    tmscm_is_list_string (tmscm_cdr (p));
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_list_tree ( tmscm  obj)

Definition at line 983 of file glue.cpp.

                              {
  if (tmscm_is_null (p)) return true;
  else return tmscm_is_pair (p) &&
    tmscm_is_tree (tmscm_car (p)) &&
    tmscm_is_list_tree (tmscm_cdr (p));
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_path ( tmscm  obj)

Definition at line 444 of file glue.cpp.

                         {
  if (tmscm_is_null (p)) return true;
  else return tmscm_is_int (tmscm_car (p)) && tmscm_is_path (tmscm_cdr (p));
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_tree ( tmscm  obj)

Definition at line 168 of file glue.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_url ( tmscm  obj)

Definition at line 578 of file glue.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_widget ( tmscm  obj)

Definition at line 506 of file glue.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 417 of file glue.cpp.

                            {
  if (tmscm_is_string (p)) return tmscm_to_string (p);
  if (tmscm_is_tree (p)) return tmscm_to_tree (p);
  if (tmscm_is_pair (p)) {
    if (!tmscm_is_symbol (tmscm_car (p))) return "?";
    tree t (make_tree_label (tmscm_to_symbol (tmscm_car (p))));
    p= tmscm_cdr (p);
    while (!tmscm_is_null (p)) {
      t << tmscm_to_content (tmscm_car (p));
      p= tmscm_cdr (p);
    }
    return t;
  }
  return "?";
}

Here is the call graph for this function:

double tmscm_to_double ( tmscm  i) [inline]

Definition at line 251 of file guile_tm.hpp.

{ return scm_to_double (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

int tmscm_to_int ( tmscm  obj) [inline]

Definition at line 250 of file guile_tm.hpp.

{ return scm_to_int (obj); }

Here is the call graph for this function:

Definition at line 974 of file glue.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1001 of file glue.cpp.

                              {
  if (tmscm_is_null (p)) return list_tree ();
  return list_tree (tmscm_to_tree (tmscm_car (p)),
            tmscm_to_list_tree (tmscm_cdr (p)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 459 of file glue.cpp.

                         {
  if (tmscm_is_null (p)) return path ();
  else return path ((int) tmscm_to_int (tmscm_car (p)), 
                          tmscm_to_path (tmscm_cdr (p)));
}

Here is the call graph for this function:

Definition at line 378 of file glue.cpp.

                                {
  if (tmscm_is_list (p)) {
    tree t (TUPLE);
    while (!tmscm_is_null (p)) {
      t << tmscm_to_scheme_tree (tmscm_car (p));
      p= tmscm_cdr (p);
    }
    return t;
  }
  if (tmscm_is_symbol (p)) return tmscm_to_symbol (p);
  if (tmscm_is_string (p)) return scm_quote (tmscm_to_string (p));
  //if (tmscm_is_string (p)) return "\"" * tmscm_to_string (p) * "\"";
  if (tmscm_is_int (p)) return as_string ((int) tmscm_to_int (p));
  if (tmscm_is_bool (p)) return (tmscm_to_bool (p)? string ("#t"): string ("#f"));
  if (tmscm_is_tree (p)) return tree_to_scheme_tree (tmscm_to_tree (p));
  return "?";
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 325 of file guile_tm.cpp.

                          {
       guile_str_size_t len_r;
       char* _r= scm_scm2str (s, &len_r);
       string r (_r, len_r);
#ifdef OS_WIN32
       scm_must_free(_r);
#else
       free (_r);
#endif
       return r;
}

Definition at line 356 of file guile_tm.cpp.

                          {
       guile_str_size_t len_r;
       char* _r= scm_scm2symbol (s, &len_r);
       string r (_r, len_r);
#ifdef OS_WIN32
       scm_must_free(_r);
#else
       free (_r);
#endif
       return r;
}

Here is the caller graph for this function:

Definition at line 179 of file glue.cpp.

                           {
  return open_box<tree>(tmscm_to_blackbox (obj));
}

Here is the call graph for this function:

Definition at line 590 of file glue.cpp.

                          {
  if (tmscm_is_string (obj))
#ifdef __MINGW32__
    return url_system (tmscm_to_string (obj));
#else
  return tmscm_to_string (obj);
#endif
  return open_box<url> (tmscm_to_blackbox (obj));
}

Here is the call graph for this function:

widget tmscm_to_widget ( tmscm  widget_smob)

Definition at line 518 of file glue.cpp.

                           {
  return open_box<widget> (tmscm_to_blackbox (o));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 174 of file glue.cpp.

                       {
  return blackbox_to_tmscm (close_box<tree> (o));
}

Here is the call graph for this function:

Definition at line 585 of file glue.cpp.

                     {
  return blackbox_to_tmscm (close_box<url> (u));
}

Here is the call graph for this function:

Here is the caller graph for this function: