home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / glass / glass.lha / GLASS / libtmc / tmc.h < prev   
Encoding:
C/C++ Source or Header  |  1990-11-06  |  4.9 KB  |  181 lines

  1. /* 
  2.    Copyright (C) 1990 C van Reewijk, email: dutentb.uucp!reeuwijk
  3.  
  4. This file is part of GLASS.
  5.  
  6. GLASS is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GLASS is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GLASS; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* file: tmc.h
  21.  *
  22.  * declaration of routines in tm library.
  23.  */
  24.  
  25. #ifndef _TM_TMCDEFS
  26. #if defined( __STDC__ ) && __STDC__>0
  27. /* print optimizer */
  28. extern void setprint( FILE *f, int istep, int width );
  29. extern void openlist( void );
  30. extern void closelist( void );
  31. extern void opencons( void );
  32. extern void closecons( void );
  33. extern void opentuple( void );
  34. extern void closetuple( void );
  35. extern void printword( char *w );
  36.  
  37. /* 'double' functions */
  38. #define rdup_double(d) (d)
  39. #define fre_double(d)
  40. #define rfre_double(d)
  41. extern int fscan_double( FILE *f, double *d );
  42. extern void print_double( double d );
  43. extern void fprint_double( FILE *f, double d );
  44. extern int cmp_double( double a, double b );
  45. #define doubleNIL (0.0)
  46.  
  47. /* 'int' functions */
  48. #define rdup_int(i) (i)
  49. #define fre_int(i)
  50. #define rfre_int(i)
  51. extern int fscan_int( FILE *f, int *i );
  52. extern void print_int( int i );
  53. extern void fprint_int( FILE *f, int i );
  54. #define cmp_int(a,b) ((a)-(b))
  55. #define intNIL (0)
  56.  
  57. /* 'unsigned' functions */
  58. #define rdup_unsigned(i) (i)
  59. #define fre_unsigned(i)
  60. #define rfre_unsigned(i)
  61. extern int fscan_unsigned( FILE *f, unsigned int *p );
  62. extern void print_unsigned( unsigned int u );
  63. extern void fprint_unsigned( FILE *f, unsigned int u );
  64. #define cmp_unsigned(a,b) ((a)-(b))
  65. #define unsignedNIL (0)
  66.  
  67. /* 'string' functions */
  68. typedef char *string;
  69. extern string new_string( char *s );
  70. #define rdup_string(s) new_string(s)
  71. extern void fre_string( string s );
  72. #define rfre_string(s) fre_string(s)
  73. extern int fscan_string( FILE *f, string *p );
  74. extern void print_string( string );
  75. extern void fprint_string( FILE *f, string s );
  76. #define cmp_string(a,b) strcmp(a,b)
  77. #define stringNIL ((char *)0)
  78. extern void stat_string( FILE *f );
  79.  
  80. /* General scanning functions */
  81. extern int fscanopenbrac( FILE *f );
  82. extern int fscanclosebrac( FILE *f, int n );
  83. extern int tmfneedc( FILE *f, int c );
  84. extern int fscancons( FILE *f, char *s );
  85. extern int fscanspace( FILE *f );
  86.  
  87. extern void tmfatal( char *file, int line, char *s );
  88. #else
  89. /* print optimizer */
  90. extern void setprint();
  91. extern void openlist();
  92. extern void closelist();
  93. extern void opencons();
  94. extern void closecons();
  95. extern void opentuple();
  96. extern void closetuple();
  97. extern void printword();
  98.  
  99. /* 'double' functions */
  100. #define rdup_double(d) (d)
  101. #define fre_double(d)
  102. #define rfre_double(d)
  103. extern int fscan_double();
  104. extern void print_double();
  105. extern void fprint_double();
  106. extern int cmp_double();
  107. #define doubleNIL (0.0)
  108.  
  109. /* 'int' functions */
  110. #define rdup_int(i) (i)
  111. #define fre_int(i)
  112. #define rfre_int(i)
  113. extern int fscan_int();
  114. extern void print_int();
  115. extern void fprint_int();
  116. #define cmp_int(a,b) ((a)-(b))
  117. #define intNIL (0)
  118.  
  119. /* 'unsigned' functions */
  120. #define rdup_unsigned(i) (i)
  121. #define fre_unsigned(i)
  122. #define rfre_unsigned(i)
  123. extern int fscan_unsigned();
  124. extern void print_unsigned();
  125. extern void fprint_unsigned();
  126. #define cmp_unsigned(a,b) ((a)-(b))
  127. #define unsignedNIL (0)
  128.  
  129. /* 'string' functions */
  130. typedef char *string;
  131. extern char *new_string();
  132. #define rdup_string(s) new_string(s)
  133. extern void fre_string();
  134. #define rfre_string(s) fre_string(s)
  135. extern int fscan_string();
  136. extern void print_string();
  137. extern void fprint_string();
  138. #define cmp_string(a,b) strcmp(a,b)
  139. #define stringNIL ((char *)0)
  140. extern void stat_string();
  141.  
  142. /* 'tmbool' functions */
  143. #define TMTRUESTR "True"
  144. #define TMFALSESTR "False"
  145. #ifdef orion
  146. /* Orion C compiler gets upset by use of enumerated type as boolean. */
  147. typedef short int tmbool;
  148. #define TMFALSE (0)
  149. #define TMTRUE (1)
  150. #else
  151. typedef enum en_tmbool { TMFALSE=0, TMTRUE=1 } tmbool;
  152. #endif
  153. #define new_tmbool(b) ((b)?TMTRUE:TMFALSE)
  154. #define rdup_tmbool(b) (b)
  155. #define fre_tmbool(b)
  156. #define rfre_tmbool(b)
  157. extern int fscan_tmbool();
  158. #define print_tmbool(b) printword((b)?TMTRUESTR:TMFALSESTR)
  159. #define fprint_tmbool(f,b) fputs(((b)?TMTRUESTR:TMFALSESTR),f)
  160. #define cmp_tmbool(a,b) ((int)a-(int)b)
  161. #define tmboolNIL TMFALSE
  162.  
  163. /* General scanning functions */
  164. extern int fscanopenbrac();
  165. extern int fscanclosebrac();
  166. extern int tmfneedc();
  167. extern int fscancons();
  168. extern int fscanspace();
  169.  
  170. extern void tmfatal();
  171. extern void tmbadtag();
  172. #endif
  173.  
  174. /* the error message buffer of tm and its length */
  175. extern char tmerrmsg[];
  176. #define TMERRLEN 100
  177. extern int tmlineno;
  178.  
  179. #define _TM_TMCDEFS 1
  180. #endif
  181.