Back to index

texmacs  1.0.7.15
Defines | Typedefs | Functions
guile_tm.hpp File Reference
#include "tm_configure.hpp"
#include "blackbox.hpp"
#include "array.hpp"
#include <guile/gh.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SCM_ARG8   8
#define SCM_ARG9   9
#define tmscm_install_procedure(name, func, args, p0, p1)   scm_new_procedure (name, ( FN )( func ), args, p0, p1)
#define TMSCM_ASSERT(_cond, _arg, _pos, _subr)   SCM_ASSERT(_cond, _arg, _pos, _subr)
#define TMSCM_ARG1   SCM_ARG1
#define TMSCM_ARG2   SCM_ARG2
#define TMSCM_ARG3   SCM_ARG3
#define TMSCM_ARG4   SCM_ARG4
#define TMSCM_ARG5   SCM_ARG5
#define TMSCM_ARG6   SCM_ARG6
#define TMSCM_ARG7   SCM_ARG7
#define TMSCM_ARG8   SCM_ARG8
#define TMSCM_UNSPECIFIED   SCM_UNSPECIFIED

Typedefs

typedef SCM(* FN )()
typedef SCM tmscm

Functions

bool tmscm_is_blackbox (tmscm obj)
tmscm blackbox_to_tmscm (blackbox b)
blackbox tmscm_to_blackbox (tmscm obj)
tmscm tmscm_null ()
tmscm tmscm_true ()
tmscm tmscm_false ()
void tmscm_set_car (tmscm a, tmscm b)
void tmscm_set_cdr (tmscm a, tmscm b)
bool tmscm_is_equal (tmscm o1, tmscm o2)
bool tmscm_is_null (tmscm obj)
bool tmscm_is_pair (tmscm obj)
bool tmscm_is_list (tmscm obj)
bool tmscm_is_bool (tmscm obj)
bool tmscm_is_int (tmscm obj)
bool tmscm_is_double (tmscm obj)
bool tmscm_is_string (tmscm obj)
bool tmscm_is_symbol (tmscm obj)
tmscm tmscm_cons (tmscm obj1, tmscm obj2)
tmscm tmscm_car (tmscm obj)
tmscm tmscm_cdr (tmscm obj)
tmscm tmscm_caar (tmscm obj)
tmscm tmscm_cadr (tmscm obj)
tmscm tmscm_cdar (tmscm obj)
tmscm tmscm_cddr (tmscm obj)
tmscm tmscm_caddr (tmscm obj)
tmscm tmscm_cadddr (tmscm obj)
SCM bool_to_scm (bool b)
SCM int_to_scm (int i)
SCM double_to_scm (double i)
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)
bool tmscm_to_bool (tmscm obj)
int tmscm_to_int (tmscm obj)
double tmscm_to_double (tmscm obj)
string tmscm_to_string (tmscm obj)
string tmscm_to_symbol (tmscm obj)
tmscm eval_scheme_file (string name)
tmscm eval_scheme (string s)
tmscm call_scheme (tmscm fun)
tmscm call_scheme (tmscm fun, tmscm a1)
tmscm call_scheme (tmscm fun, tmscm a1, tmscm a2)
tmscm call_scheme (tmscm fun, tmscm a1, tmscm a2, tmscm a3)
tmscm call_scheme (tmscm fun, tmscm a1, tmscm a2, tmscm a3, tmscm a4)
tmscm call_scheme (tmscm fun, array< tmscm > a)
string scheme_dialect ()

Define Documentation

#define SCM_ARG8   8

Definition at line 183 of file guile_tm.hpp.

#define SCM_ARG9   9

Definition at line 184 of file guile_tm.hpp.

#define TMSCM_ARG1   SCM_ARG1

Definition at line 274 of file guile_tm.hpp.

#define TMSCM_ARG2   SCM_ARG2

Definition at line 275 of file guile_tm.hpp.

#define TMSCM_ARG3   SCM_ARG3

Definition at line 276 of file guile_tm.hpp.

#define TMSCM_ARG4   SCM_ARG4

Definition at line 277 of file guile_tm.hpp.

#define TMSCM_ARG5   SCM_ARG5

Definition at line 278 of file guile_tm.hpp.

#define TMSCM_ARG6   SCM_ARG6

Definition at line 279 of file guile_tm.hpp.

#define TMSCM_ARG7   SCM_ARG7

Definition at line 280 of file guile_tm.hpp.

#define TMSCM_ARG8   SCM_ARG8

Definition at line 281 of file guile_tm.hpp.

#define TMSCM_ASSERT (   _cond,
  _arg,
  _pos,
  _subr 
)    SCM_ASSERT(_cond, _arg, _pos, _subr)

Definition at line 271 of file guile_tm.hpp.

