3 This file is public domain.
4 Originally written 1995, Geoffrey Tobin.
5 The author has expressed the hope that any modification will retain enough content to remain useful. He would also appreciate being acknowledged as the original author in the documentation.
6 This declaration added 2008/11/14 by Clea F. Rees with the permission of Geoffrey Tobin.
8 - header for dv2dt.c and dt2dv.c, conversion programs
9 for human-readable "DTL" <-> DVI.
10 - (ANSI C) version 0.6.0 - 18:31 GMT +11 Wed 8 March 1995
11 - author: Geoffrey Tobin G.Tobin@ee.latrobe.edu.au
12 - patch: Michal Tomczak-Jaegermann ntomczak@vm.ucs.ualberta.ca
13 - Reference: "The DVI Driver Standard, Level 0",
14 by The TUG DVI Driver Standards Committee.
15 Appendix A, "Device-Independent File Format".
18 /* variety of DTL produced */
19 #define VARIETY "sequences-6"
21 /* version of DTL programs */
22 #define VERSION "0.6.0"
24 /* Test for ANSI/ISO Standard C */
25 #if (defined(__cplusplus) || defined(__STDC__) || defined(c_plusplus))
31 /* Version (Traditional or ANSI) of C affects prototype and type definitions */
33 #define ARGS(parenthesized_list) parenthesized_list
35 #define ARGS(parenthesized_list) ()
41 #define FILE_BEGIN SEEK_SET
48 /* types to store 4 byte signed and unsigned integers */
50 typedef unsigned long U4;
51 /* scanf and printf formats to read or write those */
54 /* 4 byte hexadecimal */
55 /* #define XF4 "%04lx" */
60 /* type for byte count for DVI file */
61 /* COUNT must be large enough to hold a U4 (unsigned 4 byte) value */
64 /* size of a TeX and DVI word is 32 bits; in some systems a `long int' is needed */
65 typedef long int word_t;
66 /* format for a DVI word */
69 /* string of 8-bit characters for machine: keyboard, screen, memory */
72 typedef char String[MAXSTRLEN+1];
74 /* string s of length l and maximum length m */
75 typedef struct {int l; int m; char * s;} Lstring;
77 int debug = 0; /* normally, debugging is off */
79 /* Is each DTL command parenthesised by a BCOM and an ECOM? */
81 int group = 0; /* by default, no grouping */
83 /* signals of beginning and end of a command and its arguments */
84 /* these apply only if group is nonzero */
89 # define BCOM_CHAR '{'
90 # define ECOM_CHAR '}'
92 /* beginning and end of a message string */
97 #define BMES_CHAR '\''
98 #define EMES_CHAR BMES_CHAR
100 /* beginning and end of sequence of font characters */
105 #define BSEQ_CHAR '('
106 #define ESEQ_CHAR ')'
108 /* escape and quote characters */
110 #define ESC_CHAR '\\'
111 #define QUOTE_CHAR '\"'
113 /* command names in DTL */
174 #define SPECIAL "special"
177 #define POSTPOST "post_post"
178 #define OPCODE "opcode"