diff --git a/[refs] b/[refs] index e607bad6bc79..069029264ac8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 62dc989921df2a98d1a73aacd085abe941cb9828 +refs/heads/master: 77bdcfe5484fef0da899ec8e74b08dd21b031f66 diff --git a/trunk/Documentation/kbuild/kconfig-language.txt b/trunk/Documentation/kbuild/kconfig-language.txt index c858f8419eba..a686f9cd69c1 100644 --- a/trunk/Documentation/kbuild/kconfig-language.txt +++ b/trunk/Documentation/kbuild/kconfig-language.txt @@ -388,3 +388,26 @@ config FOO depends on BAR && m limits FOO to module (=m) or disabled (=n). + +Kconfig symbol existence +~~~~~~~~~~~~~~~~~~~~~~~~ +The following two methods produce the same kconfig symbol dependencies +but differ greatly in kconfig symbol existence (production) in the +generated config file. + +case 1: + +config FOO + tristate "about foo" + depends on BAR + +vs. case 2: + +if BAR +config FOO + tristate "about foo" +endif + +In case 1, the symbol FOO will always exist in the config file (given +no other dependencies). In case 2, the symbol FOO will only exist in +the config file if BAR is enabled. diff --git a/trunk/Documentation/kbuild/kconfig.txt b/trunk/Documentation/kbuild/kconfig.txt index b8b77bbc784f..a09f1a6a830c 100644 --- a/trunk/Documentation/kbuild/kconfig.txt +++ b/trunk/Documentation/kbuild/kconfig.txt @@ -46,12 +46,6 @@ KCONFIG_OVERWRITECONFIG If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not break symlinks when .config is a symlink to somewhere else. -CONFIG_ --------------------------------------------------- -If you set CONFIG_ in the environment, Kconfig will prefix all symbols -with its value when saving the configuration, instead of using the default, -"CONFIG_". - ______________________________________________________________________ Environment variables for '{allyes/allmod/allno/rand}config' diff --git a/trunk/scripts/kconfig/Makefile b/trunk/scripts/kconfig/Makefile index 231b4759c714..3091794e9354 100644 --- a/trunk/scripts/kconfig/Makefile +++ b/trunk/scripts/kconfig/Makefile @@ -11,9 +11,6 @@ else Kconfig := Kconfig endif -# We need this, in case the user has it in its environment -unexport CONFIG_ - xconfig: $(obj)/qconf $< $(Kconfig) diff --git a/trunk/scripts/kconfig/conf.c b/trunk/scripts/kconfig/conf.c index e39fcd8143ea..4da3b4adfad2 100644 --- a/trunk/scripts/kconfig/conf.c +++ b/trunk/scripts/kconfig/conf.c @@ -36,7 +36,6 @@ enum input_mode { } input_mode = oldaskconfig; static int indent = 1; -static int tty_stdio; static int valid_stdin = 1; static int sync_kconfig; static int conf_cnt; @@ -109,8 +108,6 @@ static int conf_askvalue(struct symbol *sym, const char *def) case oldaskconfig: fflush(stdout); xfgets(line, 128, stdin); - if (!tty_stdio) - printf("\n"); return 1; default: break; @@ -498,8 +495,6 @@ int main(int ac, char **av) bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - tty_stdio = isatty(0) && isatty(1) && isatty(2); - while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { input_mode = (enum input_mode)opt; switch (opt) { @@ -626,7 +621,7 @@ int main(int ac, char **av) return 1; } } - valid_stdin = tty_stdio; + valid_stdin = isatty(0) && isatty(1) && isatty(2); } switch (input_mode) { diff --git a/trunk/scripts/kconfig/expr.c b/trunk/scripts/kconfig/expr.c index d6626521f9b9..290ce41f8ba4 100644 --- a/trunk/scripts/kconfig/expr.c +++ b/trunk/scripts/kconfig/expr.c @@ -13,7 +13,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym) { - struct expr *e = xcalloc(1, sizeof(*e)); + struct expr *e = calloc(1, sizeof(*e)); e->type = E_SYMBOL; e->left.sym = sym; return e; @@ -21,7 +21,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym) struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) { - struct expr *e = xcalloc(1, sizeof(*e)); + struct expr *e = calloc(1, sizeof(*e)); e->type = type; e->left.expr = ce; return e; @@ -29,7 +29,7 @@ struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2) { - struct expr *e = xcalloc(1, sizeof(*e)); + struct expr *e = calloc(1, sizeof(*e)); e->type = type; e->left.expr = e1; e->right.expr = e2; @@ -38,7 +38,7 @@ struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2) { - struct expr *e = xcalloc(1, sizeof(*e)); + struct expr *e = calloc(1, sizeof(*e)); e->type = type; e->left.sym = s1; e->right.sym = s2; @@ -66,7 +66,7 @@ struct expr *expr_copy(const struct expr *org) if (!org) return NULL; - e = xmalloc(sizeof(*org)); + e = malloc(sizeof(*org)); memcpy(e, org, sizeof(*org)); switch (org->type) { case E_SYMBOL: diff --git a/trunk/scripts/kconfig/expr.h b/trunk/scripts/kconfig/expr.h index bd2e09895553..cdd48600e02a 100644 --- a/trunk/scripts/kconfig/expr.h +++ b/trunk/scripts/kconfig/expr.h @@ -12,7 +12,7 @@ extern "C" { #include #include -#include +#include "list.h" #ifndef __cplusplus #include #endif @@ -175,12 +175,11 @@ struct menu { #define MENU_ROOT 0x0002 struct jump_key { - CIRCLEQ_ENTRY(jump_key) entries; + struct list_head entries; size_t offset; struct menu *target; int index; }; -CIRCLEQ_HEAD(jk_head, jump_key); #define JUMP_NB 9 diff --git a/trunk/scripts/kconfig/gconf.c b/trunk/scripts/kconfig/gconf.c index f2bee70e26f4..adc230638c5b 100644 --- a/trunk/scripts/kconfig/gconf.c +++ b/trunk/scripts/kconfig/gconf.c @@ -10,7 +10,6 @@ # include #endif -#include #include "lkc.h" #include "images.c" @@ -23,6 +22,7 @@ #include #include #include +#include //#define DEBUG diff --git a/trunk/scripts/kconfig/list.h b/trunk/scripts/kconfig/list.h new file mode 100644 index 000000000000..0ae730be5f49 --- /dev/null +++ b/trunk/scripts/kconfig/list.h @@ -0,0 +1,91 @@ +#ifndef LIST_H +#define LIST_H + +/* + * Copied from include/linux/... + */ + +#undef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) + +/** + * container_of - cast a member of a structure out to the containing structure + * @ptr: the pointer to the member. + * @type: the type of the container struct this is embedded in. + * @member: the name of the member within the struct. + * + */ +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + + +struct list_head { + struct list_head *next, *prev; +}; + + +#define LIST_HEAD_INIT(name) { &(name), &(name) } + +#define LIST_HEAD(name) \ + struct list_head name = LIST_HEAD_INIT(name) + +/** + * list_entry - get the struct for this entry + * @ptr: the &struct list_head pointer. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + */ +#define list_entry(ptr, type, member) \ + container_of(ptr, type, member) + +/** + * list_for_each_entry - iterate over list of given type + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry(pos, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + +/** + * list_empty - tests whether a list is empty + * @head: the list to test. + */ +static inline int list_empty(const struct list_head *head) +{ + return head->next == head; +} + +/* + * Insert a new entry between two known consecutive entries. + * + * This is only for internal list manipulation where we know + * the prev/next entries already! + */ +static inline void __list_add(struct list_head *_new, + struct list_head *prev, + struct list_head *next) +{ + next->prev = _new; + _new->next = next; + _new->prev = prev; + prev->next = _new; +} + +/** + * list_add_tail - add a new entry + * @new: new entry to be added + * @head: list head to add it before + * + * Insert a new entry before the specified head. + * This is useful for implementing queues. + */ +static inline void list_add_tail(struct list_head *_new, struct list_head *head) +{ + __list_add(_new, head->prev, head); +} + +#endif diff --git a/trunk/scripts/kconfig/lkc.h b/trunk/scripts/kconfig/lkc.h index f8aee5fc6d5e..c18f2bd9c095 100644 --- a/trunk/scripts/kconfig/lkc.h +++ b/trunk/scripts/kconfig/lkc.h @@ -39,12 +39,6 @@ extern "C" { #ifndef CONFIG_ #define CONFIG_ "CONFIG_" #endif -static inline const char *CONFIG_prefix(void) -{ - return getenv( "CONFIG_" ) ?: CONFIG_; -} -#undef CONFIG_ -#define CONFIG_ CONFIG_prefix() #define TF_COMMAND 0x0001 #define TF_PARAM 0x0002 @@ -122,8 +116,6 @@ void menu_set_type(int type); /* util.c */ struct file *file_lookup(const char *name); int file_write_dep(const char *name); -void *xmalloc(size_t size); -void *xcalloc(size_t nmemb, size_t size); struct gstr { size_t len; diff --git a/trunk/scripts/kconfig/lkc_proto.h b/trunk/scripts/kconfig/lkc_proto.h index 1d1c08537f1e..ef1a7381f956 100644 --- a/trunk/scripts/kconfig/lkc_proto.h +++ b/trunk/scripts/kconfig/lkc_proto.h @@ -21,9 +21,9 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu)); P(menu_get_parent_menu,struct menu *,(struct menu *menu)); P(menu_has_help,bool,(struct menu *menu)); P(menu_get_help,const char *,(struct menu *menu)); -P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct jk_head +P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head *head)); -P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct jk_head +P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head *head)); P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); diff --git a/trunk/scripts/kconfig/lxdialog/check-lxdialog.sh b/trunk/scripts/kconfig/lxdialog/check-lxdialog.sh index 80788137c670..c8e8a7154753 100644 --- a/trunk/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/trunk/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -21,7 +21,6 @@ ccflags() { if [ -f /usr/include/ncursesw/curses.h ]; then echo '-I/usr/include/ncursesw -DCURSES_LOC=""' - echo ' -DNCURSES_WIDECHAR=1' elif [ -f /usr/include/ncurses/ncurses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses/curses.h ]; then diff --git a/trunk/scripts/kconfig/lxdialog/dialog.h b/trunk/scripts/kconfig/lxdialog/dialog.h index ee17a5264d5b..307022a8beef 100644 --- a/trunk/scripts/kconfig/lxdialog/dialog.h +++ b/trunk/scripts/kconfig/lxdialog/dialog.h @@ -221,7 +221,6 @@ int dialog_menu(const char *title, const char *prompt, const void *selected, int *s_scroll); int dialog_checklist(const char *title, const char *prompt, int height, int width, int list_height); -extern char dialog_input_result[]; int dialog_inputbox(const char *title, const char *prompt, int height, int width, const char *init); diff --git a/trunk/scripts/kconfig/lxdialog/inputbox.c b/trunk/scripts/kconfig/lxdialog/inputbox.c index 21404a04d7c3..dd8e587c50e2 100644 --- a/trunk/scripts/kconfig/lxdialog/inputbox.c +++ b/trunk/scripts/kconfig/lxdialog/inputbox.c @@ -45,8 +45,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width const char *init) { int i, x, y, box_y, box_x, box_width; - int input_x = 0, key = 0, button = -1; - int show_x, len, pos; + int input_x = 0, scroll = 0, key = 0, button = -1; char *instr = dialog_input_result; WINDOW *dialog; @@ -98,17 +97,14 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width wmove(dialog, box_y, box_x); wattrset(dialog, dlg.inputbox.atr); - len = strlen(instr); - pos = len; + input_x = strlen(instr); - if (len >= box_width) { - show_x = len - box_width + 1; + if (input_x >= box_width) { + scroll = input_x - box_width + 1; input_x = box_width - 1; for (i = 0; i < box_width - 1; i++) - waddch(dialog, instr[show_x + i]); + waddch(dialog, instr[scroll + i]); } else { - show_x = 0; - input_x = len; waddstr(dialog, instr); } @@ -125,104 +121,45 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width case KEY_UP: case KEY_DOWN: break; + case KEY_LEFT: + continue; + case KEY_RIGHT: + continue; case KEY_BACKSPACE: case 127: - if (pos) { + if (input_x || scroll) { wattrset(dialog, dlg.inputbox.atr); - if (input_x == 0) { - show_x--; + if (!input_x) { + scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width; i++) + waddch(dialog, + instr[scroll + input_x + i] ? + instr[scroll + input_x + i] : ' '); + input_x = strlen(instr) - scroll; } else input_x--; - - if (pos < len) { - for (i = pos - 1; i < len; i++) { - instr[i] = instr[i+1]; - } - } - - pos--; - len--; - instr[len] = '\0'; - wmove(dialog, box_y, box_x); - for (i = 0; i < box_width; i++) { - if (!instr[show_x + i]) { - waddch(dialog, ' '); - break; - } - waddch(dialog, instr[show_x + i]); - } + instr[scroll + input_x] = '\0'; + mvwaddch(dialog, box_y, input_x + box_x, ' '); wmove(dialog, box_y, input_x + box_x); wrefresh(dialog); } continue; - case KEY_LEFT: - if (pos > 0) { - if (input_x > 0) { - wmove(dialog, box_y, --input_x + box_x); - } else if (input_x == 0) { - show_x--; - wmove(dialog, box_y, box_x); - for (i = 0; i < box_width; i++) { - if (!instr[show_x + i]) { - waddch(dialog, ' '); - break; - } - waddch(dialog, instr[show_x + i]); - } - wmove(dialog, box_y, box_x); - } - pos--; - } - continue; - case KEY_RIGHT: - if (pos < len) { - if (input_x < box_width - 1) { - wmove(dialog, box_y, ++input_x + box_x); - } else if (input_x == box_width - 1) { - show_x++; - wmove(dialog, box_y, box_x); - for (i = 0; i < box_width; i++) { - if (!instr[show_x + i]) { - waddch(dialog, ' '); - break; - } - waddch(dialog, instr[show_x + i]); - } - wmove(dialog, box_y, input_x + box_x); - } - pos++; - } - continue; default: if (key < 0x100 && isprint(key)) { - if (len < MAX_LEN) { + if (scroll + input_x < MAX_LEN) { wattrset(dialog, dlg.inputbox.atr); - if (pos < len) { - for (i = len; i > pos; i--) - instr[i] = instr[i-1]; - instr[pos] = key; - } else { - instr[len] = key; - } - pos++; - len++; - instr[len] = '\0'; - + instr[scroll + input_x] = key; + instr[scroll + input_x + 1] = '\0'; if (input_x == box_width - 1) { - show_x++; + scroll++; + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr [scroll + i]); } else { - input_x++; - } - - wmove(dialog, box_y, box_x); - for (i = 0; i < box_width; i++) { - if (!instr[show_x + i]) { - waddch(dialog, ' '); - break; - } - waddch(dialog, instr[show_x + i]); + wmove(dialog, box_y, input_x++ + box_x); + waddch(dialog, key); } - wmove(dialog, box_y, input_x + box_x); wrefresh(dialog); } else flash(); /* Alarm user about overflow */ diff --git a/trunk/scripts/kconfig/lxdialog/menubox.c b/trunk/scripts/kconfig/lxdialog/menubox.c index 48d382e7e374..1d604738fa13 100644 --- a/trunk/scripts/kconfig/lxdialog/menubox.c +++ b/trunk/scripts/kconfig/lxdialog/menubox.c @@ -26,7 +26,7 @@ * * *) A bugfix for the Page-Down problem * - * *) Formerly when I used Page Down and Page Up, the cursor would be set + * *) Formerly when I used Page Down and Page Up, the cursor would be set * to the first position in the menu box. Now lxdialog is a bit * smarter and works more like other menu systems (just have a look at * it). @@ -154,14 +154,12 @@ static void print_arrows(WINDOW * win, int item_no, int scroll, int y, int x, */ static void print_buttons(WINDOW * win, int height, int width, int selected) { - int x = width / 2 - 28; + int x = width / 2 - 16; int y = height - 2; print_button(win, gettext("Select"), y, x, selected == 0); print_button(win, gettext(" Exit "), y, x + 12, selected == 1); print_button(win, gettext(" Help "), y, x + 24, selected == 2); - print_button(win, gettext(" Save "), y, x + 36, selected == 3); - print_button(win, gettext(" Load "), y, x + 48, selected == 4); wmove(win, y, x + 1 + 12 * selected); wrefresh(win); @@ -374,7 +372,7 @@ int dialog_menu(const char *title, const char *prompt, case TAB: case KEY_RIGHT: button = ((key == KEY_LEFT ? --button : ++button) < 0) - ? 4 : (button > 4 ? 0 : button); + ? 2 : (button > 2 ? 0 : button); print_buttons(dialog, height, width, button); wrefresh(menu); @@ -401,17 +399,17 @@ int dialog_menu(const char *title, const char *prompt, return 2; case 's': case 'y': - return 5; + return 3; case 'n': - return 6; + return 4; case 'm': - return 7; + return 5; case ' ': - return 8; + return 6; case '/': - return 9; + return 7; case 'z': - return 10; + return 8; case '\n': return button; } diff --git a/trunk/scripts/kconfig/mconf.c b/trunk/scripts/kconfig/mconf.c index 680135effd9b..53975cf87608 100644 --- a/trunk/scripts/kconfig/mconf.c +++ b/trunk/scripts/kconfig/mconf.c @@ -280,7 +280,6 @@ static struct menu *current_menu; static int child_count; static int single_menu_mode; static int show_all_options; -static int save_and_exit; static void conf(struct menu *menu, struct menu *active_menu); static void conf_choice(struct menu *menu); @@ -313,7 +312,7 @@ static void set_config_filename(const char *config_filename) struct search_data { - struct jk_head *head; + struct list_head *head; struct menu **targets; int *keys; }; @@ -324,7 +323,7 @@ static void update_text(char *buf, size_t start, size_t end, void *_data) struct jump_key *pos; int k = 0; - CIRCLEQ_FOREACH(pos, data->head, entries) { + list_for_each_entry(pos, data->head, entries) { if (pos->offset >= start && pos->offset < end) { char header[4]; @@ -349,19 +348,15 @@ static void search_conf(void) { struct symbol **sym_arr; struct gstr res; - struct gstr title; char *dialog_input; int dres, vscroll = 0, hscroll = 0; bool again; - title = str_new(); - str_printf( &title, _("Enter %s (sub)string to search for " - "(with or without \"%s\")"), CONFIG_, CONFIG_); - again: dialog_clear(); dres = dialog_inputbox(_("Search Configuration Parameter"), - str_get(&title), + _("Enter " CONFIG_ " (sub)string to search for " + "(with or without \"" CONFIG_ "\")"), 10, 75, ""); switch (dres) { case 0: @@ -370,7 +365,6 @@ static void search_conf(void) show_helptext(_("Search Configuration"), search_help); goto again; default: - str_free(&title); return; } @@ -381,7 +375,7 @@ static void search_conf(void) sym_arr = sym_re_search(dialog_input); do { - struct jk_head head = CIRCLEQ_HEAD_INITIALIZER(head); + LIST_HEAD(head); struct menu *targets[JUMP_NB]; int keys[JUMP_NB + 1], i; struct search_data data = { @@ -404,7 +398,6 @@ static void search_conf(void) str_free(&res); } while (again); free(sym_arr); - str_free(&title); } static void build_conf(struct menu *menu) @@ -599,6 +592,14 @@ static void conf(struct menu *menu, struct menu *active_menu) build_conf(menu); if (!child_count) break; + if (menu == &rootmenu) { + item_make("--- "); + item_set_tag(':'); + item_make(_(" Load an Alternate Configuration File")); + item_set_tag('L'); + item_make(_(" Save an Alternate Configuration File")); + item_set_tag('S'); + } dialog_clear(); res = dialog_menu(prompt ? _(prompt) : _("Main Menu"), _(menu_instructions), @@ -635,6 +636,12 @@ static void conf(struct menu *menu, struct menu *active_menu) case 's': conf_string(submenu); break; + case 'L': + conf_load(); + break; + case 'S': + conf_save(); + break; } break; case 2: @@ -644,12 +651,6 @@ static void conf(struct menu *menu, struct menu *active_menu) show_helptext(_("README"), _(mconf_readme)); break; case 3: - conf_save(); - break; - case 4: - conf_load(); - break; - case 5: if (item_is_tag('t')) { if (sym_set_tristate_value(sym, yes)) break; @@ -657,24 +658,24 @@ static void conf(struct menu *menu, struct menu *active_menu) show_textbox(NULL, setmod_text, 6, 74); } break; - case 6: + case 4: if (item_is_tag('t')) sym_set_tristate_value(sym, no); break; - case 7: + case 5: if (item_is_tag('t')) sym_set_tristate_value(sym, mod); break; - case 8: + case 6: if (item_is_tag('t')) sym_toggle_tristate_value(sym); else if (item_is_tag('m')) conf(submenu, NULL); break; - case 9: + case 7: search_conf(); break; - case 10: + case 8: show_all_options = !show_all_options; break; } @@ -701,17 +702,6 @@ static void show_helptext(const char *title, const char *text) show_textbox(title, text, 0, 0); } -static void conf_message_callback(const char *fmt, va_list ap) -{ - char buf[PATH_MAX+1]; - - vsnprintf(buf, sizeof(buf), fmt, ap); - if (save_and_exit) - printf("%s", buf); - else - show_textbox(NULL, buf, 6, 60); -} - static void show_help(struct menu *menu) { struct gstr help = str_new(); @@ -880,7 +870,6 @@ static int handle_exit(void) { int res; - save_and_exit = 1; dialog_clear(); if (conf_get_changed()) res = dialog_yesno(NULL, @@ -952,7 +941,6 @@ int main(int ac, char **av) } set_config_filename(conf_get_configname()); - conf_set_message_callback(conf_message_callback); do { conf(&rootmenu, NULL); res = handle_exit(); diff --git a/trunk/scripts/kconfig/menu.c b/trunk/scripts/kconfig/menu.c index 84a2ba2077aa..e98a05c8e508 100644 --- a/trunk/scripts/kconfig/menu.c +++ b/trunk/scripts/kconfig/menu.c @@ -48,7 +48,7 @@ void menu_add_entry(struct symbol *sym) { struct menu *menu; - menu = xmalloc(sizeof(*menu)); + menu = malloc(sizeof(*menu)); memset(menu, 0, sizeof(*menu)); menu->sym = sym; menu->parent = current_menu; @@ -508,7 +508,7 @@ const char *menu_get_help(struct menu *menu) } static void get_prompt_str(struct gstr *r, struct property *prop, - struct jk_head *head) + struct list_head *head) { int i, j; struct menu *submenu[8], *menu, *location = NULL; @@ -531,7 +531,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop, location = menu; } if (head && location) { - jump = xmalloc(sizeof(struct jump_key)); + jump = malloc(sizeof(struct jump_key)); if (menu_is_visible(prop->menu)) { /* @@ -544,12 +544,13 @@ static void get_prompt_str(struct gstr *r, struct property *prop, } else jump->target = location; - if (CIRCLEQ_EMPTY(head)) + if (list_empty(head)) jump->index = 0; else - jump->index = CIRCLEQ_LAST(head)->index + 1; + jump->index = list_entry(head->prev, struct jump_key, + entries)->index + 1; - CIRCLEQ_INSERT_TAIL(head, jump, entries); + list_add_tail(&jump->entries, head); } if (i > 0) { @@ -573,7 +574,8 @@ static void get_prompt_str(struct gstr *r, struct property *prop, /* * head is optional and may be NULL */ -void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head) +void get_symbol_str(struct gstr *r, struct symbol *sym, + struct list_head *head) { bool hit; struct property *prop; @@ -612,7 +614,7 @@ void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head) str_append(r, "\n\n"); } -struct gstr get_relations_str(struct symbol **sym_arr, struct jk_head *head) +struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head) { struct symbol *sym; struct gstr res = str_new(); diff --git a/trunk/scripts/kconfig/merge_config.sh b/trunk/scripts/kconfig/merge_config.sh index 05274fccb88e..974d5cb7e30a 100755 --- a/trunk/scripts/kconfig/merge_config.sh +++ b/trunk/scripts/kconfig/merge_config.sh @@ -32,13 +32,11 @@ usage() { echo " -m only merge the fragments, do not execute the make command" echo " -n use allnoconfig instead of alldefconfig" echo " -r list redundant entries when merging fragments" - echo " -O dir to put generated output files" } MAKE=true ALLTARGET=alldefconfig WARNREDUN=false -OUTPUT=. while true; do case $1 in @@ -61,16 +59,6 @@ while true; do shift continue ;; - "-O") - if [ -d $2 ];then - OUTPUT=$(echo $2 | sed 's/\/*$//') - else - echo "output directory $2 does not exist" 1>&2 - exit 1 - fi - shift 2 - continue - ;; *) break ;; @@ -112,9 +100,9 @@ for MERGE_FILE in $MERGE_LIST ; do done if [ "$MAKE" = "false" ]; then - cp $TMP_FILE $OUTPUT/.config + cp $TMP_FILE .config echo "#" - echo "# merged configuration written to $OUTPUT/.config (needs make)" + echo "# merged configuration written to .config (needs make)" echo "#" clean_up exit @@ -123,14 +111,14 @@ fi # Use the merged file as the starting point for: # alldefconfig: Fills in any missing symbols with Kconfig default # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set -make KCONFIG_ALLCONFIG=$TMP_FILE O=$OUTPUT $ALLTARGET +make KCONFIG_ALLCONFIG=$TMP_FILE $ALLTARGET # Check all specified config values took (might have missed-dependency issues) for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) - ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config) + ACTUAL_VAL=$(grep -w -e "$CFG" .config) if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then echo "Value requested for $CFG not in final .config" echo "Requested value: $REQUESTED_VAL" diff --git a/trunk/scripts/kconfig/nconf.c b/trunk/scripts/kconfig/nconf.c index dbf31edd22b2..87d4b15da951 100644 --- a/trunk/scripts/kconfig/nconf.c +++ b/trunk/scripts/kconfig/nconf.c @@ -7,208 +7,215 @@ */ #define _GNU_SOURCE #include -#include #include "lkc.h" #include "nconf.h" #include -static const char nconf_global_help[] = N_( -"Help windows\n" -"------------\n" -"o Global help: Unless in a data entry window, pressing will give \n" -" you the global help window, which you are just reading.\n" +static const char nconf_readme[] = N_( +"Overview\n" +"--------\n" +"This interface let you select features and parameters for the build.\n" +"Features can either be built-in, modularized, or ignored. Parameters\n" +"must be entered in as decimal or hexadecimal numbers or text.\n" "\n" -"o A short version of the global help is available by pressing .\n" +"Menu items beginning with following braces represent features that\n" +" [ ] can be built in or removed\n" +" < > can be built in, modularized or removed\n" +" { } can be built in or modularized (selected by other feature)\n" +" - - are selected by other feature,\n" +" XXX cannot be selected. Use Symbol Info to find out why,\n" +"while *, M or whitespace inside braces means to build in, build as\n" +"a module or to exclude the feature respectively.\n" "\n" -"o Local help: To get help related to the current menu entry, use any\n" -" of , or if in a data entry window then press .\n" +"To change any of these features, highlight it with the cursor\n" +"keys and press to build it in, to make it a module or\n" +" to removed it. You may also press the to cycle\n" +"through the available options (ie. Y->N->M->Y).\n" "\n" +"Some additional keyboard hints:\n" "\n" -"Menu entries\n" -"------------\n" -"This interface lets you select features and parameters for the kernel\n" -"build. Kernel features can either be built-in, modularized, or removed.\n" -"Parameters must be entered as text or decimal or hexadecimal numbers.\n" +"Menus\n" +"----------\n" +"o Use the Up/Down arrow keys (cursor keys) to highlight the item\n" +" you wish to change use or . Goto submenu by \n" +" pressing of . Use or to go back.\n" +" Submenus are designated by \"--->\".\n" "\n" -"Menu entries beginning with following braces represent features that\n" -" [ ] can be built in or removed\n" -" < > can be built in, modularized or removed\n" -" { } can be built in or modularized, are selected by another feature\n" -" - - are selected by another feature\n" -" XXX cannot be selected. Symbol Info tells you why.\n" -"*, M or whitespace inside braces means to build in, build as a module\n" -"or to exclude the feature respectively.\n" +" Searching: pressing '/' triggers interactive search mode.\n" +" nconfig performs a case insensitive search for the string\n" +" in the menu prompts (no regex support).\n" +" Pressing the up/down keys highlights the previous/next\n" +" matching item. Backspace removes one character from the\n" +" match string. Pressing either '/' again or ESC exits\n" +" search mode. All other keys behave normally.\n" "\n" -"To change any of these features, highlight it with the movement keys\n" -"listed below and press to build it in, to make it a module or\n" -" to remove it. You may press the key to cycle through the\n" -"available options.\n" +" You may also use the and keys to scroll\n" +" unseen options into view.\n" "\n" -"A trailing \"--->\" designates a submenu.\n" +"o To exit a menu use the just press or .\n" "\n" +"o To get help with an item, press \n" +" Shortcut: Press or .\n" "\n" -"Menu navigation keys\n" -"----------------------------------------------------------------------\n" -"Linewise up \n" -"Linewise down \n" -"Pagewise up \n" -"Pagewise down \n" -"First entry \n" -"Last entry \n" -"Enter a submenu \n" -"Go back to parent menu \n" -"Close a help window \n" -"Close entry window, apply \n" -"Close entry window, forget \n" -"Start incremental, case-insensitive search for STRING in menu entries,\n" -" no regex support, STRING is displayed in upper left corner\n" -" STRING\n" -" Remove last character \n" -" Jump to next hit \n" -" Jump to previous hit \n" -"Exit menu search mode \n" -"Search for configuration variables with or without leading CONFIG_\n" -" RegExpr\n" -"Verbose search help \n" -"----------------------------------------------------------------------\n" "\n" -"Unless in a data entry window, key <1> may be used instead of ,\n" -"<2> instead of , etc.\n" +"Radiolists (Choice lists)\n" +"-----------\n" +"o Use the cursor keys to select the option you wish to set and press\n" +" or the .\n" "\n" +" Shortcut: Press the first letter of the option you wish to set then\n" +" press or .\n" "\n" -"Radiolist (Choice list)\n" -"-----------------------\n" -"Use the movement keys listed above to select the option you wish to set\n" -"and press .\n" +"o To see available help for the item, press \n" +" Shortcut: Press or .\n" "\n" "\n" -"Data entry\n" -"----------\n" -"Enter the requested information and press . Hexadecimal values\n" -"may be entered without the \"0x\" prefix.\n" +"Data Entry\n" +"-----------\n" +"o Enter the requested information and press \n" +" If you are entering hexadecimal values, it is not necessary to\n" +" add the '0x' prefix to the entry.\n" "\n" +"o For help, press .\n" "\n" -"Text Box (Help Window)\n" -"----------------------\n" -"Use movement keys as listed in table above.\n" "\n" -"Press any of to exit.\n" +"Text Box (Help Window)\n" +"--------\n" +"o Use the cursor keys to scroll up/down/left/right. The VI editor\n" +" keys h,j,k,l function here as do , and for\n" +" those who are familiar with less and lynx.\n" "\n" +"o Press , , , , or to exit.\n" "\n" -"Alternate configuration files\n" +"\n" +"Alternate Configuration Files\n" "-----------------------------\n" -"nconfig supports switching between different configurations.\n" -"Press to save your current configuration. Press and enter\n" -"a file name to load a previously saved configuration.\n" +"nconfig supports the use of alternate configuration files for\n" +"those who, for various reasons, find it necessary to switch\n" +"between different configurations.\n" "\n" +"At the end of the main menu you will find two options. One is\n" +"for saving the current configuration to a file of your choosing.\n" +"The other option is for loading a previously saved alternate\n" +"configuration.\n" "\n" -"Terminal configuration\n" -"----------------------\n" -"If you use nconfig in a xterm window, make sure your TERM environment\n" -"variable specifies a terminal configuration which supports at least\n" -"16 colors. Otherwise nconfig will look rather bad.\n" +"Even if you don't use alternate configuration files, but you\n" +"find during a nconfig session that you have completely messed\n" +"up your settings, you may use the \"Load Alternate...\" option to\n" +"restore your previously saved settings from \".config\" without\n" +"restarting nconfig.\n" "\n" -"If the \"stty size\" command reports the current terminalsize correctly,\n" -"nconfig will adapt to sizes larger than the traditional 80x25 \"standard\"\n" -"and display longer menus properly.\n" +"Other information\n" +"-----------------\n" +"If you use nconfig in an XTERM window make sure you have your\n" +"$TERM variable set to point to a xterm definition which supports color.\n" +"Otherwise, nconfig will look rather bad. nconfig will not\n" +"display correctly in a RXVT window because rxvt displays only one\n" +"intensity of color, bright.\n" "\n" +"nconfig will display larger menus on screens or xterms which are\n" +"set to display more than the standard 25 row by 80 column geometry.\n" +"In order for this to work, the \"stty size\" command must be able to\n" +"display the screen's current row and column geometry. I STRONGLY\n" +"RECOMMEND that you make sure you do NOT have the shell variables\n" +"LINES and COLUMNS exported into your environment. Some distributions\n" +"export those variables via /etc/profile. Some ncurses programs can\n" +"become confused when those variables (LINES & COLUMNS) don't reflect\n" +"the true screen size.\n" "\n" -"Single menu mode\n" -"----------------\n" -"If you prefer to have all of the menu entries listed in a single menu,\n" -"rather than the default multimenu hierarchy, run nconfig with\n" -"NCONFIG_MODE environment variable set to single_menu. Example:\n" +"Optional personality available\n" +"------------------------------\n" +"If you prefer to have all of the options listed in a single menu, rather\n" +"than the default multimenu hierarchy, run the nconfig with NCONFIG_MODE\n" +"environment variable set to single_menu. Example:\n" "\n" "make NCONFIG_MODE=single_menu nconfig\n" "\n" -" will then unfold the appropriate category, or fold it if it\n" -"is already unfolded. Folded menu entries will be designated by a\n" -"leading \"++>\" and unfolded entries by a leading \"-->\".\n" +" will then unroll the appropriate category, or enfold it if it\n" +"is already unrolled.\n" "\n" -"Note that this mode can eventually be a little more CPU expensive than\n" -"the default mode, especially with a larger number of unfolded submenus.\n" +"Note that this mode can eventually be a little more CPU expensive\n" +"(especially with a larger number of unrolled categories) than the\n" +"default mode.\n" "\n"), menu_no_f_instructions[] = N_( -"Legend: [*] built-in [ ] excluded module < > module capable.\n" -"Submenus are designated by a trailing \"--->\".\n" -"\n" -"Use the following keys to navigate the menus:\n" -"Move up or down with and .\n" -"Enter a submenu with or .\n" -"Exit a submenu to its parent menu with or .\n" -"Pressing includes, excludes, modularizes features.\n" -"Pressing cycles through the available options.\n" -"To search for menu entries press .\n" -" always leaves the current window.\n" -"\n" -"You do not have function keys support.\n" -"Press <1> instead of , <2> instead of , etc.\n" -"For verbose global help use key <1>.\n" -"For help related to the current menu entry press or .\n"), +" You do not have function keys support. Please follow the\n" +" following instructions:\n" +" Arrow keys navigate the menu.\n" +" or selects submenus --->.\n" +" Capital Letters are hotkeys.\n" +" Pressing includes, excludes, modularizes features.\n" +" Pressing SpaceBar toggles between the above options.\n" +" Press or to go back one menu,\n" +" or for Help, for Search.\n" +" <1> is interchangeable with , <2> with , etc.\n" +" Legend: [*] built-in [ ] excluded module < > module capable.\n" +" always leaves the current window.\n"), menu_instructions[] = N_( -"Legend: [*] built-in [ ] excluded module < > module capable.\n" -"Submenus are designated by a trailing \"--->\".\n" -"\n" -"Use the following keys to navigate the menus:\n" -"Move up or down with or .\n" -"Enter a submenu with or .\n" -"Exit a submenu to its parent menu with or .\n" -"Pressing includes, excludes, modularizes features.\n" -"Pressing cycles through the available options.\n" -"To search for menu entries press .\n" -" always leaves the current window.\n" -"\n" -"Pressing <1> may be used instead of , <2> instead of , etc.\n" -"For verbose global help press .\n" -"For help related to the current menu entry press or .\n"), +" Arrow keys navigate the menu.\n" +" or selects submenus --->.\n" +" Capital Letters are hotkeys.\n" +" Pressing includes, excludes, modularizes features.\n" +" Pressing SpaceBar toggles between the above options\n" +" Press , or to go back one menu,\n" +" , or for Help, for Search.\n" +" <1> is interchangeable with , <2> with , etc.\n" +" Legend: [*] built-in [ ] excluded module < > module capable.\n" +" always leaves the current window\n"), radiolist_instructions[] = N_( -"Press , , or to navigate a radiolist, select\n" -"with .\n" -"For help related to the current entry press or .\n" -"For global help press .\n"), +" Use the arrow keys to navigate this window or\n" +" press the hotkey of the item you wish to select\n" +" followed by the .\n" +" Press , or for additional information about this option.\n"), inputbox_instructions_int[] = N_( "Please enter a decimal value.\n" "Fractions will not be accepted.\n" -"Press to apply, to cancel."), +"Press to accept, to cancel."), inputbox_instructions_hex[] = N_( "Please enter a hexadecimal value.\n" -"Press to apply, to cancel."), +"Press to accept, to cancel."), inputbox_instructions_string[] = N_( "Please enter a string value.\n" -"Press to apply, to cancel."), +"Press to accept, to cancel."), setmod_text[] = N_( -"This feature depends on another feature which has been configured as a\n" -"module. As a result, the current feature will be built as a module too."), +"This feature depends on another which\n" +"has been configured as a module.\n" +"As a result, this feature will be built as a module."), load_config_text[] = N_( "Enter the name of the configuration file you wish to load.\n" -"Accept the name shown to restore the configuration you last\n" -"retrieved. Leave empty to abort."), +"Accept the name shown to restore the configuration you\n" +"last retrieved. Leave blank to abort."), load_config_help[] = N_( +"\n" "For various reasons, one may wish to keep several different\n" "configurations available on a single machine.\n" "\n" "If you have saved a previous configuration in a file other than the\n" -"default one, entering its name here will allow you to load and modify\n" -"that configuration.\n" +"default one, entering its name here will allow you to modify that\n" +"configuration.\n" "\n" -"Leave empty to abort.\n"), +"If you are uncertain, then you have probably never used alternate\n" +"configuration files. You should therefor leave this blank to abort.\n"), save_config_text[] = N_( "Enter a filename to which this configuration should be saved\n" -"as an alternate. Leave empty to abort."), +"as an alternate. Leave blank to abort."), save_config_help[] = N_( -"For various reasons, one may wish to keep several different\n" -"configurations available on a single machine.\n" +"\n" +"For various reasons, one may wish to keep different configurations\n" +"available on a single machine.\n" "\n" "Entering a file name here will allow you to later retrieve, modify\n" "and use the current configuration as an alternate to whatever\n" "configuration options you have selected at that time.\n" "\n" -"Leave empty to abort.\n"), +"If you are uncertain what all this means then you should probably\n" +"leave this blank.\n"), search_help[] = N_( -"Search for symbols (configuration variable names CONFIG_*) and display\n" -"their relations. Regular expressions are supported.\n" -"Example: Search for \"^FOO\".\n" +"\n" +"Search for symbols and display their relations. Regular expressions\n" +"are allowed.\n" +"Example: search for \"^FOO\"\n" "Result:\n" "-----------------------------------------------------------------\n" "Symbol: FOO [ = m]\n" @@ -222,26 +229,26 @@ search_help[] = N_( "Selects: LIBCRC32\n" "Selected by: BAR\n" "-----------------------------------------------------------------\n" -"o The line 'Prompt:' shows the text displayed for this symbol in\n" -" the menu hierarchy.\n" -"o The 'Defined at' line tells at what file / line number the symbol is\n" -" defined.\n" -"o The 'Depends on:' line lists symbols that need to be defined for\n" -" this symbol to be visible and selectable in the menu.\n" -"o The 'Location:' lines tell, where in the menu structure this symbol\n" -" is located. A location followed by a [ = y] indicates that this is\n" -" a selectable menu item, and the current value is displayed inside\n" -" brackets.\n" -"o The 'Selects:' line tells, what symbol will be automatically selected\n" -" if this symbol is selected (y or m).\n" -"o The 'Selected by' line tells what symbol has selected this symbol.\n" +"o The line 'Prompt:' shows the text used in the menu structure for\n" +" this symbol\n" +"o The 'Defined at' line tell at what file / line number the symbol\n" +" is defined\n" +"o The 'Depends on:' line tell what symbols needs to be defined for\n" +" this symbol to be visible in the menu (selectable)\n" +"o The 'Location:' lines tell where in the menu structure this symbol\n" +" is located\n" +" A location followed by a [ = y] indicate that this is a selectable\n" +" menu item - and current value is displayed inside brackets.\n" +"o The 'Selects:' line tell what symbol will be automatically\n" +" selected if this symbol is selected (y or m)\n" +"o The 'Selected by' line tell what symbol has selected this symbol\n" "\n" "Only relevant lines are shown.\n" "\n\n" "Search examples:\n" -"USB => find all symbols containing USB\n" -"^USB => find all symbols starting with USB\n" -"USB$ => find all symbols ending with USB\n" +"Examples: USB => find all symbols containing USB\n" +" ^USB => find all symbols starting with USB\n" +" USB$ => find all symbols ending with USB\n" "\n"); struct mitem { @@ -312,19 +319,19 @@ struct function_keys function_keys[] = { }, { .key_str = "F2", - .func = "SymInfo", + .func = "Sym Info", .key = F_SYMBOL, .handler = handle_f2, }, { .key_str = "F3", - .func = "Help 2", + .func = "Insts", .key = F_INSTS, .handler = handle_f3, }, { .key_str = "F4", - .func = "ShowAll", + .func = "Config", .key = F_CONF, .handler = handle_f4, }, @@ -348,7 +355,7 @@ struct function_keys function_keys[] = { }, { .key_str = "F8", - .func = "SymSearch", + .func = "Sym Search", .key = F_SEARCH, .handler = handle_f8, }, @@ -385,7 +392,7 @@ static void print_function_line(void) static void handle_f1(int *key, struct menu *current_item) { show_scroll_win(main_window, - _("Global help"), _(nconf_global_help)); + _("README"), _(nconf_readme)); return; } @@ -400,7 +407,7 @@ static void handle_f2(int *key, struct menu *current_item) static void handle_f3(int *key, struct menu *current_item) { show_scroll_win(main_window, - _("Short help"), + _("Instructions"), _(current_instructions)); return; } @@ -689,18 +696,13 @@ static void search_conf(void) { struct symbol **sym_arr; struct gstr res; - struct gstr title; char *dialog_input; int dres; - - title = str_new(); - str_printf( &title, _("Enter %s (sub)string to search for " - "(with or without \"%s\")"), CONFIG_, CONFIG_); - again: dres = dialog_inputbox(main_window, _("Search Configuration Parameter"), - str_get(&title), + _("Enter " CONFIG_ " (sub)string to search for " + "(with or without \"" CONFIG_ "\")"), "", &dialog_input_result, &dialog_input_result_len); switch (dres) { case 0: @@ -710,7 +712,6 @@ static void search_conf(void) _("Search Configuration"), search_help); goto again; default: - str_free(&title); return; } @@ -725,7 +726,6 @@ static void search_conf(void) show_scroll_win(main_window, _("Search Results"), str_get(&res)); str_free(&res); - str_free(&title); } diff --git a/trunk/scripts/kconfig/nconf.gui.c b/trunk/scripts/kconfig/nconf.gui.c index 9f8c44ecc703..379003c7a2b4 100644 --- a/trunk/scripts/kconfig/nconf.gui.c +++ b/trunk/scripts/kconfig/nconf.gui.c @@ -48,7 +48,7 @@ static void set_normal_colors(void) init_pair(INPUT_FIELD, -1, -1); init_pair(FUNCTION_HIGHLIGHT, -1, -1); - init_pair(FUNCTION_TEXT, COLOR_YELLOW, -1); + init_pair(FUNCTION_TEXT, COLOR_BLUE, -1); } /* available attributes: diff --git a/trunk/scripts/kconfig/qconf.cc b/trunk/scripts/kconfig/qconf.cc index 1500c38f0cca..df274febb3e5 100644 --- a/trunk/scripts/kconfig/qconf.cc +++ b/trunk/scripts/kconfig/qconf.cc @@ -6,7 +6,6 @@ #include #if QT_VERSION < 0x040000 -#include #include #include #include diff --git a/trunk/scripts/kconfig/symbol.c b/trunk/scripts/kconfig/symbol.c index ecc5aa5f865d..22a3c400fc41 100644 --- a/trunk/scripts/kconfig/symbol.c +++ b/trunk/scripts/kconfig/symbol.c @@ -656,11 +656,11 @@ bool sym_set_string_value(struct symbol *sym, const char *newval) size = strlen(newval) + 1; if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) { size += 2; - sym->def[S_DEF_USER].val = val = xmalloc(size); + sym->def[S_DEF_USER].val = val = malloc(size); *val++ = '0'; *val++ = 'x'; } else if (!oldval || strcmp(oldval, newval)) - sym->def[S_DEF_USER].val = val = xmalloc(size); + sym->def[S_DEF_USER].val = val = malloc(size); else return true; @@ -812,7 +812,7 @@ struct symbol *sym_lookup(const char *name, int flags) hash = 0; } - symbol = xmalloc(sizeof(*symbol)); + symbol = malloc(sizeof(*symbol)); memset(symbol, 0, sizeof(*symbol)); symbol->name = new_name; symbol->type = S_UNKNOWN; @@ -863,7 +863,7 @@ const char *sym_expand_string_value(const char *in) size_t reslen; reslen = strlen(in) + 1; - res = xmalloc(reslen); + res = malloc(reslen); res[0] = '\0'; while ((src = strchr(in, '$'))) { @@ -921,7 +921,7 @@ const char *sym_escape_string_value(const char *in) p++; } - res = xmalloc(reslen); + res = malloc(reslen); res[0] = '\0'; strcat(res, "\""); @@ -1228,7 +1228,7 @@ struct property *prop_alloc(enum prop_type type, struct symbol *sym) struct property *prop; struct property **propp; - prop = xmalloc(sizeof(*prop)); + prop = malloc(sizeof(*prop)); memset(prop, 0, sizeof(*prop)); prop->type = type; prop->sym = sym; diff --git a/trunk/scripts/kconfig/util.c b/trunk/scripts/kconfig/util.c index 6e7fbf196809..d0b8b2318e48 100644 --- a/trunk/scripts/kconfig/util.c +++ b/trunk/scripts/kconfig/util.c @@ -23,7 +23,7 @@ struct file *file_lookup(const char *name) } } - file = xmalloc(sizeof(*file)); + file = malloc(sizeof(*file)); memset(file, 0, sizeof(*file)); file->name = file_name; file->next = file_list; @@ -81,7 +81,7 @@ int file_write_dep(const char *name) struct gstr str_new(void) { struct gstr gs; - gs.s = xmalloc(sizeof(char) * 64); + gs.s = malloc(sizeof(char) * 64); gs.len = 64; gs.max_width = 0; strcpy(gs.s, "\0"); @@ -138,22 +138,3 @@ const char *str_get(struct gstr *gs) return gs->s; } -void *xmalloc(size_t size) -{ - void *p = malloc(size); - if (p) - return p; - fprintf(stderr, "Out of memory.\n"); - exit(1); -} - -void *xcalloc(size_t nmemb, size_t size) -{ - void *p = calloc(nmemb, size); - if (p) - return p; - fprintf(stderr, "Out of memory.\n"); - exit(1); -} - - diff --git a/trunk/scripts/kconfig/zconf.l b/trunk/scripts/kconfig/zconf.l index 6555a475453b..00f9d3a9cf8b 100644 --- a/trunk/scripts/kconfig/zconf.l +++ b/trunk/scripts/kconfig/zconf.l @@ -40,7 +40,7 @@ static void zconf_endfile(void); static void new_string(void) { - text = xmalloc(START_STRSIZE); + text = malloc(START_STRSIZE); text_asize = START_STRSIZE; text_size = 0; *text = 0; @@ -62,7 +62,7 @@ static void append_string(const char *str, int size) static void alloc_string(const char *str, int size) { - text = xmalloc(size + 1); + text = malloc(size + 1); memcpy(text, str, size); text[size] = 0; } @@ -288,7 +288,7 @@ void zconf_initscan(const char *name) exit(1); } - current_buf = xmalloc(sizeof(*current_buf)); + current_buf = malloc(sizeof(*current_buf)); memset(current_buf, 0, sizeof(*current_buf)); current_file = file_lookup(name); @@ -299,7 +299,7 @@ void zconf_nextfile(const char *name) { struct file *iter; struct file *file = file_lookup(name); - struct buffer *buf = xmalloc(sizeof(*buf)); + struct buffer *buf = malloc(sizeof(*buf)); memset(buf, 0, sizeof(*buf)); current_buf->state = YY_CURRENT_BUFFER; diff --git a/trunk/scripts/kconfig/zconf.lex.c_shipped b/trunk/scripts/kconfig/zconf.lex.c_shipped index a0521aa5974b..c32b1a49f5a3 100644 --- a/trunk/scripts/kconfig/zconf.lex.c_shipped +++ b/trunk/scripts/kconfig/zconf.lex.c_shipped @@ -802,7 +802,7 @@ static void zconf_endfile(void); static void new_string(void) { - text = xmalloc(START_STRSIZE); + text = malloc(START_STRSIZE); text_asize = START_STRSIZE; text_size = 0; *text = 0; @@ -824,7 +824,7 @@ static void append_string(const char *str, int size) static void alloc_string(const char *str, int size) { - text = xmalloc(size + 1); + text = malloc(size + 1); memcpy(text, str, size); text[size] = 0; } @@ -2343,7 +2343,7 @@ void zconf_initscan(const char *name) exit(1); } - current_buf = xmalloc(sizeof(*current_buf)); + current_buf = malloc(sizeof(*current_buf)); memset(current_buf, 0, sizeof(*current_buf)); current_file = file_lookup(name); @@ -2354,7 +2354,7 @@ void zconf_nextfile(const char *name) { struct file *iter; struct file *file = file_lookup(name); - struct buffer *buf = xmalloc(sizeof(*buf)); + struct buffer *buf = malloc(sizeof(*buf)); memset(buf, 0, sizeof(*buf)); current_buf->state = YY_CURRENT_BUFFER;