Back to index

texmacs  1.0.7.15
Classes | Defines | Typedefs | Enumerations | Functions | Variables
basic.hpp File Reference
#include "fast_alloc.hpp"
#include <math.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  type_helper< T >
struct  concrete_struct
struct  abstract_struct

Defines

#define LESSGTR   <>
#define TM_DEBUG(x)
#define STACK_NEW_ARRAY(name, T, size)   T name[size]
#define STACK_DELETE_ARRAY(name)
#define DEBUG_AUTO   (debug (DEBUG_FLAG_AUTO))
#define DEBUG_VERBOSE   (debug (DEBUG_FLAG_VERBOSE))
#define DEBUG_EVENTS   (debug (DEBUG_FLAG_EVENTS))
#define DEBUG_STD   (debug (DEBUG_FLAG_STD))
#define DEBUG_IO   (debug (DEBUG_FLAG_IO))
#define DEBUG_BENCH   (debug (DEBUG_FLAG_BENCH))
#define DEBUG_HISTORY   (debug (DEBUG_FLAG_HISTORY))
#define DEBUG_QT   (debug (DEBUG_FLAG_QT))
#define DEBUG_KEYBOARD   (debug (DEBUG_FLAG_KEYBOARD))
#define DEBUG_PACKRAT   (debug (DEBUG_FLAG_PACKRAT))
#define DEBUG_FLATTEN   (debug (DEBUG_FLAG_FLATTEN))
#define DEBUG_CORRECT   (debug (DEBUG_FLAG_CORRECT))
#define ASSERT(cond, msg)   { if (!(cond)) { tm_failure (msg); } }
#define FAILED(msg)   { tm_failure (msg); }
#define INC_COUNT(R)   { (R)->ref_count++; }
#define DEC_COUNT(R)   { if(0==--((R)->ref_count)) tm_delete (R); }
#define INC_COUNT_NULL(R)   { if ((R)!=NULL) (R)->ref_count++; }
#define DEC_COUNT_NULL(R)   { if ((R)!=NULL && 0==--((R)->ref_count)) tm_delete (R); }
#define CONCRETE(PTR)
#define CONCRETE_CODE(PTR)
#define CONCRETE_TEMPLATE(PTR, T)
#define CONCRETE_TEMPLATE_CODE(PTR, TT, T)
#define CONCRETE_TEMPLATE_2(PTR, T1, T2)
#define CONCRETE_TEMPLATE_2_CODE(PTR, TT1, T1, TT2, T2)
#define ABSTRACT(PTR)
#define ABSTRACT_CODE(PTR)
#define ABSTRACT_TEMPLATE(PTR, T)
#define ABSTRACT_TEMPLATE_CODE(PTR, TT, T)
#define CONCRETE_NULL(PTR)
#define CONCRETE_NULL_CODE(PTR)
#define CONCRETE_NULL_TEMPLATE(PTR, T)
#define CONCRETE_NULL_TEMPLATE_CODE(PTR, TT, T)
#define CONCRETE_NULL_TEMPLATE_2(PTR, T1, T2)
#define CONCRETE_NULL_TEMPLATE_2_CODE(PTR, TT1, T1, TT2, T2)
#define ABSTRACT_NULL(PTR)
#define ABSTRACT_NULL_CODE(PTR)
#define ABSTRACT_NULL_TEMPLATE(PTR, T)
#define ABSTRACT_NULL_TEMPLATE_CODE(PTR, TT, T)
#define ABSTRACT_NULL_TEMPLATE_2(PTR, T1, T2)
#define ABSTRACT_NULL_TEMPLATE_2_CODE(PTR, TT1, T1, TT2, T2)
#define EXTEND(BASE, PTR)
#define EXTEND_CODE(BASE, PTR)
#define EXTEND_NULL(BASE, PTR)
#define EXTEND_NULL_CODE(BASE, PTR)
#define EXTEND_NULL_TEMPLATE(BASE, PTR, T)
#define EXTEND_NULL_TEMPLATE_CODE(BASE, PTR, TT, T)

Typedefs

typedef long intptr_t
typedef int SI
typedef unsigned int SN
typedef short HI
typedef unsigned short HN
typedef char QI
typedef unsigned char QN
typedef long long int DI
typedef void * pointer

Enumerations

