diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-07-26 17:16:24 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-07-26 17:16:24 +0000 |
commit | c913794f0cdf4baf33c195eb7700b7d75d24537f (patch) | |
tree | 5821a81f4872e6272db6cf4ac0d872744588fd8e /menu.c | |
parent | fix indent (diff) | |
download | w3m-c913794f0cdf4baf33c195eb7700b7d75d24537f.tar.gz w3m-c913794f0cdf4baf33c195eb7700b7d75d24537f.zip |
[w3m-dev 03945] Re: application/xhtml+xml support
* Makefile.in (ETC_DIR): added
(CONF_DIR): added
(DEFS): add CONF_DIR
(MAKE_ARGS): add CONF_DIR
* config.h.in (SYS_MAILCAP): use CONF_DIR
(SYS_URIMETHODMAP): use CONF_DIR
* func.c (sys_current_keymap_file): added
(interpret_keymap): added
(initKeymap): use interpret_keymap
(interpret_mouse_action): added
(initMouseAction): use interpret_mouse_action
* indep.c (w3m_conf_dir): added
* indep.h (w3m_conf_dir): added
* menu.c (interpret_menu): added
(initMenu): use interpret_menu
* proto.h (confFile): added
* rc.c (init_rc): read config file by interpret_rc
(confFile): added
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | menu.c | 56 |
1 files changed, 32 insertions, 24 deletions
@@ -1,4 +1,4 @@ -/* $Id: menu.c,v 1.31 2003/02/05 16:44:00 ukai Exp $ */ +/* $Id: menu.c,v 1.32 2003/07/26 17:16:24 ukai Exp $ */ /* * w3m menu.c */ @@ -1669,32 +1669,14 @@ optionMenu(int x, int y, char **label, int *variable, int initial, /* --- InitMenu --- */ -void -initMenu(void) +static void +interpret_menu(FILE *mf) { - FILE *mf; Str line; char *p, *s; - int in_menu, nmenu = 0, nitem = 0, type; + int in_menu = 0, nmenu = 0, nitem = 0, type; MenuItem *item = NULL; - MenuList *list; - - w3mMenuList = New_N(MenuList, 3); - w3mMenuList[0].id = "Main"; - w3mMenuList[0].menu = &MainMenu; - w3mMenuList[0].item = MainMenuItem; - w3mMenuList[1].id = "Select"; - w3mMenuList[1].menu = &SelectMenu; - w3mMenuList[1].item = NULL; - w3mMenuList[2].id = "SelectTab"; - w3mMenuList[2].menu = &SelTabMenu; - w3mMenuList[2].item = NULL; - w3mMenuList[3].id = NULL; - - if ((mf = fopen(rcFile(MENU_FILE), "rt")) == NULL) - goto create_menu; - in_menu = 0; while (!feof(mf)) { line = Strfgets(mf); Strchop(line); @@ -1734,9 +1716,35 @@ initMenu(void) item[nitem].type = MENU_END; } } - fclose(mf); +} + +void +initMenu(void) +{ + FILE *mf; + MenuList *list; + + w3mMenuList = New_N(MenuList, 3); + w3mMenuList[0].id = "Main"; + w3mMenuList[0].menu = &MainMenu; + w3mMenuList[0].item = MainMenuItem; + w3mMenuList[1].id = "Select"; + w3mMenuList[1].menu = &SelectMenu; + w3mMenuList[1].item = NULL; + w3mMenuList[2].id = "SelectTab"; + w3mMenuList[2].menu = &SelTabMenu; + w3mMenuList[2].item = NULL; + w3mMenuList[3].id = NULL; + + if ((mf = fopen(confFile(MENU_FILE), "rt")) != NULL) { + interpret_menu(mf); + fclose(mf); + } + if ((mf = fopen(rcFile(MENU_FILE), "rt")) != NULL) { + interpret_menu(mf); + fclose(mf); + } - create_menu: for (list = w3mMenuList; list->id != NULL; list++) { if (list->item == NULL) continue; |