summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/wps_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/wps_debug.c')
-rw-r--r--apps/gui/skin_engine/wps_debug.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/wps_debug.c b/apps/gui/skin_engine/wps_debug.c
index 86f929ad23..7d485f2c50 100644
--- a/apps/gui/skin_engine/wps_debug.c
+++ b/apps/gui/skin_engine/wps_debug.c
@@ -42,6 +42,29 @@ extern bool debug_wps;
42extern int wps_verbose_level; 42extern int wps_verbose_level;
43#endif 43#endif
44 44
45struct debug_token_table
46{
47 enum wps_token_type start_marker;
48 char *desc;
49};
50#define X(name) name, #name
51struct debug_token_table tokens[] = {
52 { X(TOKEN_MARKER_CONTROL_TOKENS) },
53 { X(TOKEN_MARKER_BATTERY) },
54 { X(TOKEN_MARKER_SOUND) },
55 { X(TOKEN_MARKER_RTC) },
56 { X(TOKEN_MARKER_DATABASE) },
57 { X(TOKEN_MARKER_FILE) },
58 { X(TOKEN_MARKER_IMAGES) },
59 { X(TOKEN_MARKER_METADATA) },
60 { X(TOKEN_MARKER_PLAYBACK_INFO) },
61 { X(TOKEN_MARKER_PLAYLIST) },
62 { X(TOKEN_MARKER_MISC) },
63 { X(TOKEN_MARKER_RECORDING) },
64 { X(TOKEN_MARKER_END) },
65};
66#undef X
67
45static char *next_str(bool next) { 68static char *next_str(bool next) {
46 return next ? "next " : ""; 69 return next ? "next " : "";
47} 70}
@@ -49,11 +72,11 @@ static char *next_str(bool next) {
49static char *get_token_desc(struct wps_token *token, char *buf, 72static char *get_token_desc(struct wps_token *token, char *buf,
50 int bufsize, struct wps_data *data) 73 int bufsize, struct wps_data *data)
51{ 74{
75 unsigned i;
52#ifndef HAVE_LCD_BITMAP 76#ifndef HAVE_LCD_BITMAP
53 (void)data; /* kill charcell warning */ 77 (void)data; /* kill charcell warning */
54#endif 78#endif
55 bool next = token->next; 79 bool next = token->next;
56
57 switch(token->type) 80 switch(token->type)
58 { 81 {
59 case WPS_NO_TOKEN: 82 case WPS_NO_TOKEN:
@@ -468,8 +491,15 @@ static char *get_token_desc(struct wps_token *token, char *buf,
468 settings[token->value.i].cfg_name); 491 settings[token->value.i].cfg_name);
469 break; 492 break;
470 default: 493 default:
471 snprintf(buf, bufsize, "FIXME (code: %d)", 494 for(i=1; i<sizeof(tokens)/sizeof(*token); i++)
472 token->type); 495 {
496 if (token->type < tokens[i].start_marker)
497 {
498 snprintf(buf, bufsize, "FIXME: %s + %d\n", tokens[i-1].desc,
499 token->type - tokens[i-1].start_marker);
500 break;
501 }
502 }
473 break; 503 break;
474 } 504 }
475 505