#define tmscm_install_procedure (   name,
  func,
  args,
  p0,
  p1 
)    scm_new_procedure (name, ( FN )( func ), args, p0, p1)

Definition at line 268 of file guile_tm.hpp.

#define TMSCM_UNSPECIFIED   SCM_UNSPECIFIED

Definition at line 283 of file guile_tm.hpp.


Typedef Documentation

typedef SCM(* FN)()

Definition at line 189 of file guile_tm.hpp.

typedef SCM tmscm

Definition at line 199 of file guile_tm.hpp.


Function Documentation

Definition at line 383 of file guile_tm.cpp.

                               {
       SCM blackbox_smob;
       SET_SMOB (blackbox_smob, (void*) (tm_new<blackbox> (b)), (SCM) blackbox_tag);
       return blackbox_smob;
}

Here is the caller graph for this function:

SCM bool_to_scm ( bool  b) [inline]

Definition at line 262 of file guile_tm.cpp.

                        {
       return scm_bool2scm (flag);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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:

Definition at line 177 of file guile_tm.cpp.

                      {
       SCM a[]= { fun }; arg_list args= { 0, a };
       return TeXmacs_call_scm (&args);
}

Here is the call graph for this function:

Here is the caller graph for this function:

tmscm call_scheme ( tmscm  fun,
tmscm  a1 
)

Definition at line 183 of file guile_tm.cpp.

                              {
       SCM a[]= { fun, a1 }; arg_list args= { 1, a };
       return TeXmacs_call_scm (&args);
}

Here is the call graph for this function:

tmscm call_scheme ( tmscm  fun,
tmscm  a1,
tmscm  a2 
)

Definition at line 189 of file guile_tm.cpp.

                                      {
       SCM a[]= { fun, a1, a2 }; arg_list args= { 2, a };
       return TeXmacs_call_scm (&args);
}

Here is the call graph for this function:

tmscm call_scheme ( tmscm  fun,
tmscm  a1,
tmscm  a2,
tmscm  a3 
)

Definition at line 195 of file guile_tm.cpp.

                                              {
       SCM a[]= { fun, a1, a2, a3 }; arg_list args= { 3, a };
       return TeXmacs_call_scm (&args);
}

Here is the call graph for this function:

tmscm call_scheme ( tmscm  fun,
tmscm  a1,
tmscm  a2,
tmscm  a3,
tmscm  a4 
)

Definition at line 201 of file guile_tm.cpp.

                                                      {
       SCM a[]= { fun, a1, a2, a3, a4 }; arg_list args= { 4, a };
       return TeXmacs_call_scm (&args);
}

Here is the call graph for this function:

tmscm call_scheme ( tmscm  fun,
array< tmscm a 
)

Definition at line 207 of file guile_tm.cpp.

                                    {
       const int n= N(a);
       STACK_NEW_ARRAY(scm, SCM, n+1);
       int i;
       scm[0]= fun;
       for (i=0; i<n; i++) scm[i+1]= a[i];
       arg_list args= { n, scm };
       SCM ret= TeXmacs_call_scm (&args);
       STACK_DELETE_ARRAY(scm);
       return ret;
}

Here is the call graph for this function:

SCM double_to_scm ( double  i) [inline]

Definition at line 300 of file guile_tm.cpp.

                         {
       return scm_double2scm (i);
}

Here is the call graph for this function:

Here is the caller 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:

Definition at line 129 of file guile_tm.cpp.

                       {
       // cout << "Eval] " << s << "\n";
       char* _s= as_charp (s);
       SCM result= TeXmacs_eval_string (_s);
       tm_delete_array (_s);
       return result;
}

Definition at line 98 of file guile_tm.cpp.

                               {
       //static int cumul= 0;
       //timer tm;
       if (DEBUG_STD) cout << "TeXmacs] Evaluating " << file << "...\n";
       char* _file= as_charp (file);
       SCM result= TeXmacs_eval_file (_file);
       tm_delete_array (_file);
       //int extra= tm->watch (); cumul += extra;
       //cout << extra << "\t" << cumul << "\t" << file << "\n";
       return result;
}
SCM int_to_scm ( int  i) [inline]

Definition at line 279 of file guile_tm.cpp.

                   {
       return scm_long2scm ((long) i);
}

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 225 of file guile_tm.cpp.

                  {
#ifdef GUILE_A
       return "guile-a";
#else
#ifdef GUILE_B
       return "guile-b";
#else
#ifdef GUILE_C
       return "guile-c";
#else
#ifdef GUILE_D
       return "guile-d";
#else
       return "unknown";
#endif
#endif
#endif
#endif
}

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;
}

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;
}
tmscm tmscm_caar ( tmscm  obj) [inline]

