aboutsummaryrefslogtreecommitdiffstats
path: root/com32/menu/readconfig.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-17 14:11:13 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-19 16:51:23 -0800
commit189356d1c472f7f400819947f20b6ce030cba5cc (patch)
treed20f3d500b1febd919975299da5cf305becee536 /com32/menu/readconfig.c
parentc05c5868eef52b27f93f0072aeba9c9878aaba59 (diff)
downloadsyslinux-189356d1c472f7f400819947f20b6ce030cba5cc.tar.gz
syslinux-189356d1c472f7f400819947f20b6ce030cba5cc.tar.xz
syslinux-189356d1c472f7f400819947f20b6ce030cba5cc.zip
Submenu support: development snapshot
Development snapshot before converting to refstrings
Diffstat (limited to 'com32/menu/readconfig.c')
-rw-r--r--com32/menu/readconfig.c50
1 files changed, 39 insertions, 11 deletions
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index ab9994e2..9c602688 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -46,16 +46,11 @@ static int menu_entries_space = 0, hide_entries_space = 0;
struct menu_entry *menu_hotkeys[256];
struct messages messages[MSG_COUNT] = {
- [MSG_TITLE] =
- { "title", "", NULL },
- [MSG_AUTOBOOT] =
- { "autoboot", "Automatic boot in # second{,s}...", NULL },
- [MSG_TAB] =
- { "tabmsg", "Press [Tab] to edit options", NULL },
- [MSG_NOTAB] =
- { "notabmsg", "", NULL },
- [MSG_PASSPROMPT] =
- { "passprompt", "Password required", NULL },
+ [MSG_TITLE] = { "title", "" },
+ [MSG_AUTOBOOT] = { "autoboot", "Automatic boot in # second{,s}..." },
+ [MSG_TAB] = { "tabmsg", "Press [Tab] to edit options", NULL },
+ [MSG_NOTAB] = { "notabmsg", "" },
+ [MSG_PASSPROMPT] = { "passprompt", "Password required", NULL },
};
#define astrdup(x) ({ char *__x = (x); \
@@ -120,7 +115,7 @@ get_config(void)
#endif
}
-#define MAX_LINE 512
+#define MAX_LINE 4096
static char *
skipspace(char *p)
@@ -150,6 +145,39 @@ looking_at(char *line, const char *kwd)
return my_isspace(*p) ? p : NULL; /* Must be EOL or whitespace */
}
+struct menu *start_menu(struct menu *parent)
+{
+ struct menu *m = malloc(sizeof(struct menu));
+ int i;
+
+ if (parent) {
+ /* Submenu */
+ memcpy(m, parent, sizeof *m);
+
+ m->menu_entries = NULL;
+ memset(m->menu_hotkeys, 0, sizeof m->menu_hotkeys);
+
+ m->parent = parent;
+ m->nentries = 0;
+ m->nentries_space = 0;
+ m->defentry = 0;
+ m->color_table = default_color_table(parent->color_table);
+ } else {
+ /* Root menu */
+
+ memset(m, 0, sizeof *m);
+
+ for (i = 0; i < MSG_COUNT; i++)
+ m->messages[i] = messages.defmsg[i];
+ for (i = 0; i < NPARAMS; i++)
+ m->mparm[i] = mparm[i].value;
+
+ m->color_table = default_color_table(NULL);
+ }
+
+ return m;
+}
+
struct labeldata {
char *label;
char *kernel;