enum  {
  DEBUG_FLAG_AUTO, DEBUG_FLAG_VERBOSE, DEBUG_FLAG_EVENTS, DEBUG_FLAG_STD,
  DEBUG_FLAG_IO, DEBUG_FLAG_BENCH, DEBUG_FLAG_HISTORY, DEBUG_FLAG_QT,
  DEBUG_FLAG_KEYBOARD, DEBUG_FLAG_PACKRAT, DEBUG_FLAG_FLATTEN, DEBUG_FLAG_CORRECT
}
enum  display_control { INDENT, UNINDENT, HRULE, LF }

Functions

bool debug (int which, bool write_flag=false)
int debug_off ()
void debug_on (int status)
void debug_set (string s, bool flag)
bool debug_get (string s)
void tm_failure (const char *msg)
SI min (SI i, SI j)
SI max (SI i, SI j)
DI min (DI i, DI j)
DI max (DI i, DI j)
double min (double i, double j)
double max (double i, double j)
int hash (int i)
int hash (pointer ptr)
int copy (int x)
SI as_int (double x)
tm_ostreamoperator<< (tm_ostream &out, display_control ctrl)
bool gui_is_x ()
bool gui_is_qt ()
bool os_win32 ()
bool os_mingw ()
bool os_macos ()
bool use_macos_fonts ()
const char * default_look_and_feel ()
int new_type_identifier ()

Variables

int concrete_count
int abstract_count

Define Documentation

#define ABSTRACT (   PTR)
Value:
CONCRETE(PTR);      \
  inline PTR (PTR##_rep*)

Definition at line 213 of file basic.hpp.

#define ABSTRACT_CODE (   PTR)
Value:
CONCRETE_CODE(PTR) ;     \
  inline PTR::PTR (PTR##_rep* rep2): rep(rep2) { INC_COUNT (this->rep); }

Definition at line 216 of file basic.hpp.

#define ABSTRACT_NULL (   PTR)
Value:
CONCRETE_NULL (PTR);     \
  inline PTR (PTR##_rep*)

Definition at line 285 of file basic.hpp.

#define ABSTRACT_NULL_CODE (   PTR)
Value:
CONCRETE_NULL_CODE (PTR);          \
  inline PTR::PTR (PTR##_rep* rep2): \
    rep(rep2) { INC_COUNT_NULL (this->rep); }

Definition at line 288 of file basic.hpp.

#define ABSTRACT_NULL_TEMPLATE (   PTR,
  T 
)
Value:
CONCRETE_NULL_TEMPLATE (PTR,T);     \
  inline PTR (PTR##_rep<T>*)

Definition at line 292 of file basic.hpp.

#define ABSTRACT_NULL_TEMPLATE_2 (   PTR,
  T1,
  T2 
)
Value:
CONCRETE_NULL_TEMPLATE_2 (PTR,T1,T2);     \
  inline PTR (PTR##_rep<T1,T2>*)

Definition at line 299 of file basic.hpp.

#define ABSTRACT_NULL_TEMPLATE_2_CODE (   PTR,
  TT1,
  T1,
  TT2,
  T2 
)
Value:
CONCRETE_NULL_TEMPLATE_2_CODE (PTR,TT1,T1,TT2,T2);                          \
  template<TT1 T1,TT2 T2> inline PTR<T1,T2>::PTR (PTR##_rep<T1,T2>* rep2):  \
    rep(rep2) { INC_COUNT (this->rep); }

Definition at line 302 of file basic.hpp.

#define ABSTRACT_NULL_TEMPLATE_CODE (   PTR,
  TT,
  T 
)
Value:
CONCRETE_NULL_TEMPLATE_CODE (PTR,TT,T);                  \
  template<TT T> inline PTR<T>::PTR (PTR##_rep<T>* rep2):  \
    rep(rep2) { INC_COUNT (this->rep); }

Definition at line 295 of file basic.hpp.

#define ABSTRACT_TEMPLATE (   PTR,
  T 
)
Value:
CONCRETE_TEMPLATE(PTR,T);      \
  inline PTR (PTR##_rep<T>*)

Definition at line 219 of file basic.hpp.

#define ABSTRACT_TEMPLATE_CODE (   PTR,
  TT,
  T 
)
Value:
CONCRETE_TEMPLATE_CODE(PTR,TT,T);                       \
  template<TT T> inline PTR<T>::PTR (PTR##_rep<T>* rep2): \
    rep(rep2) { INC_COUNT (this->rep); }

Definition at line 222 of file basic.hpp.

#define ASSERT (   cond,
  msg 
)    { if (!(cond)) { tm_failure (msg); } }

Definition at line 88 of file basic.hpp.

#define CONCRETE (   PTR)
Value:
PTR##_rep *rep;                   \
public:                             \
  inline PTR (const PTR&);          \
  inline ~PTR ();                   \
  inline PTR##_rep* operator -> (); \
  inline PTR& operator = (PTR x)

Definition at line 157 of file basic.hpp.

#define CONCRETE_CODE (   PTR)
Value:
inline PTR::PTR (const PTR& x):                \
    rep(x.rep) { INC_COUNT (this->rep); }        \
  inline PTR::~PTR () { DEC_COUNT (this->rep); } \
  inline PTR##_rep* PTR::operator -> () {        \
    return rep; }                                \
  inline PTR& PTR::operator = (PTR x) {          \
    INC_COUNT (x.rep); DEC_COUNT (this->rep);    \
    this->rep=x.rep; return *this; }

Definition at line 164 of file basic.hpp.

#define CONCRETE_NULL (   PTR)
Value:
CONCRETE(PTR);           \
  inline PTR();            \
  friend bool is_nil /*LESSGTR*/ (PTR x)

Definition at line 233 of file basic.hpp.

#define CONCRETE_NULL_CODE (   PTR)
Value:
inline PTR::PTR (): rep(NULL) {}                      \
  inline PTR::PTR (const PTR& x):                       \
    rep(x.rep) { INC_COUNT_NULL (this->rep); }          \
  inline PTR::~PTR() { DEC_COUNT_NULL (this->rep); }    \
  inline PTR##_rep* PTR::operator -> () {               \
    return this->rep; }                                 \
  inline PTR& PTR::operator = (PTR x) {                 \
    INC_COUNT_NULL (x.rep); DEC_COUNT_NULL (this->rep); \
    this->rep=x.rep; return *this; }                    \
  inline bool is_nil (PTR x) { return x.rep==NULL; }

Definition at line 237 of file basic.hpp.

#define CONCRETE_NULL_TEMPLATE (   PTR,
  T 
)
Value:
CONCRETE_TEMPLATE(PTR,T);           \
  inline PTR();                       \
  friend bool is_nil LESSGTR (PTR<T> x)

