1 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
4 /* allocate iniTeX (550 k) trie_c, trie_o, trie_l, trie_r, trie_hash, trie_taken */
6 /* allocate main memory for TeX (2 Meg) zmem = zzzaa */
8 /* NOT *//* allow increasing high area of main memory */ /* FLUSH */
10 /* NOT *//* allow increasing low area of main memory */ /* FLUSH */
12 /* allocate font_info (800 k) (dynamically now) */
14 /* allocate hyphenation trie stuff (270 k) trietrl, trietro, trietrc */
16 /* allocate hyphenation exception tables */
17 #define ALLOCATEHYPHEN
18 /* allow trie_size to be variable */
19 #define VARIABLETRIESIZE
20 /* allocate strings and string pointers (184 k)str_pool & str_start */
21 #define ALLOCATESTRING
22 /* NOT */ /* allocate hash table (zzzae) (78k) */
24 /* NOT */ /* allocate dvi_buf (16k) */ /* changed in 1.3 1996/Jan/18 */
25 /* #define ALLOCATEDVIBUF */
27 /* experiment to dynamically deal with save_stack 99/Jan/4 */
28 #define ALLOCATESAVESTACK
29 /* experiment to dynamically deal with input_stack 99/Jan/21 */
30 #define ALLOCATEINPUTSTACK
31 /* experiment to dynamically deal with neststack 99/Jan/21 */
32 #define ALLOCATENESTSTACK
33 /* experiment to dynamically deal with param_stack 99/Jan/21 */
34 #define ALLOCATEPARAMSTACK
35 /* experiment to dynamically deal with input buffer 99/Jan/22 */
36 #define ALLOCATEBUFFER
37 /* increase fixed allocations */
39 /* increase number of fonts - quarterword 16 bit - max_quarterword limit */
40 /* there may still be some bugs with this however ... also may slow down */
41 /* also: should split use of quarterword for (i) font from (ii) char */
42 /* for example, xeq_level ? hyphenation trietrc ? */
44 /* NOT NOT *//* allocate eqtb (108k) */ /* changed in 1.3 1996/Jan/18 */
46 /* make font_info array fmemoryword == 32 bit instead of memory_word = 64 bit */
48 /* make hash table htwohalves == 32 bit instead of twohalves == 64 bit */
49 // #define SHORTHASH --- changed 2000/Feb/22 increase max_strings from 64K to 512M
51 /* increase trie_op_size from 751 to 3001 96/Oct/12 */
52 #define INCREASETRIEOP
55 /* With old PharLap linker it was important to avoid large fixed allocation */
56 /* Now may be better to use fixed arrays rather than allocate them */
57 /* hence ALLOCATEZQTB, ALLOCATEDVIBUF and ALLOCATEMINOR are NOT defined */
59 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
67 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
69 #define MAXLINE 256 // for log_line buffer
71 /* #define max_halfword 65535L */ /* for 32 bit memory word */
72 /* #define max_halfword 262143L */ /* for 36 bit memory word */
73 #define min_halfword -2147483647L /* for 64 bit memory word (signed) */
74 #define max_halfword 2147483647L /* for 64 bit memory word (signed) */
76 #define block_size 1000 /* block_size for variable length node alloc */
78 /* min_quarterword assumed 0 -- i.e. we use unsigned types for quarterword */
79 #define min_quarterword 0
81 #define max_quarterword 65535L
83 #define max_quarterword 255
86 /* #define default_mem_top 262140L */ /* usual big TeX allocation 2 Meg bytes */
87 /* #define default_mem_top 131070L */ /* usual big TeX allocation 1 Meg bytes */
88 #define default_mem_top 65534L /* usual small TeX allocation 0.5 Meg */
90 /* mem_bot smallest index in mem array dumped by iniTeX mem_top >= mem_min */
92 /* mem_top largest index in mem array dumped by iniTeX mem_top <= mem_max */
94 EXTERN integer mem_top;
95 #define max_mem_size (max_halfword / sizeof(memory_word) -1)
97 #define mem_top 262140L
100 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
102 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
103 /* mem_max == mem_top in iniTeX, otherwise mem_max >= mem_top */
104 /* if ALLOCATEMAIN is true, then mem_max is a variable */
105 /* otherwise it is a pre-processor defined constant */
107 EXTERN integer mem_max;
109 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
110 /* #define mem_max 262140L */
111 #define mem_max mem_top
114 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
115 /* if ALLOCATEMAIN is true, then mem_min is a variable */
116 /* otherwise it is a pre-processor defined constant */
117 /* mem_min == mem_bot in iniTeX, otherwise mem_min <= mem_bot */
119 EXTERN integer mem_min;
121 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
125 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
127 #define poolname TEXPOOLNAME
129 /* #define mem_top 262140L */
131 /* type definitions follow */
133 typedef unsigned char ASCII_code;
134 typedef unsigned char eight_bits;
135 typedef integer pool_pointer;
136 typedef integer str_number;
137 typedef unsigned char packed_ASCII_code;
138 typedef integer scaled;
139 typedef integer nonnegative_integer;
140 typedef char small_number;
142 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
143 /* buf_size is max size of input line and max size of csname */
144 /* make sure its multiple of four bytes long */
145 /* want to increase this so it can handle whole paragraph imported from WP */
147 /* #define buf_size 8192 */
148 /* #define buf_size 12000 */ /* 1996/Jan/17 */
149 /* #define buf_size 16384 */ /* 1998/June/30 */
150 /* #define buf_size 20000 */ /* 1999/Jan/7 */
152 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
153 /* #define buf_size 3000 */
156 #ifdef ALLOCATEBUFFER
157 #define initial_buf_size 1000
158 #define increment_buf_size 2000
159 #define buf_size 2000000L /* arbitrary limit <= max_halfword */
160 EXTERN ASCII_code *buffer;
162 #define buf_size 20000 /* 1999/Jan/7 */
163 EXTERN ASCII_code buffer[buf_size + 4]; /* padded out to ... + 4 */
165 EXTERN integer first;
167 EXTERN integer max_buf_stack;
169 #define error_line 79
170 #define half_error_line 50
171 #define max_print_line 79
173 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
175 /* maximum number of simultaneous input sources (?) */
176 /* #define stack_size 600 */ /* expanded again 1999/Jan/21 */
177 /* #define stack_size 800 */
178 /* maximum number of input files and insertions that can be going on */
179 /* #define max_in_open 15 */ /* for Y&Y TeX 1.2 */
180 /* #define max_in_open 31 */ /* 1996/Jan/17 */
181 /* #define max_in_open 63 */ /* 1996/Jan/18 */
182 #define max_in_open 127 /* 1996/Jan/20 - really ? */
183 /* save_size space for saving values outside of current group */
184 /* #define save_size 6000 */
185 /* #define save_size 8000 */ /* 1999/Jan/6 */
187 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
188 /* #define stack_size 300 */ /* Unix C version default */
189 #define max_in_open 15
190 /* #define save_size 1000 */ /* 3.14159 C version */
191 /* #define save_size 4000 */ /* 3.14159 C version */
194 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
195 /* maximum internal font number - cannot be greated than max_quarter_word ! */
197 /* #define font_max 511 */
198 #define font_max 1023 /* 1996/Jan/17 */
200 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
204 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
205 /* free the limit on font memory ! */ /* (2^32 - 1) / sizeof(memory_word) */
207 /* #define font_mem_size 262140L */
208 #define font_mem_size (max_halfword / sizeof(memory_word) -1)
210 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
211 #define font_mem_size 100000L
214 /* our real font_mem_size is 268435456 --- ridiculously large, of course */
216 /* #define non_address font_mem_size */ /* 3.141 */
217 #define non_address 0 /* 3.14159 96/Jan/16 */
219 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
221 /* below is new dynamic allocation - bkph 93/Nov/28 */ /* enough for lplain */
223 #define initial_font_mem_size 20000
224 #define increment_font_mem_size 40000
227 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
228 /* param_size maximum number of simultaneous macro parameters */
229 /* nest_size maximum number of semantic levels simultaneously active */
231 /* #define param_size 60 */ /* 3.14159 C version */
232 /* #define param_size 120 */
233 /* #define param_size 200 */ /* 1994/Oct/11 */
234 /* #define param_size 300 */ /* 1995/May/15 */
235 /* #define param_size 500 */ /* 1997/Jan/17 */
236 /* #define nest_size 40 */ /* 3.14159 C version */
237 /* #define nest_size 80 */
238 /* #define nest_size 100 */ /* 1994/Oct/11 */
239 /* #define nest_size 120 */ /* 1995/May/15 */
240 /* #define nest_size 200 */ /* 1999/Jan/7 */
242 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
243 /* #define param_size 60 */ /* Unix C default */
244 /* #define nest_size 40 */ /* Unix C default */
245 /* #define nest_size 100 */ /* Unix C default */
248 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
249 /* max_strings max number of strings */ /* (2^32 - 1) / sizeof (integer) */
250 #ifdef ALLOCATESTRING
251 /* #define max_strings 262140L */
252 // #define max_strings (max_halfword / sizeof(integer) -1)
253 #define max_strings (max_halfword / sizeof(pool_pointer) -1)
254 /* #define pool_size 4032000L */
255 #define pool_size (max_halfword - 1)
256 /* #define stringmargin 32768L */
257 #define stringmargin 10000
259 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
260 /* #define max_strings 15000 */
261 #define max_strings 16384
262 #define pool_size 124000L
264 #define stringvacancies 100000L
266 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
267 /* #if defined (ALLOCATEINITRIE) && defined (ALLOCATEHYPHEN) */
268 #ifdef VARIABLETRIESIZE
269 EXTERN integer trie_size;
270 #define default_trie_size 60000
271 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
273 #define trie_size 30000 /* 3.14159 C version */
276 /* increase trieop to accomadate more hyphenation patterns 96/OCt/12 */
278 #ifdef INCREASETRIEOP
279 #define trie_op_size 3001
280 #define neg_trie_op_size -3001
281 #define min_trie_op 0
282 #define max_trie_op 1000
284 #define trie_op_size 751
285 #define neg_trie_op_size -751
286 #define min_trie_op 0
287 #define max_trie_op 500
290 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
291 /* dvi_buf_size must be multiple of 8 - half is written out at a time */
292 #ifdef ALLOCATEDVIBUF
293 #define default_dvi_buf_size 16384
294 /* #define default_dvi_buf_size 32768 */ /* ? */
295 EXTERN int dvi_buf_size;
297 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
298 #define dvi_buf_size 16384 /* 3.14159 C version */
299 /* #define dvi_buf_size 32768 */ /* ? */
302 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
303 /* WARNING: increasing hash table for cs names is not trivial */
304 /* size of hash table for control sequence name < (mem_max - mem_min) / 10 */
305 /* #define hash_size 9500 */
306 /* #define hash_size 25000 */ /* 96/Jan/10 */
307 #define hash_size 32768 /* 96/Jan/17 */
308 /* trick to try and get around eqtb_extra problem */
309 /* #define hash_extra -256 */
310 #define hash_extra (255 - font_max)
311 /* hash prime about 85% of hash_size (+ hash_extra) */
312 /* #define hashprime 7919 */
313 /* #define hash_prime 21247 */ /* 96/Jan/10 */
314 #define hash_prime 27197 /* 96/Jan/17 */
315 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
317 /* CONSTRAINT: reconcile increase font use by stealing from hash table ... */
319 /* Probably require eqtb_extra to be zero, so hash_extra = 255 - font_max */
320 #if (hash_extra != 255 - font_max)
321 #error ERROR: hash_extra not equal to (255 - font_max)
324 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
326 /* some sanity check when using narrow hash table ... */
328 /* using SHORTHASH limits hash_size to be less than 65536 */
329 /* using SHORTHASH limits max_strings to be less than 65536 */
330 /* if you ever need more string pointers, then #undef SHORTHASH --- */
331 /* you'll use more memory (about 130k byte) and format file larger (8k) */
334 /* can only do this if INCREASEFONTS defined up above ... */
335 #if (max_quarterword < 65535L)
336 #error ERROR: max_quarterword < 65535L
338 /* with narrowed hash table can only have 65535 string pointers */
339 /* #if (max_strings > max_quarterword) */ /* this test does not work */
341 #define max_strings max_quarterword
343 /* with narrowed hash table can only have 65535 hash table entries */
344 #if (hash_size > max_quarterword)
346 #define hash_size max_quarterword
348 #endif /* end of if SHORTHASH */
350 /* NOTE: if you define/undefine SHORTFONT have to redo formats */
352 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
354 typedef unsigned short quarterword;
356 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
357 typedef unsigned char quarterword;
360 /* possible alternative ? */ /* min_halfword = 0 and double max_halfword ? */
361 /* typedef unsigned long halfword; NO NO: since mem_min may be < 0 */
362 typedef integer halfword;
363 typedef char twochoices;
364 typedef char fourchoices;
366 #include "texmfmem.h"
368 typedef char glue_ord;
371 /* short mode_field; */
373 halfword head_field, tail_field;
374 integer pg_field, ml_field;
375 memory_word aux_field;
376 /* quarterword lhmfield, rhmfield; */ /* was in TeX 3.141 ... */
379 typedef char group_code;
382 quarterword state_field, index_field;
383 halfword start_field, loc_field, limit_field, name_field;
386 typedef integer internal_font_number;
387 typedef integer font_index;
388 typedef integer dvi_index;
389 typedef integer trie_op_code;
390 typedef integer trie_pointer;
392 /* typedef short hyph_pointer; */ /* increased 1996/Oct/20 ??? */
393 typedef integer hyph_pointer;
396 EXTERN ASCII_code xord[256];
397 EXTERN ASCII_code xchr[256];
398 /* EXTERN char name_of_file[PATHMAX + 1]; */
399 // EXTERN char name_of_file[PATHMAX + 4]; /* padded out 512 + 4 */
400 EXTERN unsigned char name_of_file[PATHMAX + 4]; // fix 2000 June 18
401 EXTERN integer name_length;
403 /* EXTERN ASCII_code buffer[buf_size + 1]; */
404 /* EXTERN ASCII_code buffer[buf_size + 4]; */ /* padded out to ... + 4 */
406 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
407 #ifdef ALLOCATESTRING
408 #define initial_pool_size 40000
409 #define increment_pool_size 80000
410 EXTERN packed_ASCII_code *str_pool;
411 #define initial_max_strings 5000
412 #define increment_max_strings 10000
413 EXTERN pool_pointer *str_start;
415 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
416 EXTERN packed_ASCII_code str_pool[pool_size + 1];
417 EXTERN pool_pointer str_start[max_strings + 1];
420 EXTERN pool_pointer pool_ptr;
421 EXTERN str_number str_ptr;
422 EXTERN pool_pointer init_pool_ptr;
423 EXTERN str_number init_str_ptr;
426 EXTERN alpha_file pool_file;
429 EXTERN alpha_file log_file;
430 /* EXTERN char selector; */
431 /* EXTERN integer selector; */ /* padded out */
432 EXTERN int selector; /* padded out */ /* 95/Jan/7 */
433 /* EXTERN char dig[23]; */
434 EXTERN char dig[23 + 1]; /* padded out */
435 EXTERN integer tally;
436 EXTERN integer term_offset;
437 EXTERN integer file_offset;
438 EXTERN ASCII_code trick_buf[error_line + 1]; /* already padded 79 + 1 */
439 EXTERN integer trick_count;
440 EXTERN integer first_count;
441 /* EXTERN char interaction; */
442 /* EXTERN integer interaction; */ /* padded out */
443 EXTERN int interaction; /* padded out */ /* 95/Jan/7 */
444 EXTERN bool deletions_allowed;
445 EXTERN bool set_box_allowed;
446 /* EXTERN char history; */
447 /* EXTERN integer history; */ /* padded out */
448 EXTERN int history; /* padded out */ /* 95/Jan/7 */
449 /* EXTERN schar error_count; */
450 /* EXTERN integer error_count; */ /* padded out */
451 EXTERN int error_count; /* padded out */ /* 95/Jan/7 */
452 /* EXTERN str_number help_line[6]; */
453 EXTERN char * help_line[6];
454 /* EXTERN char help_ptr; */
455 /* EXTERN integer help_ptr; */ /* padded out */
456 EXTERN int help_ptr; /* padded out */ /* 95/Jan/7 */
457 EXTERN bool use_err_help;
458 /* EXTERN integer interrupt; */
459 EXTERN volatile integer interrupt; /* bkph - do avoid compiler optimization */
460 EXTERN bool OK_to_interrupt;
461 EXTERN bool arith_error;
462 EXTERN scaled tex_remainder;
463 EXTERN halfword temp_ptr;
465 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
467 EXTERN memory_word *mainmemory; /* remembered so can be free() later */
468 EXTERN memory_word *zzzaa;
471 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
473 /* #define zmem (zzzaa - (int)(mem_min)) */
474 /* zzzaa[mem_max - mem_min + 1]; */
475 #define zmem (zzzaa - (int)(mem_bot))
476 zzzaa[mem_max - mem_bot + 1];
479 EXTERN halfword lo_mem_max;
480 EXTERN halfword hi_mem_min;
481 EXTERN integer var_used, dyn_used;
482 EXTERN halfword avail;
483 EXTERN halfword mem_end;
484 EXTERN halfword mem_start; /* new in 3.14159 ??? */
485 EXTERN halfword rover;
487 /* NOTE: the following really also need to be dynamically allocated */
489 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
493 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
494 /* EXTERN bool */ /* save (4 - 1) * mem_max - mem_min */
496 /* #define freearr (zzzab - (int)(mem_min)) */
497 /* zzzab[mem_max - mem_min + 1]; */
498 #define freearr (zzzab - (int)(mem_bot))
499 zzzab[mem_max - mem_bot + 1];
505 /* EXTERN bool */ /* save (4 - 1) * mem_max - mem_min */
507 /* #define wasfree (zzzac - (int)(mem_min)) */
508 #define wasfree (zzzac - (int)(mem_bot))
509 /* zzzac[mem_max - mem_min + 1]; */
510 zzzac[mem_max - mem_bot + 1];
513 EXTERN halfword wasmemend, waslomax, washimin;
514 EXTERN bool panicking;
517 EXTERN integer font_in_short_display;
518 EXTERN integer depth_threshold;
519 EXTERN integer breadth_max;
520 /* EXTERN list_state_record nest[nest_size + 1]; */
521 /* EXTERN short shown_mode; */
522 /* EXTERN integer shown_mode; */ /* padded out */
523 EXTERN int shown_mode; /* padded out */ /* 95/Jan/7 */
524 /* EXTERN char old_setting; */
525 /* EXTERN integer old_setting; */ /* padded out */
526 EXTERN int old_setting; /* padded out */ /* 95/Jan/7 */
528 /* eqtn_extra is no longer used --- it should be 0 96/Jan/10 */
530 #define eqtb_extra (font_max - 255 + hash_extra)
535 /* Probably require eqtb_extra to be zero, so hash_extra = 255 - font_max */
536 #if (eqtb_extra != 0)
537 #error ERROR: eqtb_extra is not zero (need hash_extra equal 255 - font_max)
540 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
542 EXTERN memory_word *zeqtb;
543 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
546 /* EXTERN memory_word zeqtb[13507 + eqtb_extra]; */
547 EXTERN memory_word zeqtb[(hash_size + 4007) + eqtb_extra];
549 /* EXTERN memory_word zeqtb[13507]; */ /* hash_size = 9500 */
550 /* EXTERN memory_word zeqtb[29007]; */ /* hash_size = 25000 */
551 EXTERN memory_word zeqtb[(hash_size + 4007)];
555 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
556 /* EXTERN quarterword
557 #define xeq_level (zzzad -12663) hash_size = 9500
558 #define xeq_level (zzzad -28163) hash_size = 25000
562 /* #define xeq_level (zzzad - (12663 + eqtb_extra)) */
563 #define xeq_level (zzzad - ((hash_size + 3163) + eqtb_extra))
564 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
566 /* #define xeq_level (zzzad -12663) */
567 #define xeq_level (zzzad - (hash_size + 3163))
570 EXTERN quarterword zzzad[844]; /* ??? attempt to fix 99/Jan/5 */
571 /* region 5 & 6 int_base to eqtb_size: 13507 - 12663 */
573 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
575 #define hash (zzzae - 514)
576 zzzae[9767]; hash_size = 9500
577 zzzae[25267]; hash_size = 25000 */
581 EXTERN htwohalves *zzzae;
583 EXTERN twohalves *zzzae;
585 #define hash (zzzae - 514)
586 #else /* not allocating hash table */
587 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
593 #define hash (zzzae - 514)
596 zzzae[hash_size + 267 + eqtb_extra];
598 zzzae[hash_size + 267];
602 EXTERN halfword hash_used;
603 EXTERN bool no_new_control_sequence;
604 EXTERN integer cs_count;
606 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
607 /* using allocated save stack slows it down 1% to 2% */
608 /* despite reallocation, we still limit it to something finite */
609 /* to avoid soaking up all of machine memory in case of infinite loop */
610 #ifdef ALLOCATESAVESTACK
611 #define save_size 65536 /* arbitrary - ridiculously large */
612 #define initial_save_size 1000
613 #define increment_save_size 2000
614 EXTERN memory_word *save_stack;
616 #define save_size 8000 /* 1999/Jan/6 enough for even CRC */
617 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
618 EXTERN memory_word save_stack[save_size + 1];
621 EXTERN integer save_ptr;
622 EXTERN integer max_save_stack;
624 /* The following could really be char instead of quarterword ... */
625 /* EXTERN quarterword cur_level; */
626 /* EXTERN integer cur_level; */ /* padded out */
627 EXTERN int cur_level; /* padded out */ /* 95/Jan/7 */
629 /* EXTERN group_code cur_group; */
630 /* EXTERN integer cur_group; */ /* padded out */
631 EXTERN int cur_group; /* padded out */ /* 95/Jan/7 */
633 EXTERN integer cur_boundary;
634 EXTERN integer mag_set;
636 /* EXTERN eight_bits cur_cmd; */
637 /* EXTERN integer cur_cmd; */ /* padded out */
638 EXTERN int cur_cmd; /* padded out */ /* 95/Jan/7 */
640 /* EXTERN halfword cur_chr; */ /* itex, tex0, tex, tex3, tex5, tex6, tex7, tex8 */
641 EXTERN int cur_chr; /* 95/Jan/7 */
643 EXTERN halfword cur_cs;
644 EXTERN halfword cur_tok;
646 #ifdef ALLOCATENESTSTACK
647 #define nest_size 65536 /* arbitrary - ridiculously large */
648 #define initial_nest_size 100
649 #define increment_nest_size 200
650 EXTERN list_state_record * nest;
652 #define nest_size 200 /* 1999/Jan/7 */
653 EXTERN list_state_record nest[nest_size + 1];
655 EXTERN integer nest_ptr;
656 EXTERN integer max_nest_stack;
657 EXTERN list_state_record cur_list;
659 #ifdef ALLOCATEPARAMSTACK
660 #define param_size 65536 /* arbitrary - ridiculously large */
661 #define initial_param_size 100
662 #define increment_param_size 200
663 EXTERN halfword * param_stack;
665 #define param_size 500 /* 1997/Jan/17 */
666 EXTERN halfword param_stack[param_size + 1];
668 EXTERN integer param_ptr;
669 EXTERN integer max_param_stack;
671 #ifdef ALLOCATEINPUTSTACK
672 #define stack_size 65536 /* arbitrary - ridiculously large */
673 #define initial_stack_size 100
674 #define increment_stack_size 200
675 EXTERN in_state_record *input_stack;
677 #define stack_size 800
678 EXTERN in_state_record input_stack[stack_size + 1];
680 EXTERN integer input_ptr;
681 EXTERN integer max_in_stack;
683 EXTERN integer high_in_open; /* 1997/Jan/17 */
684 EXTERN in_state_record cur_input;
686 /* EXTERN integer in_open; */ /* used in itex, tex2, texmf */
687 EXTERN int in_open; /* 95/Jan/7 */
689 EXTERN integer open_parens;
690 EXTERN integer max_open_parens;
691 EXTERN alpha_file input_file[max_in_open + 1];
693 EXTERN integer line_stack[max_in_open + 1];
695 /* EXTERN char scanner_status; */
696 /* EXTERN integer scanner_status; */ /* padded out */
697 EXTERN int scanner_status; /* padded out */ /* 95/Jan/7 */
699 EXTERN halfword warning_index;
700 EXTERN halfword def_ref;
702 EXTERN integer align_state;
703 EXTERN integer base_ptr;
704 EXTERN halfword par_loc;
705 EXTERN halfword par_token;
706 EXTERN bool force_eof;
707 /* EXTERN halfword cur_mark[5]; */
708 EXTERN halfword cur_mark[6];
710 /* EXTERN char long_state; */
711 /* EXTERN integer long_state; */ /* padded out */
712 EXTERN int long_state; /* padded out */ /* 95/Jan/7 */
714 /* EXTERN halfword pstack[9]; */
715 EXTERN halfword pstack[10];
717 /* EXTERN integer cur_val; */
718 EXTERN int cur_val; /* 95/Jan/7 */
720 /* EXTERN char cur_val_level; */
721 /* EXTERN integer cur_val_level; */ /* padded out */
722 EXTERN int cur_val_level; /* padded out */ /* 95/Jan/7 */
724 /* EXTERN small_number radix; */
725 /* EXTERN integer radix; */ /* padded out */
726 EXTERN int radix; /* padded out */ /* 95/Jan/7 */
728 /* EXTERN glue_ord cur_order; */
729 /* EXTERN integer cur_order; */ /* padded out */
730 EXTERN int cur_order; /* padded out */ /* 95/Jan/7 */
732 EXTERN alpha_file read_file[16]; /* hard wired limit in TeX */
733 /* EXTERN char read_open[17]; */
734 EXTERN char read_open[20]; /* padded out */
736 EXTERN halfword cond_ptr;
738 /* EXTERN char if_limit; */
739 /* EXTERN integer if_limit; */ /* padded out */
740 EXTERN int if_limit; /* padded out */ /* 95/Jan/7 */
742 /* EXTERN small_number cur_if; */
743 /* EXTERN integer cur_if; */ /* padded out */
744 EXTERN int cur_if; /* padded out */ /* 95/Jan/7 */
746 EXTERN integer if_line;
747 EXTERN integer skip_line;
748 EXTERN str_number cur_name;
749 EXTERN str_number cur_area;
750 EXTERN str_number cur_ext;
751 EXTERN pool_pointer area_delimiter;
752 EXTERN pool_pointer ext_delimiter;
753 EXTERN integer format_default_length;
754 EXTERN ccharpointer TEX_format_default;
755 EXTERN bool name_in_progress;
756 EXTERN bool log_opened;
757 EXTERN bool quoted_file_name;
758 EXTERN str_number job_name;
759 EXTERN str_number output_file_name; // DVI file
760 EXTERN str_number texmf_log_name; // LOG file
761 EXTERN byte_file dvi_file;
762 EXTERN byte_file tfm_file;
763 EXTERN char * dvi_file_name;
764 EXTERN char * log_file_name;
766 /*******************************************************************/
768 /* SHORTFONTINFO halves the memory word used to store font info */
769 /* if it is not defined we use ordinary TeX memory words */
772 /* keep definition of fmemoryword in texmfmem.h */
773 /* keep definition of ffourquarters in texfmem.h */
774 /* keep definition of fquarterword in texfmem.h */
776 /* go back to original definition as TeX memory word */
778 #define fmemoryword memory_word
779 /* go back to original definition as fourquarters of a TeX word */
781 #define ffourquarters fourquarters
782 /* go back to original definition as quaterword */
784 #define fquarterword quarterword
787 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
789 EXTERN fmemoryword * font_info;
790 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
792 /* EXTERN memory_word font_info[font_mem_size + 1]; */
793 EXTERN fmemoryword font_info[font_mem_size + 1];
796 EXTERN font_index fmem_ptr;
797 EXTERN internal_font_number font_ptr;
798 EXTERN internal_font_number frozenfontptr; /* 99/Mar/26 */
799 /* There are about 24 integer size items per font, or about 100 bytes */
800 EXTERN ffourquarters font_check[font_max + 1];
802 EXTERN scaled font_size[font_max + 1];
803 EXTERN scaled font_dsize[font_max + 1];
804 EXTERN font_index font_params[font_max + 1]; /* in 3.14159 */
805 EXTERN str_number font_name[font_max + 1];
806 EXTERN str_number font_area[font_max + 1];
807 EXTERN eight_bits font_bc[font_max + 1]; /* already padded 511 + 1 = 512 */
808 EXTERN eight_bits font_ec[font_max + 1]; /* already padded 511 + 1 = 512 */
809 EXTERN halfword font_glue[font_max + 1];
810 /* use char instead of bool to save space, but is it worth slow down ? */
811 /* EXTERN char font_used[font_max + 1]; */
812 EXTERN bool font_used[font_max + 1];
814 /* might want to make some of following only one character wide also ? */
815 /* except some use -1 as special case value */
816 /* well, at least make them short instead of integer */
817 EXTERN integer hyphen_char[font_max + 1];
818 EXTERN integer skew_char[font_max + 1];
819 EXTERN font_index bchar_label[font_max + 1];
820 EXTERN short font_bchar[font_max + 1]; /* already padded 1023 + 1 = 1024 */
821 /* don't change above to int or format file will be incompatible */
822 EXTERN short font_false_bchar[font_max + 1]; /* already padded 1023 + 1 = 1024 */
823 /* don't change above to int or format file will be incompatible */
824 EXTERN integer char_base[font_max + 1];
825 EXTERN integer width_base[font_max + 1];
826 EXTERN integer height_base[font_max + 1];
827 EXTERN integer depth_base[font_max + 1];
828 EXTERN integer italic_base[font_max + 1];
829 EXTERN integer lig_kern_base[font_max + 1];
830 EXTERN integer kern_base[font_max + 1];
831 EXTERN integer exten_base[font_max + 1];
832 EXTERN integer param_base[font_max + 1];
834 EXTERN ffourquarters null_character;
836 EXTERN integer total_pages;
839 EXTERN integer max_push;
840 EXTERN integer last_bop;
841 EXTERN integer dead_cycles;
842 EXTERN bool doing_leaders;
844 /* EXTERN quarterword c, f; */
845 /* EXTERN integer c, f */; /* padded out */
846 EXTERN int c, f; /* padded out */ /* 95/Jan/7 */
848 EXTERN scaled rule_ht, rule_dp, rule_wd;
850 EXTERN integer lq, lr;
852 #ifdef ALLOCATEDVIBUF
853 EXTERN eight_bits *zdvibuf;
855 /* EXTERN eight_bits dvi_buf[dvi_buf_size + 1]; */
856 /* EXTERN eight_bits dvi_buf[dvi_buf_size + 4]; */ /* padded out */
857 EXTERN eight_bits zdvibuf[dvi_buf_size + 4]; /* padded out 1996/Jan/18 */
860 EXTERN dvi_index half_buf;
861 EXTERN dvi_index dvi_limit;
862 EXTERN dvi_index dvi_ptr;
863 EXTERN integer dvi_offset;
864 EXTERN integer dvi_gone;
865 EXTERN halfword down_ptr, right_ptr;
866 EXTERN scaled dvi_h, dvi_v;
867 EXTERN scaled cur_h, cur_v;
868 EXTERN internal_font_number dvi_f;
869 EXTERN integer cur_s;
870 EXTERN scaled totalstretch[4], totalshrink[4]; /* padded already */
871 EXTERN integer last_badness;
872 EXTERN halfword adjust_tail;
873 EXTERN integer pack_begin_line;
874 EXTERN twohalves empty_field;
875 EXTERN fourquarters null_delimiter;
876 EXTERN halfword cur_mlist;
878 /* EXTERN small_number cur_style; */
879 /* EXTERN integer cur_style; */ /* padded out */ /* tex5.c, tex7.c */
880 EXTERN int cur_style; /* padded out */ /* 95/Jan/7 */
882 /* EXTERN small_number cur_size; */
883 /* EXTERN integer cur_size; */ /* padded out */
884 EXTERN int cur_size; /* padded out */ /* 95/Jan/7 */
886 EXTERN scaled cur_mu;
887 EXTERN bool mlist_penalties;
888 EXTERN internal_font_number cur_f;
890 /* EXTERN quarterword cur_c; */
891 /* EXTERN integer cur_c; */ /* padded out */
892 EXTERN int cur_c; /* padded out */ /* 95/Jan/7 */
894 EXTERN ffourquarters cur_i;
896 EXTERN integer magic_offset;
897 EXTERN halfword cur_align;
898 EXTERN halfword cur_span;
899 EXTERN halfword cur_loop;
900 EXTERN halfword align_ptr;
901 EXTERN halfword cur_head, cur_tail;
902 EXTERN halfword just_box;
903 EXTERN halfword passive;
904 EXTERN halfword printed_node;
905 EXTERN halfword pass_number;
906 /* EXTERN scaled active_width[7]; */
907 EXTERN scaled active_width[8];
908 /* EXTERN scaled cur_active_width[7]; */
909 EXTERN scaled cur_active_width[8];
910 /* EXTERN scaled background[7]; */
911 EXTERN scaled background[8];
912 /* EXTERN scaled break_width[7]; */
913 EXTERN scaled break_width[8];
914 EXTERN bool noshrinkerroryet;
915 EXTERN halfword cur_p;
916 EXTERN bool second_pass;
917 EXTERN bool final_pass;
918 EXTERN integer threshold;
919 EXTERN integer minimal_demerits[4];
920 EXTERN integer minimum_demerits;
921 EXTERN halfword best_place[4];
922 EXTERN halfword best_pl_line[4];
923 EXTERN scaled disc_width;
924 EXTERN halfword easyline;
925 EXTERN halfword last_special_line;
926 EXTERN scaled first_width;
927 EXTERN scaled second_width;
928 EXTERN scaled first_indent;
929 EXTERN scaled second_indent;
930 EXTERN halfword best_bet;
931 EXTERN integer fewest_demerits;
932 EXTERN halfword best_line;
933 EXTERN integer actual_looseness;
934 EXTERN integer line_diff;
935 /* EXTERN short hc[64+2]; */ /* padded OK 66 * 2 = 132 which is divisible by 4 */
936 EXTERN int hc[66]; /* padded OK 66 * 2 = 132 which is divisible by 4 */
938 /* EXTERN small_number hn; */
939 /* EXTERN integer hn; */ /* padded out */
940 EXTERN int hn; /* padded out */ /* 95/Jan/7 */
942 EXTERN halfword ha, hb;
944 /* EXTERN internal_font_number hf; */
945 EXTERN int hf; /* 95/Jan/7 */
947 /* EXTERN short hu[64+2]; */ /* padded OK */
948 EXTERN int hu[66]; /* padded OK */
950 /* EXTERN integer hyf_char; */
951 EXTERN int hyf_char; /* 95/Jan/7 */
953 /* init_cur_lang new in 3.14159 */
954 /* EXTERN ASCII_code cur_lang, init_cur_lang; */
955 /* EXTERN integer cur_lang, init_cur_lang; */ /* padded out */
956 EXTERN int cur_lang, init_cur_lang; /* padded out */ /* 95/Jan/7 */
958 EXTERN integer lhyf, rhyf;
959 /* EXTERN init_l_hyf, init_r_hyf; */ /* new in 3.14159 */
960 EXTERN integer init_l_hyf, init_r_hyf; /* new in 3.14159 */
962 EXTERN halfword hyfbchar;
963 /* EXTERN char hyf[65]; */
964 EXTERN char hyf[68]; /* padded out */
965 EXTERN halfword init_list;
966 EXTERN bool init_lig;
967 EXTERN bool init_lft;
969 /* EXTERN small_number hyphen_passed; */
970 /* EXTERN integer hyphen_passed; */ /* padded out */
971 EXTERN int hyphen_passed; /* padded out */ /* 95/Jan/7 */
973 /* EXTERN halfword cur_l, cur_r; */ /* make int's ? 95/Jan/7 */
974 EXTERN int cur_l, cur_r; /* make int's ? 95/Jan/7 */
976 EXTERN halfword cur_q;
977 EXTERN halfword lig_stack;
978 EXTERN bool ligature_present;
979 EXTERN bool lft_hit, rt_hit;
981 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
982 /* could perhaps use packed_ASCII_code for trietrc ? */
984 EXTERN halfword *trietrl;
985 EXTERN halfword *trietro;
986 EXTERN quarterword *trietrc;
988 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
989 EXTERN halfword trietrl[trie_size + 1];
990 EXTERN halfword trietro[trie_size + 1];
991 EXTERN quarterword trietrc[trie_size + 1];
993 EXTERN small_number hyf_distance[trie_op_size + 1]; /* already padded 751 + 1 */
994 EXTERN small_number hyf_num[trie_op_size + 1]; /* already padded 751 + 1 */
995 EXTERN trie_op_code hyf_next[trie_op_size + 1];
996 EXTERN integer op_start[256];
998 /* if ALLOCATEHYPHEN is true, then hyphen_prime is a variable */
999 /* otherwise it is a pre-processor defined constant */
1000 #ifdef ALLOCATEHYPHEN
1001 #define default_hyphen_prime 1009
1002 EXTERN str_number * hyph_word;
1003 EXTERN halfword * hyph_list;
1004 /* EXTERN hyphen_prime; */
1005 EXTERN integer hyphen_prime;
1007 #define hyphen_prime 607
1008 /* EXTERN str_number hyph_word[608]; */
1009 EXTERN str_number hyph_word[hyphen_prime + 1];
1010 /* EXTERN halfword hyph_list[608]; */
1011 EXTERN halfword hyph_list[hyphen_prime + 1];
1014 /* EXTERN hyph_pointer hyph_count; */
1015 /* EXTERN integer hyph_count; */ /* padded out */
1016 EXTERN int hyph_count; /* padded out */ /* 95/Jan/7 */
1020 #define trieophash (zzzaf - (int)(neg_trie_op_size))
1021 zzzaf[trie_op_size - neg_trie_op_size + 1];
1022 EXTERN trie_op_code trie_used[256];
1023 EXTERN ASCII_code trie_op_lang[trie_op_size + 1]; /* already padded 751 + 1 */
1024 EXTERN trie_op_code trie_op_val[trie_op_size + 1];
1025 EXTERN integer trie_op_ptr;
1028 EXTERN trie_op_code max_op_used;
1029 EXTERN bool smallop;
1033 EXTERN packed_ASCII_code *trie_c;
1034 EXTERN trie_op_code *trie_o;
1035 EXTERN trie_pointer *trie_l;
1036 EXTERN trie_pointer *trie_r;
1037 EXTERN trie_pointer *trie_hash;
1038 #else /* end ALLOCATEINI */
1039 EXTERN packed_ASCII_code trie_c[trie_size + 1];
1040 EXTERN trie_op_code trie_o[trie_size + 1];
1041 EXTERN trie_pointer trie_l[trie_size + 1];
1042 EXTERN trie_pointer trie_r[trie_size + 1];
1043 EXTERN trie_pointer trie_hash[trie_size + 1];
1044 #endif /* end not ALLOCATEINI */
1045 EXTERN trie_pointer trie_ptr;
1050 /* EXTERN bool *trie_taken; */ /* save (4 - 1) * trie_size = 90,000 byte */
1051 EXTERN char *trie_taken;
1053 EXTERN bool trie_taken[trie_size + 1];
1056 EXTERN trie_pointer trie_min[256];
1057 EXTERN trie_pointer trie_max;
1058 EXTERN bool trie_not_ready;
1060 EXTERN scaled best_height_plus_depth;
1061 EXTERN halfword page_tail;
1063 /* EXTERN char page_contents; */
1064 /* EXTERN integer page_contents; */ /* padded out */
1065 EXTERN int page_contents; /* padded out */ /* 95/Jan/7 */
1067 #define cs_token_flag 4095 /* if we should want to use this ... */
1069 /* ********************************************************************* */
1071 /* do *some* sanity checking here --- rather than in TeX later 96/Jan/18 */
1072 /* (cannot catch everything here, since some is now dynamic) */
1074 #if (half_error_line < 30) || (half_error_line > error_line - 15)
1075 #error ERROR: (half_error_line < 30) || (half_error_line > error_line - 15) BAD 1
1078 #if (max_print_line < 60)
1079 #error ERROR: (max_print_line < 60) BAD 2
1082 #if (hash_prime > hash_size)
1083 #error ERROR: (hash_prime > hash_size) BAD 5
1086 #if (max_in_open > 127)
1087 #error ERROR: (max_in_open > 127) BAD 6
1090 #if (min_quarterword > 0) || (max_quarterword < 127)
1091 #error ERROR: (min_quarterword > 0) || (max_quarterword < 127) BAD 11
1094 #if (min_halfword > 0) || (max_halfword < 32767)
1095 #error ERROR: (min_halfword > 0) || (max_halfword < 32767) BAD 12
1098 #if (min_quarterword < min_halfword) || (max_quarterword > max_halfword)
1099 #error ERROR: (min_quarterword < min_halfword) || (max_quarterword > max_halfword) BAD 13
1102 #if (font_max > max_quarterword)
1103 #error ERROR: (font_max > max_quarterword) BAD 15
1106 #if (save_size > max_halfword)
1107 #error ERROR: (save_size > max_halfword) BAD 17
1110 #if (buf_size > max_halfword)
1111 #error ERROR: (buf_size > max_halfword) BAD 18
1114 #if (max_quarterword - min_quarterword) < 255
1115 #error (max_quarterword - min_quarterword) < 255 BAD 19
1118 /* ********************************************************************* */
1120 EXTERN scaled page_max_depth;
1121 EXTERN halfword best_page_break;
1122 EXTERN integer least_page_cost;
1123 EXTERN scaled best_size;
1124 EXTERN scaled page_so_far[8];
1125 EXTERN halfword last_glue;
1126 EXTERN integer last_penalty;
1127 EXTERN scaled last_kern;
1128 EXTERN integer insert_penalties;
1129 EXTERN bool output_active;
1130 EXTERN internal_font_number main_f;
1132 EXTERN ffourquarters main_i;
1133 EXTERN ffourquarters main_j;
1135 EXTERN font_index main_k;
1136 EXTERN halfword main_p;
1137 EXTERN integer main_s;
1138 EXTERN halfword bchar;
1139 EXTERN halfword false_bchar;
1140 EXTERN bool cancel_boundary;
1141 EXTERN bool ins_disc;
1142 EXTERN halfword cur_box;
1143 EXTERN halfword after_token;
1144 EXTERN bool long_help_seen;
1145 EXTERN str_number format_ident;
1146 EXTERN word_file fmt_file;
1147 EXTERN integer ready_already;
1149 EXTERN alpha_file write_file[16]; /* hard wired limit in TeX */
1150 EXTERN bool write_open[18];
1152 EXTERN halfword write_loc;
1153 EXTERN pool_pointer edit_name_start;
1154 /* EXTERN integer edit_name_length, edit_line, tfm_temp; */
1155 EXTERN integer edit_name_length, edit_line;
1156 /* EXTERN integer tfm_temp; */ /* only used in tex3.c */
1157 EXTERN int tfm_temp; /* only used in tex3.c 95/Jan/7 */
1159 /* new stuff defined in local.c - bkph */
1162 EXTERN bool is_initex;
1163 EXTERN bool verbose_flag;
1164 EXTERN bool trace_flag;
1165 EXTERN bool debug_flag;
1166 EXTERN bool heap_flag;
1167 EXTERN bool open_trace_flag;
1168 EXTERN bool cache_file_flag;
1169 EXTERN bool knuth_flag;
1170 EXTERN bool no_interrupts;
1171 EXTERN bool c_style_flag;
1172 EXTERN bool non_ascii;
1173 EXTERN bool key_replace;
1174 EXTERN bool deslash;
1175 EXTERN bool trimeof;
1176 EXTERN bool allow_patterns;
1177 EXTERN bool show_fonts_used;
1178 EXTERN bool reset_exceptions;
1179 EXTERN bool show_current;
1180 EXTERN bool current_flag;
1181 EXTERN bool current_tfm;
1182 EXTERN bool return_flag;
1183 EXTERN bool want_version;
1184 EXTERN bool civilize_flag;
1185 EXTERN bool show_numeric;
1186 EXTERN bool restrict_to_ascii;
1187 EXTERN bool show_missing;
1188 EXTERN bool full_file_name_flag;
1189 EXTERN bool save_strings_flag;
1190 EXTERN int mem_initex;
1191 EXTERN int mem_extra_high;
1192 EXTERN int mem_extra_low;
1193 EXTERN int new_hyphen_prime;
1194 EXTERN int missing_characters;
1195 EXTERN int show_in_hex;
1196 EXTERN int show_in_dos;
1197 EXTERN int test_dir_access;
1198 EXTERN int dir_method;
1199 EXTERN int file_method;
1200 /* EXTERN int waitflush; */
1201 EXTERN int show_fmt_flag;
1202 EXTERN int show_tfm_flag;
1203 EXTERN bool show_texinput_flag; /* 1998/Jan/28 */
1204 EXTERN bool truncate_long_lines; /* 1998/Feb/2 */
1205 EXTERN bool show_cs_names; /* 1998/Mar/31 */
1206 EXTERN int tab_step;
1207 EXTERN int pseudo_tilde;
1208 EXTERN int pseudo_space;
1209 EXTERN int allow_quoted_names;
1210 EXTERN int default_rule;
1211 EXTERN char *format_file;
1212 EXTERN char *source_direct; /* 1998/Sep/29 */
1213 EXTERN char *string_file;
1214 EXTERN int share_flag;
1215 EXTERN char *format_name;
1216 EXTERN char *encoding_name;
1217 EXTERN bool format_specific;
1218 EXTERN bool encoding_specific;
1219 EXTERN bool show_line_break_stats; /* 1996/Feb/9 */
1220 EXTERN int first_pass_count; /* 1996/Feb/9 */
1221 EXTERN int second_pass_count; /* 1996/Feb/9 */
1222 EXTERN int final_pass_count; /* 1996/Feb/9 */
1223 EXTERN int underfull_hbox; /* 1996/Feb/9 */
1224 EXTERN int overfull_hbox; /* 1996/Feb/9 */
1225 EXTERN int underfull_vbox; /* 1996/Feb/9 */
1226 EXTERN int overfull_vbox; /* 1996/Feb/9 */
1227 EXTERN int paragraph_failed; /* 1996/Feb/9 */
1228 EXTERN int singleline; /* 1996/Feb/15 */
1229 EXTERN FILE *errout;
1230 EXTERN int font_dimen_zero; /* 1998/Oct/5 */
1231 EXTERN int ignore_frozen; /* 1998/Oct/5 */
1232 EXTERN bool suppress_f_ligs; /* 1999/Jan/5 */
1233 EXTERN int abort_flag; // not yet hooked up ???
1234 EXTERN int err_level; // not yet hooked up ???
1235 EXTERN int jump_used; /* 1999/Nov/28 */
1236 EXTERN jmp_buf jumpbuffer; /* 1999/Nov/7 */
1240 extern int current_pool_size; /* in local.c - bkph */
1241 extern int current_max_strings; /* in local.c - bkph */
1242 extern int current_mem_size; /* in local.c - bkph */
1243 extern int current_font_mem_size; /* in local.c - bkph */
1244 extern int current_save_size; /* in local.c - bkph */
1245 extern int current_stack_size; /* in local.c - bkph */
1246 extern int current_nest_size; /* in local.c - bkph */
1247 extern int current_param_size; /* in local.c - bkph */
1248 extern int current_buf_size; /* in local.c - bkph */
1249 extern char *tex_version; /* in local.c - bkph */
1250 extern char *application; /* in local.c - bkph */
1251 extern char *yandyversion; /* in local.c - bkph */
1252 unsigned char wintodos[128]; /* in local.c - bkph */
1253 extern char last_filename[PATH_MAX]; /* in ourpaths.c */
1254 extern char log_line[MAXLINE]; /* in local.c */
1255 extern char *texpath; /* in local.c */
1257 memory_word * allocate_main_memory (int); /* in local.c - bkph */
1258 memory_word * realloc_main (int, int); /* in local.c - bkph */
1259 packed_ASCII_code * realloc_str_pool (int); /* in local.c - bkph */
1260 pool_pointer * realloc_str_start (int); /* in local.c - bkph */
1261 memory_word * realloc_save_stack (int); /* in local.c - bkph */
1262 list_state_record * realloc_nest_stack (int); /* in local.c - bkph */
1263 in_state_record * realloc_input_stack (int); /* in local.c - bkph */
1264 halfword * realloc_param_stack (int); /* in local.c - bkph */
1265 ASCII_code * realloc_buffer (int); /* in local.c - bkph */
1266 fmemoryword * realloc_font_info (int); /* in local.c - bkph */
1268 int realloc_hyphen (int); /* in local.c - bkph */
1269 int allocate_tries (int); /* in local.c - bkph */
1271 void tryandopen (char *); /* in local.c - bkph */
1272 void check_eqtb (char *); /* in local.c - bkph */
1273 void probe_memory (void); /* in local.c - bkph */
1274 // void show_maximums (FILE *); /* in local.c - bkph */
1275 void print_cs_names (FILE *, int); /* in local.c - bkph */
1276 void perrormod(char *); /* in local.c */
1278 char *grabenv(char *); /* in local.c - bkph */
1279 // void showversion (FILE *); /* in local.c - bkph */
1280 void stamp_it (char *); /* in local.c - bkph */
1281 void stampcopy (char *); /* in local.c - bkph */
1282 bool prime (int); /* in local.c - bkph */
1283 int endit (int); /* in local.c - bkph */
1285 void uexit (int unix_code); /* in lib/uexit.c - bkph */
1286 void t_open_in (void); /* in lib/texmf.c - bkph */
1288 bool extensionirrelevantp (unsigned char *base, int nlen, char *suffix);
1290 void call_edit (ASCII_code *filename, pool_pointer fnstart,
1291 integer fnlength, integer linenumber); /* from lib/texmf.c - bkph */
1293 void add_variable_space(int); /* in itex.c - bkph */
1295 void get_date_and_time (integer *minutes, integer *day,
1296 integer *month, integer *year); /* in lib/texmf.c - bkph */
1298 bool maketextex (void); /* in openinou.c */
1299 bool maketextfm (void); /* in openinou.c */
1301 unsigned char *unixify (unsigned char *); /* in pathsrch.c bkph */
1304 void show_line (char *, int); /* in local.c */
1305 void show_char (int); /* in local.c */
1306 int main(int, char *[]); /* in lib\texmf.c */
1310 int checkpool (char *); /* in itex.c - debugging */
1313 #endif /* ifdef MSDOS */
1315 /****************************************************************************/
1319 /****************************************************************************/
1322 #define term_only 17
1324 #define term_and_log 19
1326 #define new_string 21
1327 #define max_selector 21
1329 #define batch_mode 0
1330 #define nonstop_mode 1
1331 #define scroll_mode 2
1332 #define error_stop_mode 3
1335 #define warning_issued 1
1336 #define error_message_issued 2
1337 #define fatal_error_stop 3
1339 #define nx_plux_y(...) mult_and_add(..., 07777777777L)
1340 #define mult_integers(a) mult_and_add(a,0,07777777777L)
1342 #define inf_bad 10000L
1344 #define set_glue_ratio_zero(a) (a) = 0.0
1345 #define set_glue_ratio_one(a) (a) = 1.0
1346 #define tex_float(a) (a)
1347 #define unfloat(a) (a)
1348 #define float_constant(a) (float) (a)
1350 #define pointer halfword
1351 #define null min_halfword
1353 #define link(p) mem[(p)].hh.v.RH
1354 #define info(p) mem[(p)].hh.v.LH
1356 #define empty_flag max_halfword
1357 #define is_empty(a) (link(a) = empty_flag)
1358 #define node_size info
1359 #define llink(a) info(a+1)
1360 #define rlink(a) link(a+1)
1362 #define type(a) mem[a].hh.B0
1363 #define subtype(a) mem[a].hh.B1
1365 #define is_char_node(a) (a >= hi_mem_min)
1367 #define character subtype
1369 #define hlist_node 0
1370 #define box_node_size 7
1371 #define width_offset 1
1372 #define depth_offset 2
1373 #define height_offset 3
1374 #define width(a) mem[a + width_offset].sc
1375 #define depth(a) mem[a + depth_offset].sc
1376 #define height(a) mem[a + height_offset].sc
1377 #define shift_amount(a) mem[a + 4].sc
1378 #define list_offset 5
1379 #define glue_order(a) subtype(a + list_offset)
1380 #define glue_sign(a) type(a + list_offset)
1382 #define stretching 1
1384 #define glue_offset 6
1385 #define glue_set(a) mem[a + glue_offset].gr
1387 #define vlist_node 1
1390 #define rule_node_size 4
1391 #define null_flag -010000000000L
1392 #define is_running(a) (a = null_flag)
1395 #define ins_node_size 5
1396 #define float_cost(a) mem[a + 1].cint
1397 #define ins_ptr(a) info(a + 4)
1398 #define split_top_ptr(a) link(a + 4)
1400 #define ignore_depth -65536000L
1402 #define mode cur_list.mode_field
1403 #define head cur_list.head_field
1404 #define tail cur_list.tail_field
1405 #define aux cur_list.aux_field
1406 #define prev_depth aux.sc
1407 #define space_factor aux.hh.v.LH
1408 #define clang aux.hh.v.RH
1409 #define incompleat_noad aux.cint
1410 #define prev_graf cur_list.pg_field
1411 #define mode_line cur_list.ml_field
1413 #define level_zero min_quarterword
1414 #define level_one level_zero + 1
1417 extern void tex_help (unsigned int n, ...);
1419 #define help0() tex_help(0)
1420 #define help1(...) tex_help(1, __VA_ARGS__)
1421 #define help2(...) tex_help(2, __VA_ARGS__)
1422 #define help3(...) tex_help(3, __VA_ARGS__)
1423 #define help4(...) tex_help(4, __VA_ARGS__)
1424 #define help5(...) tex_help(5, __VA_ARGS__)
1425 #define help6(...) tex_help(6, __VA_ARGS__)