#include <stdbool.h>
#endif
-struct file {
- struct file *next;
- char name[];
-};
-
typedef enum tristate {
no, mod, yes
} tristate;
struct menu *target;
};
-extern struct file *file_list;
-
extern struct symbol symbol_yes, symbol_no, symbol_mod;
extern struct symbol *modules_sym;
extern int cdebug;
exit(1);
}
- cur_filename = file_lookup(name)->name;
+ cur_filename = file_lookup(name);
yylineno = 1;
}
void zconf_nextfile(const char *name)
{
- struct file *file = file_lookup(name);
struct buffer *buf = xmalloc(sizeof(*buf));
bool recur_include = false;
}
yylineno = 1;
- cur_filename = file->name;
+ cur_filename = file_lookup(name);
}
static void zconf_endfile(void)
}
/* util.c */
-struct file *file_lookup(const char *name);
+const char *file_lookup(const char *name);
void *xmalloc(size_t size);
void *xcalloc(size_t nmemb, size_t size);
void *xrealloc(void *p, size_t size);
struct menu rootmenu;
static struct menu **last_entry_ptr;
-struct file *file_list;
-
void menu_warn(struct menu *menu, const char *fmt, ...)
{
va_list ap;
#include <string.h>
#include "lkc.h"
+struct file {
+ struct file *next;
+ char name[];
+};
+
+static struct file *file_list;
+
/* file already present in list? If not add it */
-struct file *file_lookup(const char *name)
+const char *file_lookup(const char *name)
{
struct file *file;
size_t len;
for (file = file_list; file; file = file->next) {
if (!strcmp(name, file->name)) {
- return file;
+ return file->name;
}
}
str_printf(&autoconf_cmd, "\t%s \\\n", name);
- return file;
+ return file->name;
}
/* Allocate initial growable string */