Definition at line 248 of file basic.hpp.

#define CONCRETE_NULL_TEMPLATE_2 (   PTR,
  T1,
  T2 
)
Value:
CONCRETE_TEMPLATE_2(PTR,T1,T2);           \
  inline PTR();                             \
  friend bool is_nil LESSGTR (PTR<T1,T2> x)

Definition at line 264 of file basic.hpp.

#define CONCRETE_NULL_TEMPLATE_2_CODE (   PTR,
  TT1,
  T1,
  TT2,
  T2 
)
Value:
template<TT1 T1, TT2 T2> inline PTR<T1,T2>::PTR (): rep(NULL) {}        \
  template<TT1 T1, TT2 T2> inline PTR<T1,T2>::PTR (const PTR<T1,T2>& x):  \
    rep(x.rep) { INC_COUNT_NULL (this->rep); }                            \
  template<TT1 T1, TT2 T2> inline PTR<T1,T2>::~PTR () {                   \
    DEC_COUNT_NULL (this->rep); }                                         \
  template<TT1 T1, TT2 T2> PTR##_rep<T1,T2>* PTR<T1,T2>::operator -> () { \
    return this->rep; }                                                   \
  template<TT1 T1, TT2 T2>                                                \
  inline PTR<T1,T2>& PTR<T1,T2>::operator = (PTR<T1,T2> x) {              \
    INC_COUNT_NULL (x.rep); DEC_COUNT_NULL (this->rep);                   \
    this->rep=x.rep; return *this; }                                      \
  template<TT1 T1, TT2 T2> inline bool is_nil (PTR<T1,T2> x) {               \
    return x.rep==NULL; }

Definition at line 268 of file basic.hpp.

