1
/* @(#)tex.h 19.1 (ESO-IPG) 02/25/03 13:49:43 */
2
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6
.AUTHOR Francois Ochsenbein [ESO]
7
.CATEGORY TeX-like scan
8
.COMMENTS Definition of structures for scanning
11
.VERSION 1.0 20-Apr-1988: Creation
12
.VERSION 1.1 20-Nov-1990: Added obeylines / obeyspaces
13
------------------------------------------------------------*/
19
#include <hash.h> /* Hash table is used */
26
/*===========================================================================
28
*===========================================================================*/
30
#define TeX_BUF 40 /* Normally, only one word... */
33
H_TABLE *macros; /* Stored macros */
34
int (*output)(); /* Output function */
35
int (*action)(); /* Action function */
36
char *ap; /* Parameter address */
37
char mode; /* Verbatim mode flag */
38
#define _TeX_BEGIN_ '\01' /* New Environment */
39
#define _TeX_END_ '\02' /* End Environment */
40
#define _TeX_ACTION_ '\03' /* Triggers action = next byte */
41
#define _TeX_ENDACTION_ '\04' /* End-of-action byte */
42
#define _TeX_VERBATIM_ '\05' /* Inhibate substitutions */
43
#define _TeX_DEF_ '\06' /* Definition flag */
44
#define _TeX_INCLUDE_ '\07' /* Include a file */
45
#define _TeX_IF_ '\021' /* Basic tests */
46
#define _TeX_LEN_ '\022' /* Length of a text */
47
#define _TeX_TIME_ '\023' /* Date / Time editions */
48
#define _TeX_obeylines '\101' /* Keep original line breaks */
49
#define _TeX_obeyspaces '\103' /* Keep original tabs / spaces */
50
#define _TeX_OBEY_ 0100
51
unsigned char flags; /* Defined by user */
52
short int nbuf; /* Number of chars in out_buf */
53
char out_buf[TeX_BUF];
57
/*===========================================================================
59
*===========================================================================*/
60
int tex_exec (TeX *htex, char *str, int len);
61
int tex_mexec (TeX *htex, char **str, int nstrings);
63
int tex_getvparm (int param_no); /* Verbatim parameter */
64
int tex_getparm (int param_no); /* Processed parameter */
65
int tex_unit (char *str, int len); /* Length of {....} */
66
int tex_input (TeX *htex, char *filename, int opt);
67
int tex_load (TeX *htex, int fid, int len, int opt);
68
int tex_list (TeX *htex); /* List Macros */
69
char *tex_symbol (char *str); /* Conversion of a Symbol */
74
/*===========================================================================
75
* Related functions and macros
76
*===========================================================================*/
78
#define TeX_Execute(hTeX,s,l) tex_exec(hTeX,s,l)
79
#define TeX_Continue(hTeX) tex_exec(hTeX,(char *)0, 0)
81
#define TeX_ExecuteArray(hTeX,ss,n) tex_mexec(hTeX,ss,n)
83
#define TeX_Load(hTeX,fid,bytes) tex_load(hTeX,fid, bytes,0)
84
#define TeX_Include(hTeX,fname) tex_input(hTeX,fname,0)