From ef0507e1f91ec18dbb5905f77d48a3aba92a88c7 Mon Sep 17 00:00:00 2001 From: kugel Date: Sat, 30 May 2009 16:35:28 +0000 Subject: [PATCH] Rename struct root_menu and the global int root_menu to avoid clashes with #including plugin.h (which #includes root_menu.h), which will be needed for pictureflow in the database (I have some code for that). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21137 a1c6a512-1295-4272-9138-f99709370657 --- apps/tagtree.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/tagtree.c b/apps/tagtree.c index d53b8cf3a..69a462fd0 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -145,7 +145,7 @@ struct menu_entry { int link; }; -struct root_menu { +struct menu_root { char title[64]; char id[MAX_MENU_ID_SIZE]; int itemcount; @@ -155,12 +155,12 @@ struct root_menu { /* Statusbar text of the current view. */ static char current_title[MAX_TAGS][128]; -static struct root_menu *menus[TAGMENU_MAX_MENUS]; -static struct root_menu *menu; +static struct menu_root *menus[TAGMENU_MAX_MENUS]; +static struct menu_root *menu; static struct search_instruction *csi; static const char *strp; static int menu_count; -static int root_menu; +static int rootmenu; static int current_offset; static int current_entry_count; @@ -551,7 +551,7 @@ static bool parse_search(struct menu_entry *entry, const char *str) struct search_instruction *inst = entry->si; char buf[MAX_PATH]; int i; - struct root_menu *new_menu; + struct menu_root *new_menu; strp = str; @@ -588,9 +588,9 @@ static bool parse_search(struct menu_entry *entry, const char *str) } /* Allocate a new menu unless link is found. */ - menus[menu_count] = buffer_alloc(sizeof(struct root_menu)); + menus[menu_count] = buffer_alloc(sizeof(struct menu_root)); new_menu = menus[menu_count]; - memset(new_menu, 0, sizeof(struct root_menu)); + memset(new_menu, 0, sizeof(struct menu_root)); strncpy(new_menu->id, buf, MAX_MENU_ID_SIZE-1); entry->link = menu_count; ++menu_count; @@ -829,10 +829,10 @@ static int parse_line(int n, const char *buf, void *parameters) if (menu == NULL) { - menus[menu_count] = buffer_alloc(sizeof(struct root_menu)); + menus[menu_count] = buffer_alloc(sizeof(struct menu_root)); menu = menus[menu_count]; ++menu_count; - memset(menu, 0, sizeof(struct root_menu)); + memset(menu, 0, sizeof(struct menu_root)); strncpy(menu->id, data, MAX_MENU_ID_SIZE-1); } @@ -847,12 +847,12 @@ static int parse_line(int n, const char *buf, void *parameters) case var_rootmenu: /* Only set root menu once. */ - if (root_menu >= 0) + if (rootmenu >= 0) break; if (get_token_str(data, sizeof(data)) < 0) { - logf("%%root_menu empty"); + logf("%%rootmenu empty"); return 0; } @@ -860,7 +860,7 @@ static int parse_line(int n, const char *buf, void *parameters) { if (!strcasecmp(menus[i]->id, data)) { - root_menu = i; + rootmenu = i; } } break; @@ -922,13 +922,13 @@ void tagtree_init(void) format_count = 0; menu_count = 0; menu = NULL; - root_menu = -1; + rootmenu = -1; parse_menu(FILE_SEARCH_INSTRUCTIONS); /* If no root menu is set, assume it's the first single menu * we have. That shouldn't normally happen. */ - if (root_menu < 0) - root_menu = 0; + if (rootmenu < 0) + rootmenu = 0; uniqbuf = buffer_alloc(UNIQBUF_SIZE); @@ -1306,7 +1306,7 @@ static int load_root(struct tree_context *c) tc = c; c->currtable = ROOT; if (c->dirlevel == 0) - c->currextra = root_menu; + c->currextra = rootmenu; menu = menus[c->currextra]; if (menu == NULL) @@ -1350,7 +1350,7 @@ int tagtree_load(struct tree_context* c) c->dirfull = false; table = ROOT; c->currtable = table; - c->currextra = root_menu; + c->currextra = rootmenu; } switch (table) -- 2.11.4.GIT