#define CONCRETE_NULL_TEMPLATE_CODE (   PTR,
  TT,
  T 
)
Value:
template<TT T> inline PTR<T>::PTR (): rep(NULL) {}                    \
  template<TT T> inline PTR<T>::PTR (const PTR<T>& x):                  \
    rep(x.rep) { INC_COUNT_NULL (this->rep); }                          \
  template<TT T> inline PTR<T>::~PTR () { DEC_COUNT_NULL (this->rep); } \
  template<TT T> inline PTR##_rep<T>* PTR<T>::operator -> () {          \
    return this->rep; }                                                 \
  template<TT T> inline PTR<T>& PTR<T>::operator = (PTR<T> x) {         \
    INC_COUNT_NULL (x.rep); DEC_COUNT_NULL (this->rep);                 \
    this->rep=x.rep; return *this; }                                    \
  template<TT T> inline bool is_nil (PTR<T> x) { return x.rep==NULL; }

Definition at line 252 of file basic.hpp.

#define CONCRETE_TEMPLATE (   PTR,
  T 
)
Value:
PTR##_rep<T> *rep;                  \
public:                               \
  inline PTR (const PTR<T>&);         \
  inline ~PTR ();                     \
  inline PTR##_rep<T>* operator -> (); \
  inline PTR<T>& operator = (PTR<T> x)

Definition at line 175 of file basic.hpp.

#define CONCRETE_TEMPLATE_2 (   PTR,
  T1,
  T2 
)
Value:
PTR##_rep<T1,T2> *rep;                   \
public:                                    \
  inline PTR (const PTR<T1,T2>&);          \
  inline ~PTR ();                          \
  inline PTR##_rep<T1,T2>* operator -> (); \
  inline PTR<T1,T2>& operator = (PTR<T1,T2> x)

Definition at line 193 of file basic.hpp.

#define CONCRETE_TEMPLATE_2_CODE (   PTR,
  TT1,
  T1,
  TT2,
  T2 
)
Value:
template<TT1 T1,TT2 T2> inline PTR<T1,T2>::PTR (const PTR<T1,T2>& x):       \
    rep(x.rep) { INC_COUNT (this->rep); }                                     \
  template<TT1 T1,TT2 T2> inline PTR<T1,T2>::~PTR () { DEC_COUNT(this->rep);} \
  template<TT1 T1,TT2 T2> inline PTR##_rep<T1,T2>* PTR<T1,T2>::operator -> () \
    { return this->rep; }                                                     \
  template <TT1 T1,TT2 T2>                                                    \
  inline PTR<T1,T2>& PTR<T1,T2>::operator = (PTR<T1,T2> x) {                  \
    INC_COUNT (x.rep); DEC_COUNT (this->rep);                                 \
    this->rep=x.rep; return *this; }

Definition at line 200 of file basic.hpp.

#define CONCRETE_TEMPLATE_CODE (   PTR,
  TT,
  T 
)
Value:
template<TT T> inline PTR<T>::PTR (const PTR<T>& x):            \
    rep(x.rep) { INC_COUNT (this->rep); }                         \
  template<TT T> inline PTR<T>::~PTR() { DEC_COUNT (this->rep); } \
  template<TT T> inline PTR##_rep<T>* PTR<T>::operator -> () {    \
    return this->rep; }                                           \
  template<TT T> inline PTR<T>& PTR<T>::operator = (PTR<T> x) {   \
    INC_COUNT (x.rep); DEC_COUNT (this->rep);                     \
    this->rep=x.rep; return *this; }

Definition at line 182 of file basic.hpp.

#define DEBUG_AUTO   (debug (DEBUG_FLAG_AUTO))

Definition at line 69 of file basic.hpp.

Definition at line 74 of file basic.hpp.

Definition at line 80 of file basic.hpp.

Definition at line 71 of file basic.hpp.

Definition at line 79 of file basic.hpp.

Definition at line 75 of file basic.hpp.

#define DEBUG_IO   (debug (DEBUG_FLAG_IO))

Definition at line 73 of file basic.hpp.

Definition at line 77 of file basic.hpp.

Definition at line 78 of file basic.hpp.

#define DEBUG_QT   (debug (DEBUG_FLAG_QT))

Definition at line 76 of file basic.hpp.

#define DEBUG_STD   (debug (DEBUG_FLAG_STD))

