w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

xmain.c
Go to the documentation of this file.
1 /*
2  * xmain.c
3  *
4  * This file is part of the Oxford Oberon-2 compiler
5  * Copyright (c) 2006--2016 J. M. Spivey
6  * All rights reserved
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  * 3. The name of the author may not be used to endorse or promote products
17  * derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #define main xmain
32 
33 #include <string.h>
34 #include <stdlib.h>
35 
36 #define EXTERN
37 #include "obx.h"
38 #include "keiko.h"
39 #include "exec.h"
40 
41 #ifdef JIT
42 #include "vm.h"
43 #ifdef DEBUG
44 #define JTEST 1
45 #endif
46 #endif
47 
48 #ifdef PROFILE
49 #define MYNAME "profiler"
50 #else
51 #ifdef OBXDEB
52 #define MYNAME "debugging monitor"
53 #else
54 #define MYNAME "runtime system"
55 #endif
56 #endif
57 
58 const char *version =
59 "Oxford Oberon-2 " MYNAME " version " PACKAGE_VERSION " [build " REVID "]"
60 #ifdef JIT
61  " (JIT)"
62 #else
63  ""
64 #endif
65 #ifdef DEBUG
66  " (debug)"
67 #else
68  ""
69 #endif
70  ;
71 
72 extern const char *lib_version;
73 const char *copyright = "Copyright (C) 1999--2012 J. M. Spivey";
74 
75 extern int vm_debug;
76 
77 /* Helper functions for the loader */
78 
79 void make_module(char *name, word addr, int chksum, int nlines) {
80  module m = scratch_alloc_atomic(sizeof(struct _module));
81  static int nm = 0;
82 
83  if (modtab == NULL)
85 
86  m->m_name = name;
87  m->m_addr =addr;
88 #ifdef PROFILE
89  m->m_nlines = nlines;
90  m->m_lcount = NULL;
91  if (lflag && nlines > 0) {
92  m->m_lcount = scratch_alloc_atomic(nlines * sizeof(unsigned));
93  memset(m->m_lcount, 0, nlines * sizeof(int));
94  }
95 #endif
96 #ifdef OBXDEB
97  debug_message("module %s %#x", name, chksum);
98 #endif
99  if (nm >= nmods) panic("Too many modules");
100  modtab[nm++] = m;
101 }
102 
103 void make_proc(char *name, word addr) {
104  proc p = scratch_alloc_atomic(sizeof(struct _proc));
105  static int np = 0;
106 
107  if (proctab == NULL)
109 
110  p->p_name = name;
111  p->p_addr = addr;
112 #ifdef PROFILE
113  p->p_calls = p->p_rec = p->p_self = p->p_child = 0;
114  p->p_parents = p->p_children = NULL;
115 #endif
116 #ifdef OBXDEB
117  value *cp = ptrcast(value, p->p_addr);
118  debug_message("proc %s %#x %#x %d", name, addr,
119  cp[CP_CODE].a, cp[CP_SIZE].i);
120 #endif
121  if (np >= nprocs) panic("Too many procs");
122  proctab[np++] = p;
123 }
124 
125 void make_symbol(const char *kind, char *name, word addr) {
126 #ifdef OBXDEB
127  debug_message("%s %s %#x", kind, name, addr);
128 #endif
129 }
130 
131 /* fix_sizes -- calculate module lengths */
132 void fix_sizes(int dseg) {
133  word p = dsegaddr(dmem + dseg);
134  int i;
135 
136  for (i = nmods-1; i >= 0; i--) {
137  modtab[i]->m_length = p - modtab[i]->m_addr;
138  p = modtab[i]->m_addr;
139  }
140 }
141 
142 
143 /* Runtime errors */
144 
145 #ifndef OBXDEB
146 #define TOP 5 /* Number of frames shown at top and bottom */
147 #define BOT 5
148 #define GAP 10 /* Don't omit less than this many frames */
149 #define NBUF (BOT+GAP-1)
150 
151 static void backtrace(value *bp) {
152  value *fp = bp, *cp = valptr(bp[CP]);
153  proc p = find_proc(dsegaddr(cp));
154  int n, j;
155  proc fbuf[NBUF];
156 
157  fprintf(stderr, "In procedure %s\n", p->p_name);
158 
159  /* Chain down the stack, printing the first TOP frames,
160  and saving the last NBUF in a circular buffer. */
161  for (n = 0;; n++) {
162  /* Each frame contains the cp and bp of its caller */
163  fp = valptr(fp[BP]); /* Base pointer of next frame */
164  if (fp == NULL) break;
165  cp = valptr(fp[CP]); /* Constant pool of next frame */
166  fbuf[n%NBUF] = p = find_proc(dsegaddr(cp));
167  if (n < TOP)
168  fprintf(stderr, " called from %s\n", p->p_name);
169  }
170 
171  /* Now the last NBUF frames are f(n-NBUF), ..., f(n-1)
172  where f(i) = fbuf[i%NBUF] -- unless there are fewer
173  then NBUF frames in all. */
174 
175  if (n < TOP+GAP+BOT)
176  /* Print the n-TOP frames not printed already */
177  j = TOP;
178  else {
179  /* Omit n-(TOP+BOT) frames (at least GAP) and print the
180  last BOT frames */
181  fprintf(stderr, " ... %d intervening frames omitted ...\n",
182  n-(TOP+BOT));
183  j = n-BOT;
184  }
185 
186  /* Print frames j, ..., n-1 */
187  for (; j < n; j++)
188  fprintf(stderr, " called from %s\n", fbuf[j%NBUF]->p_name);
189 }
190 #endif
191 
192 static const char *message(int code) {
193  switch (code) {
194  case E_CAST:
195  return "dynamic type error in cast";
196  case E_ASSIGN:
197  return "dynamic type error in record assignment";
198  case E_CASE:
199  return "no matching label in CASE statement";
200  case E_WITH:
201  return "no matching type guard in WITH statement";
202  case E_RETURN:
203  return "function failed to return a result";
204  case E_BOUND:
205  return "array bound error";
206  case E_NULL:
207  return "null pointer error";
208  case E_DIV:
209  return "DIV or MOD by zero";
210  case E_FDIV:
211  return "division by zero";
212  case E_STACK:
213  return "stack overflow";
214  case E_GLOB:
215  return "assignment of local procedure";
216  default:
217  return "the impossible has happened";
218  }
219 }
220 
221 /* error_stop -- runtime error with explicit message text */
222 void error_stop(const char *msg, int val, int line, value *bp, uchar *pc) {
223  value *cp = valptr(bp[CP]);
224 
225 #ifdef OBXDEB
226  char buf[256];
227  sprintf(buf, msg, val);
228  debug_break(cp, bp, pc, "error %d %s", line, buf);
229 #else
231 
232  fprintf(stderr, "Runtime error: ");
233  fprintf(stderr, msg, val);
234  if (line > 0) fprintf(stderr, " on line %d", line);
235  if (mod != NULL && strcmp(mod->m_name, "_Builtin") != 0)
236  fprintf(stderr, " in module %s", mod->m_name);
237  fprintf(stderr, "\n");
238  fflush(stderr);
239 
240  if (nprocs == 0)
241  fprintf(stderr, "(No debugging information available)\n");
242  else if (bp != NULL)
243  backtrace(bp);
244 
245  fflush(stderr);
246 #endif
247 
248  exit(2);
249 }
250 
251 /* runtime_error -- report a runtime error */
252 void runtime_error(int m, int line, value *bp, uchar *pc) {
253  error_stop(message(m), 0, line, bp, pc);
254 }
255 
256 /* rterror -- simple version of runtime_error for JIT */
257 void rterror(int num, int line, value *bp) {
259 }
260 
261 /* stkoflo -- stack overflow handler for JIT */
262 void stkoflo(value *bp) {
264 }
265 
266 
267 /* Startup */
268 
269 #define argc saved_argc
270 #define argv saved_argv
271 
272 static void run(value *prog) {
273  value *sp;
274 
275  /* Allow 32-word safety margin (for tracing) */
276  sp = (value *) (stack + stack_size) - 32;
277 
278  sp -= HEAD;
279  sp[BP].a = 0;
280  sp[PC].a = 0;
281  sp[CP].a = dsegaddr(prog);
282  primcall(prog, sp);
283 }
284 
285 #ifndef PRELOAD
286 mybool custom_file(char *name) {
287  char buf[4];
288  FILE *fp;
289  int nread;
290  mybool result;
291 
292  fp = fopen(name, "rb");
293  if (fp == NULL) return FALSE;
294  fseek(fp, - (long) sizeof(trailer), SEEK_END);
295  nread = fread(buf, 1, 4, fp);
296  if (nread < 4 || strncmp(buf, MAGIC, 4) != 0)
297  result = FALSE;
298  else {
299  fseek(fp, 0, SEEK_SET);
300  nread = fread(buf, 1, 2, fp);
301  result = (nread == 2 && strncmp(buf, "#!", 2) != 0);
302  }
303  fclose(fp);
304  return result;
305 }
306 
307 #ifdef WINDOWS
308 #include <windows.h>
309 #include <winbase.h>
310 
311 char *search_path(char *name) {
312  static char buf[_MAX_PATH];
313  char *filepart;
314 
315  if (SearchPath(NULL, name, ".exe", _MAX_PATH, buf, &filepart) == 0)
316  return NULL;
317 
318  return buf;
319 }
320 #else
321 #include <sys/stat.h>
322 #ifdef HAVE_UNISTD_H
323 #include <unistd.h>
324 #endif
325 
326 char *search_path(char *name) {
327  char *path;
328  static char buf[256];
329  struct stat stbuf;
330 
331  if (name == NULL || strchr(name, '/') != NULL) return name;
332 
333  path = getenv("PATH");
334  if (path == NULL) return NULL;
335 
336  for (char *p = path, *q; p != NULL; p = q) {
337  q = strchr(p, ':');
338  char *r;
339  if (q == NULL) {
340  strcpy(buf, p);
341  r = buf + strlen(p);
342  } else {
343  strncpy(buf, p, q-p);
344  r = buf + (q-p); q++;
345  }
346  if (r > buf) *r++ = '/';
347  strcpy(r, name);
348 
349  if (access(buf, R_OK) == 0 && stat(buf, &stbuf) == 0
350  && S_ISREG(stbuf.st_mode))
351  return buf;
352  }
353 
354  return NULL;
355 }
356 #endif
357 
358 static char *progname;
359 #ifdef PROFILE
360 static char *profout;
361 static const char *dumpname = "obprof.out";
362 #endif
363 
364 static void usage(void) {
365 #ifdef PROFILE
366  fprintf(stderr,
367  "Usage: %s [-g] [-pl] [-o file] program [arg ...]\n",
368  progname);
369 #else
370  fprintf(stderr, "Usage: %s program [arg ...]\n", progname);
371 #endif
372  fflush(stderr);
373  _exit(1);
374 }
375 
376 #ifdef JTEST
377 static mybool tflag = 0;
378 #endif
379 
380 /* read_flags -- interpret flags */
381 static void read_flags(void) {
382  for (;;) {
383  argc--; argv++;
384  if (argc == 0 || argv[0][0] != '-') return;
385 
386  if (strcmp(argv[0], "--") == 0) {
387  argc--; argv++;
388  return;
389  } else if (strcmp(argv[0], "-d") == 0) {
390  dflag++;
391  } else if (strcmp(argv[0], "-v") == 0) {
392  fprintf(stderr, "%s\n", version);
393  fprintf(stderr, "%s\n", lib_version);
394  exit(0);
395  }
396 #ifdef PROFILE
397  else if (argc >= 2 && strcmp(argv[0], "-o") == 0) {
398  profout = argv[1];
399  argc--; argv++;
400  } else if (strcmp(argv[0], "-g") == 0) {
401  gflag = TRUE;
402  } else if (strcmp(argv[0], "-l") == 0
403  || strcmp(argv[0], "-pl") == 0) {
404  lflag = TRUE;
405  }
406 #endif
407 #ifdef TRACE
408  else if (strcmp(argv[0], "-q") == 0) {
409  qflag++;
410  }
411 #endif
412 #ifdef OBXDEB
413  else if (argc >= 2 && strcmp(argv[0], "-p") == 0) {
414  debug_socket = argv[1];
415  argc--; argv++;
416  }
417 #endif
418 #ifdef JTEST
419  else if (strcmp(argv[0], "-t") == 0) {
420  tflag++;
421  }
422 #endif
423  else {
424  usage();
425  }
426  }
427 }
428 
429 #ifdef PROFILE
430 static void dump_lcounts(void) {
431 #ifdef _WIN32
432  FILE *fp = fopen(dumpname, "wb");
433 #else
434  FILE *fp = fopen(dumpname, "w");
435 #endif
436  if (fp == NULL) {
437  fprintf(stderr, "%s: cannot write\n", dumpname);
438  exit(1);
439  }
440 
441  for (int m = 0; m < nmods; m++)
442  for (int n = 1; n <= modtab[m]->m_nlines; n++)
443  if (modtab[m]->m_lcount[n-1] > 0)
444  fprintf(fp, "%s %d %u\n", modtab[m]->m_name, n,
445  modtab[m]->m_lcount[n-1]);
446 
447  fclose(fp);
448 }
449 
450 static void print_profile(void) {
451  FILE *fp = stderr;
452 
453  if (profout != NULL) {
454 #ifdef _WIN32
455  fp = fopen(profout, "wb");
456 #else
457  fp = fopen(profout, "w");
458 #endif
459  if (fp == NULL) {
460  fprintf(stderr, "%s: cannot write\n", profout);
461  exit(1);
462  }
463 
464  fprintf(fp, "Command line:\n\n");
465  fprintf(fp, " %s", saved_argv[0]);
466  for (int i = 1; i < saved_argc; i++)
467  fprintf(fp, " %s", saved_argv[i]);
468  fprintf(fp, "\n\n");
469  }
470 
471  profile(fp);
472 
473  if (fp != stderr) fclose(fp);
474 }
475 #endif
476 #endif
477 
478 #ifdef JTEST
479 static void jit_test(void) {
480  dflag = vm_debug = 2; vm_aflag = 1;
481  if (nmods < 2) panic("Can't find main module");
482  module m = modtab[nmods-2];
483  for (int i = 0; i < nprocs; i++) {
484  proc p = proctab[i];
485  if (p->p_addr >= m->m_addr && p->p_addr < m->m_addr + m->m_length)
486  jit_compile(ptrcast(value, p->p_addr));
487  }
488 }
489 #endif
490 
491 /* xmain_exit -- exit after program has finished */
493 #ifdef OBXDEB
494  debug_break(NULL, NULL, NULL, "exit");
495 #endif
496 #ifdef PROFILE
497  print_profile();
498  if (lflag) dump_lcounts();
499 #endif
500  exit(status);
501 }
502 
503 /* error_exit -- exit after fatal error */
505 #ifdef OBXDEB
506  debug_message("quit");
507 #endif
508  exit(status);
509 }
510 
511 /* The interpreter can be invoked in three ways:
512  (i) Explicitly as "obx [flags] bytefile args"
513 
514  (ii) Via a #! script as "obx bytefile args"
515  or "bytefile bytefile args" under some Unixes
516 
517  (iii) In a glued-together executable as "bytefile args"
518 
519  Following the example of CAML Light, we recognize (iii) by seeing
520  if argv[0] names a bytefile that does not begin with #!. In that
521  case, we read that file for the bytecodes, and the program's args
522  follow immediately; otherwise, we look for flags and the name of
523  the bytefile before the program's args. In either case, we must be
524  prepared to search the shell path to find the bytefile.
525 
526  These rules are modified a bit if a custom file is built for
527  profiling: in that case, we look for switches even in case (iii).
528 
529  Actually, there's a fourth way: linking the interpreter with a
530  "preloaded" image. */
531 
532 int main(int ac, char *av[]) {
533 #ifndef M64X32
534  if (sizeof(uchar *) != 4) panic("Bad pointer size");
535 #endif
536 
537  argc = ac; argv = av;
538 
539 #ifndef PRELOAD
540  progname = argv[0];
541 
542  /* Read the command line first to handle -v */
543  char *codefile = search_path(argv[0]);
544  if (codefile != NULL && custom_file(codefile)) {
545 #ifdef PROFILE
546  char *prog = argv[0];
547  read_flags();
548  /* Fill the program name back in as argv[0] */
549  argc++; argv--;
550  argv[0] = prog;
551 #endif
552  } else {
553  read_flags();
554  if (argc < 1) usage();
555  codefile = search_path(argv[0]);
556  }
557 
558  if (codefile == NULL) panic("can't find %s", argv[0]);
559 #endif
560 
561 #ifdef OBXDEB
562  /* Now connect to the debugger process */
563  debug_init();
564 #endif
565 
566  gc_init();
567 
568 #ifdef JIT
569  vm_debug = dflag;
570  interpreter = wrap_prim(jit_trap);
571 #else
573 #endif
575 #ifdef USE_FFI
576  dynstub = wrap_prim(dlstub);
577 #endif
578 
579 #ifdef PRELOAD
580  load_image();
581 #else
582  FILE *fp = fopen(codefile, "rb");
583  if (fp == NULL) panic("can't open %s", codefile);
584  load_file(fp);
585  fclose(fp);
586 #endif
587 
588 #ifdef TRACE
589  if (dflag) dump();
590  if (qflag) exit(0);
591 #endif
592 
593 #ifdef JTEST
594  if (tflag) {
595  jit_test();
596  exit(0);
597  }
598 #endif
599 
600 #ifdef PROFILE
601  if (nprocs == 0)
602  panic("no symbol table in object file");
603 
604  prof_init();
605 #endif
606 
607 #ifdef OBXDEB
608  debug_break(NULL, NULL, NULL, "ready");
609 #endif
610 #ifdef DEBUG
611  if (dflag)
612  printf("Starting program at address %ld\n",
613  (long) ((uchar *) entry - dmem));
614 #endif
615 
616  run(entry);
617  xmain_exit(0);
618 }
619 
620 #ifdef JIT
621 value *interp(value *bp) {
622  panic("dummy interp called");
623  return NULL;
624 }
625 #endif
626 
628 #ifdef JIT
629  return vm_wrap((funptr) prim);
630 #else
631 #ifndef M64X32
632  return (word) prim;
633 #else
635  primitive **wrapper = ptrcast(primitive *, addr);
636  *wrapper = prim;
637  return addr;
638 #endif
639 #endif
640 }
bp
Definition: action.c:1035
cp
Definition: action.c:1035
q
Definition: afm2pl.c:2287
#define primitive(s, c, o)
#define name
static two_halves prim[2100+1]
Definition: aptex.h:393
double mod(double, int)
Definition: axohelp.c:326
#define n
Definition: t4ht.c:1290
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
long pc
Definition: disdvi.c:114
#define R_OK
Definition: defs.h:31
#define fopen
Definition: xxstdio.h:21
#define fread
Definition: xxstdio.h:25
#define fflush
Definition: xxstdio.h:24
#define fseek
Definition: xxstdio.h:30
static int np
Definition: bifont.c:64
char * strncpy()
int strcmp()
Definition: coll.cpp:143
int printf()
char * strcpy()
static char usage[]
Definition: giftopnm.c:59
#define a(n)
Definition: gpos-common.c:148
#define strchr
Definition: gsftopk.c:59
int kind
Definition: image.c:8980
void _exit()
static const char * progname
Definition: cjpeg.c:136
#define SEEK_SET
Definition: jmemansi.c:26
#define NORETURN
Definition: bzip2.c:94
static void panic(const Char *)
Definition: bzip2.c:746
unsigned char uchar
Definition: unzcrash.c:37
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
#define SEEK_END
Definition: ftzconf.h:251
void exit()
#define PACKAGE_VERSION
Definition: config.h:105
char * getenv()
int num
Definition: disdvi.c:621
#define buf
void dump(const char *start, const char *end)
Definition: pdfparse.c:74
pdf_obj * entry
Definition: pdfdoc.c:64
#define fclose
Definition: debug.h:100
#define access
Definition: win32lib.h:59
#define S_ISREG(m)
Definition: win32lib.h:207
#define fprintf
Definition: mendex.h:64
#define stack_size
Definition: ctangleboot.c:103
#define dumpname
Definition: texmfmp.h:102
int stat(const char *path, struct stat *sbuf)
int load_file(floc *flocp, char **ldname, int noerror)
Definition: load.c:252
int strncmp()
#define sprintf
Definition: snprintf.c:44
#define MAGIC
Definition: sqrtrem.c:107
#define E_ASSIGN
Definition: obcommon.h:109
#define E_CASE
Definition: obcommon.h:110
#define HEAD
Definition: obcommon.h:78
#define E_BOUND
Definition: obcommon.h:114
#define E_GLOB
Definition: obcommon.h:119
#define CP_SIZE
Definition: obcommon.h:84
#define E_STACK
Definition: obcommon.h:118
#define PC
Definition: obcommon.h:75
#define CP
Definition: obcommon.h:76
#define E_NULL
Definition: obcommon.h:115
#define E_RETURN
Definition: obcommon.h:113
#define E_FDIV
Definition: obcommon.h:117
#define BP
Definition: obcommon.h:74
#define E_WITH
Definition: obcommon.h:111
#define E_DIV
Definition: obcommon.h:116
int mybool
Definition: obcommon.h:37
#define CP_CODE
Definition: obcommon.h:83
#define E_CAST
Definition: obcommon.h:108
module * modtab
primitive dltrap
Definition: obx.h:197
int dflag
#define ptrcast(t, a)
Definition: obx.h:69
word dyntrap
Definition: obx.h:136
primitive interp
Definition: obx.h:197
#define valptr(v)
Definition: obx.h:57
int saved_argc
proc * proctab
#define find_module(cp)
Definition: obx.h:269
primitive dlstub
Definition: obx.h:197
char ** saved_argv
#define primcall(p, sp)
Definition: obx.h:144
#define dsegaddr(p)
Definition: obx.h:68
uchar * dmem
Definition: obx.h:129
int nprocs
Definition: obx.h:156
#define virtual_alloc_atomic(bytes)
Definition: obx.h:309
#define scratch_alloc_atomic(bytes)
Definition: obx.h:302
int nmods
mybool gflag
word interpreter
#define find_proc(cp)
Definition: obx.h:268
static GfxLCMSProfilePtr profile
Definition: pdftocairo.cc:243
unsigned short word
Definition: picttoppm.c:64
#define fp
int r
Definition: ppmqvga.c:68
bstring c int memset(void *s, int c, int length)
#define load_image
Definition: ptstiff3.c:71
#define status
#define REVID
Definition: config.h:80
Definition: obx.h:117
word m_addr
Definition: obx.h:119
int m_length
Definition: obx.h:120
Definition: obx.h:103
Definition: sed.h:84
Definition: inftrees.h:24
Definition: bdf.c:133
Definition: texview.c:48
Definition: tpic.c:45
Definition: spc_misc.c:56
Definition: exec.h:58
Definition: strexpr.c:21
pointer path
Definition: t1imager.h:36
#define FILE
Definition: t1stdio.h:34
int j
Definition: t4ht.c:1589
*job_name strlen((char *) job_name) - 4)
m
Definition: tex4ht.c:3990
#define sp
Definition: stack.c:11
char * prog
Definition: ttf2pfb.c:133
Definition: obx.h:51
void rterror(int num, int line, value *bp)
Definition: xmain.c:257
word wrap_prim(primitive *prim)
Definition: xmain.c:627
void error_stop(const char *msg, int val, int line, value *bp, uchar *pc)
Definition: xmain.c:222
void make_proc(char *name, word addr)
Definition: xmain.c:103
void make_symbol(const char *kind, char *name, word addr)
Definition: xmain.c:125
#define GAP
Definition: xmain.c:148
const char * lib_version
Definition: Builtin.c:7
void error_exit(int status)
Definition: xmain.c:504
void stkoflo(value *bp)
Definition: xmain.c:262
#define argv
Definition: xmain.c:270
static void run(value *prog)
Definition: xmain.c:272
void runtime_error(int m, int line, value *bp, uchar *pc)
Definition: xmain.c:252
int vm_debug
#define BOT
Definition: xmain.c:147
static void backtrace(value *bp)
Definition: xmain.c:151
void fix_sizes(int dseg)
Definition: xmain.c:132
const char * version
Definition: xmain.c:58
#define main
Definition: xmain.c:31
void xmain_exit(int status)
Definition: xmain.c:492
static const char * message(int code)
Definition: xmain.c:192
#define MYNAME
Definition: xmain.c:54
#define argc
Definition: xmain.c:269
#define NBUF
Definition: xmain.c:149
void make_module(char *name, word addr, int chksum, int nlines)
Definition: xmain.c:79
const char * copyright
Definition: xmain.c:73
#define TOP
Definition: xmain.c:146
void gc_init(void)
Definition: gc.c:1287