static struct SAA *forwrefs; /* keep track of forward references */
static const struct forwrefinfo *forwref;
-static Preproc *preproc;
+static struct preproc_ops *preproc;
+
enum op_type {
op_normal, /* Preprocess and assemble */
op_preprocess, /* Preprocess only */
* not preprocess their source file.
*/
-static void no_pp_reset(char *, int, ListGen *, StrList **);
+static void no_pp_reset(char *file, int pass, ListGen *listgen, StrList **deplist);
static char *no_pp_getline(void);
-static void no_pp_cleanup(int);
-static Preproc no_pp = {
+static void no_pp_cleanup(int pass);
+
+static struct preproc_ops no_pp = {
no_pp_reset,
no_pp_getline,
no_pp_cleanup
/*
* preprocessors ought to look like this:
*/
-typedef struct preproc_ops {
+struct preproc_ops {
/*
* Called at the start of a pass; given a file name, the number
* of the pass, an error reporting function, an evaluator
* function, and a listing generator to talk to.
*/
- void (*reset) (char *, int, ListGen *, StrList **);
+ void (*reset)(char *file, int pass, ListGen *listgen, StrList **deplist);
/*
* Called to fetch a line of preprocessed source. The line
* returned has been malloc'ed, and so should be freed after
* use.
*/
- char *(*getline) (void);
+ char *(*getline)(void);
/*
* Called at the end of a pass.
*/
- void (*cleanup) (int);
-} Preproc;
+ void (*cleanup)(int pass);
+};
-extern Preproc nasmpp;
+extern struct preproc_ops nasmpp;
/*
* ----------------------------------------------------------------