Definition at line 72 of file basic.hpp.

Definition at line 70 of file basic.hpp.

#define DEC_COUNT (   R)    { if(0==--((R)->ref_count)) tm_delete (R); }

Definition at line 152 of file basic.hpp.

#define DEC_COUNT_NULL (   R)    { if ((R)!=NULL && 0==--((R)->ref_count)) tm_delete (R); }

Definition at line 154 of file basic.hpp.

#define EXTEND (   BASE,
  PTR 
)
Value:
ABSTRACT(PTR);         \
  inline PTR(BASE&);     \
  inline operator BASE ()

Definition at line 312 of file basic.hpp.

#define EXTEND_CODE (   BASE,
  PTR 
)
Value:
ABSTRACT_CODE(PTR);                     \
  inline PTR::PTR(BASE& x):               \
    rep(static_cast<PTR##_rep*>(x.rep)) { \
    INC_COUNT (this->rep); }              \
  inline PTR::operator BASE () { return BASE (this->rep); }

Definition at line 316 of file basic.hpp.

#define EXTEND_NULL (   BASE,
  PTR 
)
Value:
ABSTRACT_NULL(PTR);         \
  inline PTR(BASE&);          \
  inline operator BASE ()

Definition at line 325 of file basic.hpp.

#define EXTEND_NULL_CODE (   BASE,
  PTR 
)
Value:
ABSTRACT_NULL_CODE(PTR);                \
  inline PTR::PTR(BASE& x):               \
    rep(static_cast<PTR##_rep*>(x.rep)) { \
    INC_COUNT_NULL(this->rep); }          \
  inline PTR::operator BASE () { return BASE (this->rep); }

Definition at line 329 of file basic.hpp.

#define EXTEND_NULL_TEMPLATE (   BASE,
  PTR,
  T 
)
Value:
ABSTRACT_NULL_TEMPLATE(PTR,T);         \
  inline PTR<T>(BASE&);                  \
  inline operator BASE ()

Definition at line 336 of file basic.hpp.

#define EXTEND_NULL_TEMPLATE_CODE (   BASE,
  PTR,
  TT,
  T 
)
Value:
ABSTRACT_NULL_TEMPLATE_CODE(PTR,TT,T);         \
  template<TT T> inline PTR<T>::PTR(BASE& x):    \
    rep(static_cast<PTR##_rep<T>*>(x.rep)) {     \
    INC_COUNT_NULL(this->rep); }                 \
  template<TT T> inline PTR<T>::operator BASE () { return BASE (this->rep); }

Definition at line 340 of file basic.hpp.

#define FAILED (   msg)    { tm_failure (msg); }

Definition at line 89 of file basic.hpp.

#define INC_COUNT (   R)    { (R)->ref_count++; }

Definition at line 151 of file basic.hpp.

#define INC_COUNT_NULL (   R)    { if ((R)!=NULL) (R)->ref_count++; }

Definition at line 153 of file basic.hpp.

#define LESSGTR   <>

Definition at line 30 of file basic.hpp.

#define STACK_DELETE_ARRAY (   name)

Definition at line 56 of file basic.hpp.

#define STACK_NEW_ARRAY (   name,
  T,
  size 
)    T name[size]

Definition at line 55 of file basic.hpp.

#define TM_DEBUG (   x)

Definition at line 33 of file basic.hpp.


Typedef Documentation

typedef long long int DI

Definition at line 43 of file basic.hpp.

typedef short HI

Definition at line 36 of file basic.hpp.

typedef unsigned short HN

Definition at line 37 of file basic.hpp.

typedef long intptr_t

Definition at line 24 of file basic.hpp.

typedef void* pointer

Definition at line 45 of file basic.hpp.

typedef char QI

Definition at line 38 of file basic.hpp.

typedef unsigned char QN

Definition at line 39 of file basic.hpp.

typedef int SI

Definition at line 34 of file basic.hpp.

typedef unsigned int SN

Definition at line 35 of file basic.hpp.


Enumeration Type Documentation