Definition at line 228 of file guile_tm.hpp.

{ return SCM_CAAR (obj); }

Here is the caller graph for this function:

tmscm tmscm_cadddr ( tmscm  obj) [inline]

Definition at line 233 of file guile_tm.hpp.

{ return SCM_CADDDR (obj); }

Here is the caller graph for this function:

tmscm tmscm_caddr ( tmscm  obj) [inline]

Definition at line 232 of file guile_tm.hpp.

{ return SCM_CADDR (obj); }

Here is the caller graph for this function:

tmscm tmscm_cadr ( tmscm  obj) [inline]

Definition at line 229 of file guile_tm.hpp.

{ return SCM_CADR (obj); }

Here is the caller graph for this function:

tmscm tmscm_car ( tmscm  obj) [inline]

Definition at line 226 of file guile_tm.hpp.

{ return SCM_CAR (obj); }

Here is the caller graph for this function:

tmscm tmscm_cdar ( tmscm  obj) [inline]

Definition at line 230 of file guile_tm.hpp.

{ return SCM_CDAR (obj); }

Here is the caller graph for this function:

tmscm tmscm_cddr ( tmscm  obj) [inline]

Definition at line 231 of file guile_tm.hpp.

{ return SCM_CDDR (obj); }

Here is the caller graph for this function:

tmscm tmscm_cdr ( tmscm  obj) [inline]

Definition at line 227 of file guile_tm.hpp.

{ return SCM_CDR (obj); }

Here is the caller graph for this function:

tmscm tmscm_cons ( tmscm  obj1,
tmscm  obj2 
) [inline]

Definition at line 225 of file guile_tm.hpp.

{ return scm_cons (obj1, obj2); }

Here is the call graph for this function:

Here is the caller graph for this function:

tmscm tmscm_false ( ) [inline]

Definition at line 207 of file guile_tm.hpp.

{ return SCM_BOOL_F; }

Here is the caller graph for this function:

bool tmscm_is_blackbox ( tmscm  obj)

Definition at line 378 of file guile_tm.cpp.

                            {
       return SCM_BLACKBOXP (t);
}

Here is the caller graph for this function:

bool tmscm_is_bool ( tmscm  obj) [inline]

Definition at line 219 of file guile_tm.hpp.

{ return scm_is_bool (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_double ( tmscm  obj) [inline]

Definition at line 221 of file guile_tm.hpp.

{ return scm_is_double (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_equal ( tmscm  o1,
tmscm  o2 
) [inline]

Definition at line 212 of file guile_tm.hpp.

{ return SCM_NFALSEP ( scm_equal_p(o1, o2)); }

Here is the caller graph for this function:

bool tmscm_is_int ( tmscm  obj) [inline]

Definition at line 220 of file guile_tm.hpp.

{ return scm_is_int (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_list ( tmscm  obj) [inline]

Definition at line 218 of file guile_tm.hpp.

{ return scm_is_list (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_null ( tmscm  obj) [inline]

Definition at line 216 of file guile_tm.hpp.

{ return scm_is_null (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_pair ( tmscm  obj) [inline]

Definition at line 217 of file guile_tm.hpp.

{ return scm_is_pair (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_string ( tmscm  obj) [inline]

Definition at line 222 of file guile_tm.hpp.

{ return scm_is_string (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool tmscm_is_symbol ( tmscm  obj) [inline]

Definition at line 223 of file guile_tm.hpp.

{ return scm_is_symbol (obj); }

Here is the call graph for this function:

Here is the caller graph for this function:

tmscm tmscm_null ( ) [inline]

Definition at line 205 of file guile_tm.hpp.

{ return SCM_NULL; }

Here is the caller graph for this function:

void tmscm_set_car ( tmscm  a,
tmscm  b 
) [inline]

Definition at line 208 of file guile_tm.hpp.

{ SCM_SETCAR(a,b); }

Here is the caller graph for this function:

void tmscm_set_cdr ( tmscm  a,
tmscm  b 
) [inline]

Definition at line 209 of file guile_tm.hpp.

{ SCM_SETCDR(a,b); }

Here is the caller graph for this function:

Definition at line 390 of file guile_tm.cpp.

                                        {
       return *((blackbox*) SCM_CDR (blackbox_smob));
}

Here is the caller graph for this function:

bool tmscm_to_bool ( tmscm  obj) [inline]

Definition at line 249 of file guile_tm.hpp.

{ return scm_to_bool (obj); }

Here is the call graph for this function:

double tmscm_to_double ( tmscm  obj) [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 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;
}
tmscm tmscm_true ( ) [inline]

Definition at line 206 of file guile_tm.hpp.

{ return SCM_BOOL_T; }

Here is the caller graph for this function: