1 /* $Id: macro.h,v 1.9 1994/06/24 10:18:38 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
6 /* PREPROCESSOR: DEFINITION OF MACRO DESCRIPTOR */
8 /* The flags of the mc_flag field of the macro structure. Note that
9 these flags can be set simultaneously.
11 #define NOFLAG 0 /* no special flags */
12 #define FUNC 01 /* function attached */
13 #define NOREPLACE 02 /* don't replace */
15 #define FORMALP 0200 /* mask for creating macro formal parameter */
17 /* The macro descriptor is very simple, except the fact that the
18 mc_text, which points to the replacement text, contains the
19 non-ascii characters \201, \202, etc, indicating the position of a
20 formal parameter in this text.
24 char * mc_text; /* the replacement text */
25 int mc_nps; /* number of formal parameters */
26 int mc_length; /* length of replacement text */
27 int mc_count; /* # of "concurrent" invocations*/
28 char mc_flag; /* marking this macro */
32 /* allocation definitions of struct macro */
33 extern char *st_alloc();
34 extern struct macro *h_macro;
37 extern char *std_alloc();
38 #define new_macro() ((struct macro *) std_alloc((char **)&h_macro, sizeof(struct macro), 20, &cnt_macro))
40 #define new_macro() ((struct macro *) st_alloc((char **)&h_macro, sizeof(struct macro), 20))
42 #define free_macro(p) st_free(p, &h_macro, sizeof(struct macro))
51 /* allocation definitions of struct mlist */
52 extern char *st_alloc();
53 extern struct mlist *h_mlist;
56 extern char *std_alloc();
57 #define new_mlist() ((struct mlist *) std_alloc((char **)&h_mlist, sizeof(struct mlist), 20, &cnt_mlist))
59 #define new_mlist() ((struct mlist *) st_alloc((char **)&h_mlist, sizeof(struct mlist), 20))
61 #define free_mlist(p) st_free(p, &h_mlist, sizeof(struct mlist))
64 /* `token' numbers of keywords of command-line processor
78 #define K_FILE 100 /* for dependency generator */