anonymous enum
Enumerator:
DEBUG_FLAG_AUTO 
DEBUG_FLAG_VERBOSE 
DEBUG_FLAG_EVENTS 
DEBUG_FLAG_STD 
DEBUG_FLAG_IO 
DEBUG_FLAG_BENCH 
DEBUG_FLAG_HISTORY 
DEBUG_FLAG_QT 
DEBUG_FLAG_KEYBOARD 
DEBUG_FLAG_PACKRAT 
DEBUG_FLAG_FLATTEN 
DEBUG_FLAG_CORRECT 

Definition at line 59 of file basic.hpp.

Enumerator:
INDENT 
UNINDENT 
HRULE 
LF 

Definition at line 108 of file basic.hpp.


Function Documentation

SI as_int ( double  x) [inline]

Definition at line 106 of file basic.hpp.

{ return (SI) floor (x + 0.5); }
int copy ( int  x) [inline]

Definition at line 105 of file basic.hpp.

{ return x; }
bool debug ( int  which,
bool  write_flag = false 
)

Definition at line 25 of file basic.cpp.

                                   {
  if (write_flag) {
    debug_status= debug_status | (1 << which);
    return 0;
  }
  else return (debug_status & (1 << which)) > 0;
}

Here is the caller graph for this function:

bool debug_get ( string  s)

Definition at line 73 of file basic.cpp.

                     {
  if (s == "auto") return debug_get (DEBUG_FLAG_AUTO);
  else if (s == "verbose") return debug_get (DEBUG_FLAG_VERBOSE);
  else if (s == "events") return debug_get (DEBUG_FLAG_EVENTS);
  else if (s == "std") return debug_get (DEBUG_FLAG_STD);
  else if (s == "io") return debug_get (DEBUG_FLAG_IO);
  else if (s == "bench") return debug_get (DEBUG_FLAG_BENCH);
  else if (s == "history") return debug_get (DEBUG_FLAG_HISTORY);
  else if (s == "qt") return debug_get (DEBUG_FLAG_QT);
  else if (s == "keyboard") return debug_get (DEBUG_FLAG_KEYBOARD);
  else if (s == "packrat") return debug_get (DEBUG_FLAG_PACKRAT);
  else if (s == "flatten") return debug_get (DEBUG_FLAG_FLATTEN);
  else if (s == "correct") return debug_get (DEBUG_FLAG_CORRECT);
  else return false;
}

Here is the call graph for this function:

int debug_off ( )

Definition at line 34 of file basic.cpp.

             {
  int status= debug_status;
  debug_status= 0;
  return status;
}
void debug_on ( int  status)

Definition at line 41 of file basic.cpp.

void debug_set ( string  s,
bool  flag 
)

Definition at line 52 of file basic.cpp.

                              {
  if (s == "auto") debug_set (DEBUG_FLAG_AUTO, on);
  else if (s == "verbose") debug_set (DEBUG_FLAG_VERBOSE, on);
  else if (s == "events") debug_set (DEBUG_FLAG_EVENTS, on);
  else if (s == "std") debug_set (DEBUG_FLAG_STD, on);
  else if (s == "io") debug_set (DEBUG_FLAG_IO, on);
  else if (s == "bench") debug_set (DEBUG_FLAG_BENCH, on);
  else if (s == "history") debug_set (DEBUG_FLAG_HISTORY, on);
  else if (s == "qt") debug_set (DEBUG_FLAG_QT, on);
  else if (s == "keyboard") debug_set (DEBUG_FLAG_KEYBOARD, on);
  else if (s == "packrat") debug_set (DEBUG_FLAG_PACKRAT, on);
  else if (s == "flatten") debug_set (DEBUG_FLAG_FLATTEN, on);
  else if (s == "correct") debug_set (DEBUG_FLAG_CORRECT, on);
}

Here is the call graph for this function:

const char* default_look_and_feel ( )

