search for: skip_nonspaces

Displaying 4 results from an estimated 4 matches for "skip_nonspaces".

2010 Apr 09
2
[PATCH] gfxboot: support MENU LABEL statement
...ntinue; } - if(!strcmp(s, "ipappend")) { + if(!strcasecmp(s, "ipappend")) { (menu_ptr ?: menu_default)->ipappend = strdup(t); continue; } + + if(!strcasecmp(s, "menu") && menu_ptr) { + s = skip_spaces(t); + t = skip_nonspaces(s); + if(*t) *t++ = 0; + t = skip_spaces(t); + + if(!strcasecmp(s, "label")) { + menu_ptr->label = strdup(t); + u = strlen(t); + if(u > label_size) label_size = u; + continue; + } + } } fclose(f); @@ -686,21 +700,36 @@ void...
2010 Jul 14
2
[PATCH] gfxboot: add include and menu include support
...32/gfxboot/gfxboot.c +++ b/com32/gfxboot/gfxboot.c @@ -134,6 +134,7 @@ gfx_menu_t gfx_menu; menu_t *menu; menu_t *menu_default; +static menu_t *menu_ptr, **menu_next; struct { uint32_t jmp_table[12]; @@ -161,7 +162,7 @@ char *get_config_file_name(void); char *skip_spaces(char *s); char *skip_nonspaces(char *s); void chop_line(char *s); -int read_config_file(void); +int read_config_file(const char *filename); unsigned magic_ok(unsigned char *buf, unsigned *code_size); unsigned find_file(unsigned char *buf, unsigned len, unsigned *gfx_file_start, unsigned *file_len, unsigned *code_size); int g...
2010 Jul 14
1
[PATCH] gfxboot: allow boot entry to start with label instead of menu_label
...s kernel name - if(strncmp(arg, menu_ptr->menu_label, label_len)) { + if(!strncmp(arg, menu_ptr->label, label_len)) { + arg += label_len; + } + else if(!strncmp(arg, menu_ptr->menu_label, menu_label_len)) { + arg += menu_label_len; + } + else { alt_kernel = arg; arg = skip_nonspaces(arg); if(*arg) *arg++ = 0; if(*alt_kernel) menu_ptr->alt_kernel = alt_kernel; } - else { - arg += label_len; - } arg = skip_spaces(arg); -- 1.7.1
2010 Apr 23
1
Path simple menu integrated progress indicator
...; +} + + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +char *skip_spaces(char *s) +{ + while(*s && (*s == ' ' || *s == '\t')) s++; + + return s; +} + + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +char *skip_nonspaces(char *s) +{ + while(*s && *s != ' ' && *s != '\t') s++; + + return s; +} + +/* Search for a boolean argument; return its position, or 0 if not present */ +static int find_boolean(char **argv, const char *argument) +{ + char **arg; + + for (arg = argv; *arg; a...