static int32_t obj_segment(char *, int, int *);
static void obj_write_file(int debuginfo);
-static int obj_directive(char *, char *, int);
+static int obj_directive(enum directives, char *, int);
static void obj_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
{
if (!strcmp(grp->name, "FLAT"))
break;
if (!grp) {
- obj_directive("group", "FLAT", 1);
+ obj_directive(D_GROUP, "FLAT", 1);
for (grp = grphead; grp; grp = grp->next)
if (!strcmp(grp->name, "FLAT"))
break;
}
}
-static int obj_directive(char *directive, char *value, int pass)
+static int obj_directive(enum directives directive, char *value, int pass)
{
- if (!strcmp(directive, "group")) {
+ switch (directive) {
+ case D_GROUP:
+ {
char *p, *q, *v;
if (pass == 1) {
struct Group *grp;
}
return 1;
}
- if (!strcmp(directive, "uppercase")) {
+ case D_UPPERCASE:
obj_uppercase = true;
return 1;
- }
- if (!strcmp(directive, "import")) {
+
+ case D_IMPORT:
+ {
char *q, *extname, *libname, *impname;
if (pass == 2)
return 1;
}
- if (!strcmp(directive, "export")) {
+ case D_EXPORT:
+ {
char *q, *extname, *intname, *v;
struct ExpDef *export;
int flags = 0;
return 1;
}
- return 0;
+ default:
+ return 0;
+ }
}
static int32_t obj_segbase(int32_t segment)