Definition at line 200 of file basic.cpp.

                         {
  static const char* ret= default_look_and_feel_impl ();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool gui_is_qt ( )

Definition at line 138 of file basic.cpp.

             {
#ifdef QTTEXMACS
  return true;
#else
  return false;
#endif
}

Here is the caller graph for this function:

bool gui_is_x ( )

Definition at line 129 of file basic.cpp.

            {
#ifdef QTTEXMACS
  return false;
#else
  return true;
#endif
}

Here is the caller graph for this function:

int hash ( int  i) [inline]

Definition at line 102 of file basic.hpp.

{ return i; }
int hash ( pointer  ptr) [inline]

Definition at line 103 of file basic.hpp.

                              {
  return ((int) ((intptr_t) ptr)) + (((int) ((intptr_t) ptr)) % 19); }
SI max ( SI  i,
SI  j 
) [inline]

Definition at line 97 of file basic.hpp.

{ if (i>j) return i; else return j; }
DI max ( DI  i,
DI  j 
) [inline]

Definition at line 99 of file basic.hpp.

{ if (i>j) return i; else return j; }
double max ( double  i,
double  j 
) [inline]

Definition at line 101 of file basic.hpp.

{ if (i>j) return i; else return j; }
SI min ( SI  i,
SI  j 
) [inline]

Definition at line 96 of file basic.hpp.

{ if (i<j) return i; else return j; }
DI min ( DI  i,
DI  j 
) [inline]

Definition at line 98 of file basic.hpp.

{ if (i<j) return i; else return j; }
double min ( double  i,
double  j 
) [inline]

Definition at line 100 of file basic.hpp.

{ if (i<j) return i; else return j; }

Definition at line 94 of file basic.cpp.

                       {
  static int id= 0;
  id--;
  return id;
}
tm_ostream& operator<< ( tm_ostream out,
display_control  ctrl 
)

Definition at line 103 of file basic.cpp.

                                                    {
  int i;
  switch (ctrl) {
  case INDENT:
    out << "  ";
    current_indent += 2;
    break;
  case UNINDENT:
    out << "\b\b";
    current_indent -= 2;
    break;
  case HRULE:
    for (i=current_indent; i<78; i++) out << "-";
  case LF:
    out << "\n";
    for (i=0; i<current_indent; i++) out << " ";
    break;    
  }
  return out;
}
bool os_macos ( )

Definition at line 165 of file basic.cpp.

            {
#if defined (OS_MACOS)
  return true;
#else
  return false;
#endif
}

Here is the caller graph for this function:

bool os_mingw ( )

Definition at line 156 of file basic.cpp.

            {
#if defined (__MINGW__) || defined (__MINGW32__)
  return true;
#else
  return false;
#endif
}

Here is the caller graph for this function:

bool os_win32 ( )

Definition at line 147 of file basic.cpp.

            {
#if defined (OS_WIN32)
  return true;
#else
  return false;
#endif
}

Here is the caller graph for this function:

void tm_failure ( const char *  msg)

Definition at line 121 of file tm_debug.cpp.

                             {
  if (rescue_mode) {
    fprintf (stderr, "\nTeXmacs] Fatal unrecoverable error, %s\n", msg);
    exit (1);
  }
  rescue_mode= true;
  cerr << "\nTeXmacs] Fatal error, " << msg << "\n";

  string report= get_crash_report (msg);
  url dir ("$TEXMACS_HOME_PATH/system/crash");
  url err= url_numbered (dir, "crash_report_", "");
  if (!save_string (err, report))
    cerr << "TeXmacs] Crash report saved in " << err << "\n";
  else
    cerr << "TeXmacs] Crash report could not be saved in "
         << err << "\n"
         << "TeXmacs] Dumping report below\n\n"
         << report << "\n";

  server sv= get_server ();
  editor ed= sv -> get_editor ();
  string buf= tree_report (subtree (the_et, ed->rp), ed->rp);
  url buf_err= glue (err, "_tree");
  if (!save_string (buf_err, buf))
    cerr << "TeXmacs] Current buffer report saved in " << buf_err << "\n";
  else
    cerr << "TeXmacs] Current buffer report could not be saved in "
         << buf_err << "\n"
         << "TeXmacs] Dumping report below\n\n"
         << buf << "\n";

  auto_save ();
  close_all_pipes ();
  call ("quit-TeXmacs-scheme");
  clear_pending_commands ();
  //exit (1);
}

Here is the call graph for this function:

bool use_macos_fonts ( )

Definition at line 174 of file basic.cpp.

                   {
#ifdef OS_MACOS
  if (gui_is_qt ()) return true;
  string s= get_preference ("look and feel");
  if (s != "default" && s != "macos") return false;
  string l= get_output_language ();
  if (l == "bulgarian" || l == "russian" || l == "ukrainian") return false;
  return tt_font_exists ("LucidaGrande");
#else
  return false;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation