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