~ubuntu-branches/ubuntu/wily/eso-midas/wily-proposed

« back to all changes in this revision

Viewing changes to incl/tex.h

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)tex.h    19.1 (ESO-IPG) 02/25/03 13:49:43 */
 
2
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
.TYPE           Header
 
4
.NAME           tex.h
 
5
.LANGUAGE       C
 
6
.AUTHOR         Francois Ochsenbein [ESO]
 
7
.CATEGORY       TeX-like scan
 
8
.COMMENTS       Definition of structures for scanning
 
9
                a ``TeX-like'' text.
 
10
.ENVIRONMENT    
 
11
.VERSION 1.0    20-Apr-1988: Creation
 
12
.VERSION 1.1    20-Nov-1990: Added obeylines / obeyspaces
 
13
------------------------------------------------------------*/
 
14
 
 
15
#ifndef TEX_DEF
 
16
 
 
17
#define TEX_DEF         0
 
18
 
 
19
#include <hash.h>       /* Hash table is used   */
 
20
 
 
21
#ifndef _TEMPLATES_
 
22
#include <compiler.h>
 
23
#endif
 
24
 
 
25
 
 
26
/*===========================================================================
 
27
 *             Structures
 
28
 *===========================================================================*/
 
29
 
 
30
#define TeX_BUF 40                      /* Normally, only one word...   */
 
31
 
 
32
typedef struct {
 
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];
 
54
        } TeX;
 
55
 
 
56
#if _TEMPLATES_
 
57
/*===========================================================================
 
58
 *              Function Templates
 
59
 *===========================================================================*/
 
60
int     tex_exec        (TeX *htex, char *str, int len);
 
61
int     tex_mexec       (TeX *htex, char **str, int nstrings);
 
62
int     tex_tell        (void);
 
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 */
 
70
#else
 
71
char    *tex_symbol();
 
72
#endif
 
73
 
 
74
/*===========================================================================
 
75
 *             Related functions and macros
 
76
 *===========================================================================*/
 
77
 
 
78
#define TeX_Execute(hTeX,s,l)           tex_exec(hTeX,s,l)
 
79
#define TeX_Continue(hTeX)              tex_exec(hTeX,(char *)0, 0)
 
80
 
 
81
#define TeX_ExecuteArray(hTeX,ss,n)     tex_mexec(hTeX,ss,n)
 
82
 
 
83
#define TeX_Load(hTeX,fid,bytes)        tex_load(hTeX,fid, bytes,0)
 
84
#define TeX_Include(hTeX,fname)         tex_input(hTeX,fname,0)
 
85
 
 
86
#endif