Commit | Line | Data |
---|---|---|
505bf312 KB |
1 | /*- |
2 | * Copyright (c) 1980 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * %sccs.include.redist.c% | |
3cd5310a | 6 | * |
505bf312 | 7 | * @(#)defs.h 5.5 (Berkeley) %G% |
3cd5310a | 8 | */ |
d6dc6657 ML |
9 | |
10 | /* | |
11 | * Global debugger defines. | |
12 | * | |
13 | * All files include this header. | |
14 | */ | |
15 | ||
16 | #include <stdio.h> | |
8cd6b1b5 CT |
17 | #include <stdlib.h> |
18 | #include <string.h> | |
d6dc6657 ML |
19 | |
20 | /* | |
21 | * Since C does not allow forward referencing of types, | |
22 | * all the global types are declared here. | |
23 | */ | |
24 | ||
25 | #define LOCAL static | |
26 | #define NIL 0 | |
27 | ||
28 | typedef int BOOLEAN; | |
29 | ||
30 | #define FALSE 0 | |
31 | #define TRUE 1 | |
32 | ||
33 | typedef unsigned int ADDRESS; /* object code addresses */ | |
34 | typedef short LINENO; /* source file line numbers */ | |
35 | typedef struct sym SYM; /* symbol information structure */ | |
36 | typedef struct symtab SYMTAB; /* symbol table */ | |
37 | typedef struct node NODE; /* expression tree node */ | |
38 | typedef short OP; /* tree operator */ | |
39 | typedef struct opinfo OPINFO; /* tree operator information table */ | |
40 | typedef unsigned int WORD; /* machine word */ | |
41 | typedef unsigned char BYTE; /* machine byte */ | |
42 | typedef struct frame FRAME; /* runtime activation record */ | |
43 | ||
44 | /* | |
45 | * Definitions of standard C library routines that aren't in the | |
46 | * standard I/O library, but which are generally useful. | |
47 | */ | |
48 | ||
d6dc6657 ML |
49 | extern char *mktemp(); /* make a temporary file name */ |
50 | ||
51 | /* | |
52 | * Definitions of library routines. | |
53 | */ | |
54 | ||
55 | char *cmdname; /* name of command for error messages */ | |
56 | char *errfilename; /* current file associated with error */ | |
57 | short errlineno; /* line number associated with error */ | |
58 | ||
7d4de299 KB |
59 | int error(); /* print an error message */ |
60 | int panic(); /* print error message and exit */ | |
d6dc6657 ML |
61 | short numerrors(); /* return number of errors since last call */ |
62 | ||
63 | /* | |
64 | * defintions for doing memory allocation | |
65 | */ | |
66 | ||
d6dc6657 ML |
67 | #define alloc(n, type) ((type *) malloc((unsigned) (n) * sizeof(type))) |
68 | #define dispose(p) { free((char *) p); p = NIL; } | |
69 | ||
70 | /* | |
35bf0218 | 71 | * macro for doing freads |
d6dc6657 ML |
72 | */ |
73 | ||
74 | #define get(fp, var) fread((char *) &(var), sizeof(var), 1, fp) | |
d6dc6657 ML |
75 | |
76 | /* | |
77 | * string definitions | |
78 | */ | |
79 | ||
d6dc6657 | 80 | #define streq(s1, s2) (strcmp(s1, s2) == 0) |