new copyright; att/bsd/shared
[unix-history] / usr / src / usr.bin / pascal / pdx / defs.h
CommitLineData
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
28typedef int BOOLEAN;
29
30#define FALSE 0
31#define TRUE 1
32
33typedef unsigned int ADDRESS; /* object code addresses */
34typedef short LINENO; /* source file line numbers */
35typedef struct sym SYM; /* symbol information structure */
36typedef struct symtab SYMTAB; /* symbol table */
37typedef struct node NODE; /* expression tree node */
38typedef short OP; /* tree operator */
39typedef struct opinfo OPINFO; /* tree operator information table */
40typedef unsigned int WORD; /* machine word */
41typedef unsigned char BYTE; /* machine byte */
42typedef 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
49extern char *mktemp(); /* make a temporary file name */
50
51/*
52 * Definitions of library routines.
53 */
54
55char *cmdname; /* name of command for error messages */
56char *errfilename; /* current file associated with error */
57short errlineno; /* line number associated with error */
58
7d4de299
KB
59int error(); /* print an error message */
60int panic(); /* print error message and exit */
d6dc6657
ML
61short 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)