version 1.30, 2001/09/18 13:52:58 |
version 1.31, 2001/09/18 14:05:14 |
|
|
#include "extern.h" |
#include "extern.h" |
#include "pathnames.h" |
#include "pathnames.h" |
|
|
|
#define BUILTIN_MARKER "__builtin_" |
|
|
static void dodefn __P((const char *)); |
static void dodefn __P((const char *)); |
static void dopushdef __P((const char *, const char *)); |
static void dopushdef __P((const char *, const char *)); |
static void dodump __P((const char *[], int)); |
static void dodump __P((const char *[], int)); |
|
|
const char *defn; |
const char *defn; |
{ |
{ |
ndptr p; |
ndptr p; |
|
int n; |
|
|
if (!*name) |
if (!*name) |
errx(1, "%s at line %lu: null definition.", CURRENT_NAME, |
errx(1, "%s at line %lu: null definition.", CURRENT_NAME, |
|
|
p = addent(name); |
p = addent(name); |
else if (p->defn != null) |
else if (p->defn != null) |
free((char *) p->defn); |
free((char *) p->defn); |
|
if (strncmp(defn, BUILTIN_MARKER, sizeof(BUILTIN_MARKER)-1) == 0) { |
|
n = builtin_type(defn+sizeof(BUILTIN_MARKER)-1); |
|
if (n != -1) { |
|
p->type = n; |
|
p->defn = null; |
|
return; |
|
} |
|
} |
if (!*defn) |
if (!*defn) |
p->defn = null; |
p->defn = null; |
else |
else |
|
|
const char *name; |
const char *name; |
{ |
{ |
ndptr p; |
ndptr p; |
|
char *real; |
|
|
if ((p = lookup(name)) != nil && p->defn != null) { |
if ((p = lookup(name)) != nil) { |
|
if (p->defn != null) { |
pbstr(rquote); |
pbstr(rquote); |
pbstr(p->defn); |
pbstr(p->defn); |
pbstr(lquote); |
pbstr(lquote); |
|
} else if ((real = builtin_realname(p->type)) != NULL) { |
|
pbstr(real); |
|
pbstr(BUILTIN_MARKER); |
|
} |
} |
} |
} |
} |
|
|