Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
scripts/gcc-plugins/structleak_plugin.c
static void register_attributes(void *event_data, void *data) { user_attr.name = "user"; user_attr.handler = handle_user_attribute; user_attr.affects_type_identity = true; register_attribute(&user_attr); }
[ 0, 0 ]
Linux Kernel
scripts/gcc-plugins/structleak_plugin.c
static unsigned int structleak_execute(void) { basic_block bb; tree var; unsigned int i; gcc_assert(single_succ_p(ENTRY_BLOCK_PTR_FOR_FN(cfun))); bb = single_succ(ENTRY_BLOCK_PTR_FOR_FN(cfun)); if (!single_pred_p(bb)) { split_edge(single_succ_edge(ENTRY_BLOCK_PTR_FOR_FN(cfun))); gcc_assert(single_s...
[ 1, 0 ]
Linux Kernel
scripts/gcc-plugins/structleak_plugin.c
__visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) { int i; const char *const plugin_name = plugin_info->base_name; const int argc = plugin_info->argc; const struct plugin_argument *const argv = plugin_info->argv; bool enable = true; ...
[ 1, 0 ]
Linux Kernel
scripts/genksyms/genksyms.c
static struct string_list *mk_node(const char *string) { struct string_list *newnode; newnode = xmalloc(sizeof(*newnode)); newnode->string = xstrdup(string); newnode->tag = SYM_NORMAL; newnode->next = NULL; return newnode; }
[ 0, 0 ]
Linux Kernel
scripts/genksyms/genksyms.c
struct string_list *copy_list_range(struct string_list *start, struct string_list *end) { struct string_list *res, *n; if (start == end) return NULL; n = res = copy_node(start); for (start = start->next; start != end; start = start->next) { n->next = copy_node(start...
[ 0, 0 ]
Linux Kernel
scripts/genksyms/genksyms.c
static int equal_list(struct string_list *a, struct string_list *b) { while (a && b) { if (a->tag != b->tag || strcmp(a->string, b->string)) return 0; a = a->next; b = b->next; } return !a && !b; }
[ 1, 0 ]
Linux Kernel
scripts/genksyms/genksyms.c
static void read_reference(FILE *f) { while (!feof(f)) { struct string_list *defn = NULL; struct string_list *sym, *def; int is_extern = 0, is_override = 0; struct symbol *subsym; sym = read_node(f); if (sym && sym->tag == SYM_NORMAL && !strcmp(sym->string, "override")) { is_override =...
[ 1, 0 ]
Linux Kernel
scripts/genksyms/genksyms.c
static void print_list(FILE *f, struct string_list *list) { struct string_list **e, **b; struct string_list *tmp, **tmp2; int elem = 1; if (list == NULL) { fputs("(nil)", f); return; } tmp = list; while ((tmp = tmp->next) != NULL) elem++; b = alloca(elem * sizeof(*e)); e = b + elem; ...
[ 1, 0 ]
Linux Kernel
scripts/genksyms/genksyms.c
static void print_location(void) { fprintf(stderr, "%s:%d: ", cur_filename ?: "<stdin>", cur_line); }
[ 1, 0 ]
Linux Kernel
scripts/insert-sys-cert.c
static void get_symbol_from_map(Elf_Ehdr *hdr, FILE *f, char *name, struct sym *s) { char l[LINE_SIZE]; char *w, *p, *n; s->size = 0; s->address = 0; s->offset = 0; if (fseek(f, 0, SEEK_SET) != 0) { perror("File seek failed"); exit(EXIT_FAILURE); } while (fgets(...
[ 0, 0 ]
Linux Kernel
scripts/insert-sys-cert.c
static Elf_Shdr *get_symbol_table(Elf_Ehdr *hdr) { Elf_Shdr *x; unsigned int i, num_sections; x = (void *)hdr + hdr->e_shoff; if (hdr->e_shnum == SHN_UNDEF) num_sections = x[0].sh_size; else num_sections = hdr->e_shnum; for (i = 1; i < num_sections; i++) if (x[i].sh_type == SHT_SYMTAB) ...
[ 0, 0 ]
Linux Kernel
scripts/insert-sys-cert.c
static void print_sym(Elf_Ehdr *hdr, struct sym *s) { info("sym: %s\n", s->name); info("addr: 0x%lx\n", s->address); info("size: %d\n", s->size); info("offset: 0x%lx\n", (unsigned long)s->offset); }
[ 0, 0 ]
Linux Kernel
scripts/kallsyms.c
static void usage(void) { fprintf(stderr, "Usage: kallsyms [--all-symbols] [--absolute-percpu] " "[--base-relative] [--lto-clang] in.map > out.S\n"); exit(1); }
[ 1, 0 ]
Linux Kernel
scripts/kallsyms.c
static char *sym_name(const struct sym_entry *s) { return (char *)s->sym + 1; }
[ 0, 0 ]
Linux Kernel
scripts/kallsyms.c
static void shrink_table(void) { unsigned int i, pos; pos = 0; for (i = 0; i < table_cnt; i++) { if (symbol_valid(table[i])) { if (pos != i) table[pos] = table[i]; pos++; } else { free(table[i]); } } table_cnt = pos; if (!table_cnt) { fprintf(stderr, "No valid sym...
[ 1, 0 ]
Linux Kernel
scripts/kallsyms.c
static char *s_name(char *buf) { return buf + 1; }
[ 0, 0 ]
Linux Kernel
scripts/kallsyms.c
static int compare_names(const void *a, const void *b) { int ret; char sa_namebuf[KSYM_NAME_LEN]; char sb_namebuf[KSYM_NAME_LEN]; const struct sym_entry *sa = *(const struct sym_entry **)a; const struct sym_entry *sb = *(const struct sym_entry **)b; expand_symbol(sa->sym, sa->len, sa_namebuf); expand_sym...
[ 0, 0 ]
Linux Kernel
scripts/kallsyms.c
static void forget_symbol(const unsigned char *symbol, int len) { int i; for (i = 0; i < len - 1; i++) token_profit[symbol[i] + (symbol[i + 1] << 8)]--; }
[ 1, 0 ]
Linux Kernel
scripts/kallsyms.c
static void build_initial_token_table(void) { unsigned int i; for (i = 0; i < table_cnt; i++) learn_symbol(table[i]->sym, table[i]->len); }
[ 0, 0 ]
Linux Kernel
scripts/kallsyms.c
static void insert_real_symbols_in_table(void) { unsigned int i, j, c; for (i = 0; i < table_cnt; i++) { for (j = 0; j < table[i]->len; j++) { c = table[i]->sym[j]; best_table[c][0] = c; best_table_len[c] = 1; } } }
[ 0, 0 ]
Linux Kernel
scripts/kallsyms.c
static int may_be_linker_script_provide_symbol(const struct sym_entry *se) { const char *symbol = sym_name(se); int len = se->len - 1; if (len < 8) return 0; if (symbol[0] != '_' || symbol[1] != '_') return 0; if (!memcmp(symbol + 2, "start_", 6)) return 1; /* __stop_XXXXX */ if (!memcmp(s...
[ 1, 0 ]
Linux Kernel
scripts/kallsyms.c
static void record_relative_base(void) { unsigned int i; for (i = 0; i < table_cnt; i++) if (!symbol_absolute(table[i])) { relative_base = table[i]->addr; return; } }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/conf.c
static void strip(char *str) { char *p = str; int l; while ((isspace(*p))) p++; l = strlen(p); if (p != str) memmove(str, p, l + 1); if (!l) return; p = str + l - 1; while ((isspace(*p))) *p-- = 0; }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/conf.c
static int conf_askvalue(struct symbol *sym, const char *def) { if (!sym_has_value(sym)) printf("(NEW) "); line[0] = '\n'; line[1] = 0; if (!sym_is_changeable(sym)) { printf("%s\n", def); line[0] = '\n'; line[1] = 0; return 0; } switch (input_mode) { case oldconfig: case syncconfi...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/conf.c
static void conf(struct menu *menu) { struct symbol *sym; struct property *prop; struct menu *child; if (!menu_is_visible(menu)) return; sym = menu->sym; prop = menu->prompt; if (prop) { const char *prompt; switch (prop->type) { case P_MENU: if (input_mode != oldaskconfig && root...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/confdata.c
static const char *conf_get_autoheader_name(void) { char *name = getenv("KCONFIG_AUTOHEADER"); return name ? name : "include/generated/autoconf.h"; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/confdata.c
static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) { char *p2; switch (sym->type) { case S_TRISTATE: if (p[0] == 'm') { sym->def[def].tri = mod; sym->flags |= def_flags; break; } case S_BOOLEAN: if (p[0] == 'y') { sy...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/confdata.c
static int add_byte(int c, char **lineptr, size_t slen, size_t *n) { char *nline; size_t new_size = slen + 1; if (new_size > *n) { new_size += LINE_GROWTH - 1; new_size *= 2; nline = xrealloc(*lineptr, new_size); if (!nline) return -1; *lineptr = nline; *n = new_size; } (*linep...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/confdata.c
static void print_symbol_for_autoconf(FILE *fp, struct symbol *sym) { __print_symbol(fp, sym, OUTPUT_N_NONE, false); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/confdata.c
void print_symbol_for_listconfig(struct symbol *sym) { __print_symbol(stdout, sym, OUTPUT_N, true); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/confdata.c
int conf_write_defconfig(const char *filename) { struct symbol *sym; struct menu *menu; FILE *out; out = fopen(filename, "w"); if (!out) return 1; sym_clear_all_valid(); menu = rootmenu.list; while (menu != NULL) { sym = menu->sym; if (sym == NULL) { if (!menu_is_visible(menu)) ...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/confdata.c
static int conf_write_autoconf_cmd(const char *autoconf_name) { char name[PATH_MAX], tmp[PATH_MAX]; struct file *file; FILE *out; int ret; ret = snprintf(name, sizeof(name), "%s.cmd", autoconf_name); if (ret >= sizeof(name)) return -1; if (make_parent_dir(name)) return -1; ret = snprintf(tmp,...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/expr.c
struct expr *expr_alloc_symbol(struct symbol *sym) { struct expr *e = xcalloc(1, sizeof(*e)); e->type = E_SYMBOL; e->left.sym = sym; return e; }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/expr.c
struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) { struct expr *e = xcalloc(1, sizeof(*e)); e->type = type; e->left.expr = ce; return e; }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/expr.c
struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2) { struct expr *e = xcalloc(1, sizeof(*e)); e->type = type; e->left.expr = e1; e->right.expr = e2; return e; }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/expr.c
struct expr *expr_copy(const struct expr *org) { struct expr *e; if (!org) return NULL; e = xmalloc(sizeof(*org)); memcpy(e, org, sizeof(*org)); switch (org->type) { case E_SYMBOL: e->left = org->left; break; case E_NOT: e->left.expr = expr_copy(org->left.expr); break; case E_EQUA...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/expr.c
int expr_eq(struct expr *e1, struct expr *e2) { int res, old_count; if (!e1 || !e2) return expr_is_yes(e1) && expr_is_yes(e2); if (e1->type != e2->type) return 0; switch (e1->type) { case E_EQUAL: case E_GEQ: case E_GTH: case E_LEQ: case E_LTH: case E_UNEQUAL: return e1->left.sym == e2...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/expr.c
bool expr_depends_symbol(struct expr *dep, struct symbol *sym) { if (!dep) return false; switch (dep->type) { case E_AND: return expr_depends_symbol(dep->left.expr, sym) || expr_depends_symbol(dep->right.expr, sym); case E_SYMBOL: return dep->left.sym == sym; case E_EQUAL: if (dep...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/expr.c
static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) { xfwrite(str, strlen(str), 1, data); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
static void replace_button_icon(GladeXML *xml, GdkDrawable *window, GtkStyle *style, gchar *btn_name, gchar **xpm) { GdkPixmap *pixmap; GdkBitmap *mask; GtkToolButton *button; GtkWidget *image; pixmap = gdk_pixmap_create_from_xpm_d(window, &mask, ...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
static void init_tree_model(void) { gint i; tree = tree2 = gtk_tree_store_new( COL_NUMBER, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, GDK_TYPE_COLOR, G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLE...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) { GtkWidget *dialog, *label; gint result; if (!conf_get_changed()) return FALSE; dialog = gtk_dialog_new_with_buttons( "Warning !", GTK_WINDOW(main_wnd), (GtkDialogFlags)(G...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_save_activate(GtkMenuItem *menuitem, gpointer user_data) { if (conf_write(NULL)) text_insert_msg("Error", "Unable to save configuration !"); conf_write_autoconf(0); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
static void store_filename(GtkFileSelection *file_selector, gpointer user_data) { const gchar *fn; fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION(user_data)); if (conf_write(fn)) text_insert_msg("Error", "Unable to save configuration !"); gtk_widget_destroy(GTK_WIDGE...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data) { if (!on_window1_delete_event(NULL, NULL, NULL)) gtk_widget_destroy(GTK_WIDGET(main_wnd)); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_show_name1_activate(GtkMenuItem *menuitem, gpointer user_data) { GtkTreeViewColumn *col; show_name = GTK_CHECK_MENU_ITEM(menuitem)->active; col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NAME); if (col) gtk_tree_view_column_set_visible(col, show_name); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_show_range1_activate(GtkMenuItem *menuitem, gpointer user_data) { GtkTreeViewColumn *col; show_range = GTK_CHECK_MENU_ITEM(menuitem)->active; col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NO); if (col) gtk_tree_view_column_set_visible(col, show_range); col = gtk_tree_view_get_colum...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_show_data1_activate(GtkMenuItem *menuitem, gpointer user_data) { GtkTreeViewColumn *col; show_value = GTK_CHECK_MENU_ITEM(menuitem)->active; col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_VALUE); if (col) gtk_tree_view_column_set_visible(col, show_value); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_set_option_mode2_activate(GtkMenuItem *menuitem, gpointer user_data) { opt_mode = OPT_ALL; gtk_tree_store_clear(tree2); display_tree(&rootmenu); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_set_option_mode3_activate(GtkMenuItem *menuitem, gpointer user_data) { opt_mode = OPT_PROMPT; gtk_tree_store_clear(tree2); display_tree(&rootmenu); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_introduction1_activate(GtkMenuItem *menuitem, gpointer user_data) { GtkWidget *dialog; const gchar *intro_text = "Welcome to gkc, the GTK+ graphical configuration tool\n" "For each option, a blank box indicates the feature is disabled, a\n" "check indicates it is enabled, and a dot indic...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_full_clicked(GtkButton *button, gpointer user_data) { view_mode = FULL_VIEW; gtk_widget_hide(tree1_w); if (tree2) gtk_tree_store_clear(tree2); display_tree(&rootmenu); gtk_widget_set_sensitive(back_btn, FALSE); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
void on_treeview2_cursor_changed(GtkTreeView *treeview, gpointer user_data) { GtkTreeSelection *selection; GtkTreeIter iter; struct menu *menu; selection = gtk_tree_view_get_selection(treeview); if (gtk_tree_selection_get_selected(selection, &model2, &iter)) { gtk_tree_model_get(model2, &iter, COL_MENU, ...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
static void display_tree(struct menu *menu) { struct symbol *sym; struct property *prop; struct menu *child; enum prop_type ptype; if (menu == &rootmenu) { indent = 1; current = &rootmenu; } for (child = menu->list; child; child = child->next) { prop = child->prompt; sym = child->sym; ...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/gconf.c
int main(int ac, char *av[]) { const char *name; char *env; gchar *glade_file; gtk_set_locale(); gtk_init(&ac, &av); glade_init(); /* Determine GUI path */ env = getenv(SRCTREE); if (env) glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL); else if (av[0][0] == '/') glade_f...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/list.h
static inline int list_empty(const struct list_head *head) { return head->next == head; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/list.h
static inline void list_add_tail(struct list_head *_new, struct list_head *head) { __list_add(_new, head->prev, head); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/checklist.c
static void print_arrows(WINDOW *win, int choice, int item_no, int scroll, int y, int x, int height) { wmove(win, y, x); if (scroll > 0) { wattrset(win, dlg.uarrow.atr); waddch(win, ACS_UARROW); waddstr(win, "(-)"); } else { wattrset(win, dlg.menubox.atr); waddch(win,...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/textbox.c
static void print_line(WINDOW *win, int row, int width) { char *line; line = get_line(); line += MIN(strlen(line), hscroll); wmove(win, row, 0); /* move cursor to correct line */ waddch(win, ' '); waddnstr(win, line, MIN(strlen(line), width - 2)); /* Clear 'residue' of previous line */ #if OLD_NCURSES ...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
static void set_classic_theme(void) { DLG_COLOR(screen, COLOR_CYAN, COLOR_BLUE, true); DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, true); DLG_COLOR(dialog, COLOR_BLACK, COLOR_WHITE, false); DLG_COLOR(title, COLOR_YELLOW, COLOR_WHITE, true); DLG_COLOR(border, COLOR_WHITE, COLOR_WHITE, true); DLG_COLOR(butto...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
static void set_blackbg_theme(void) { DLG_COLOR(screen, COLOR_RED, COLOR_BLACK, true); DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, false); DLG_COLOR(dialog, COLOR_WHITE, COLOR_BLACK, false); DLG_COLOR(title, COLOR_RED, COLOR_BLACK, false); DLG_COLOR(border, COLOR_BLACK, COLOR_BLACK, true); DLG_COLOR(butto...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
static void init_one_color(struct dialog_color *color) { static int pair = 0; pair++; init_pair(pair, color->fg, color->bg); if (color->hl) color->atr = A_BOLD | COLOR_PAIR(pair); else color->atr = COLOR_PAIR(pair); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
static void color_setup(const char *theme) { int use_color; use_color = set_theme(theme); if (use_color && has_colors()) { start_color(); init_dialog_colors(); } else set_mono_theme(); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
int init_dialog(const char *backtitle) { int height, width; initscr(); /* Get current cursor position for signal handler in mconf.c */ getyx(stdscr, saved_y, saved_x); getmaxyx(stdscr, height, width); if (height < WINDOW_HEIGTH_MIN || width < WINDOW_WIDTH_MIN) { endwin(); return -ERRDISPLAYTOOSMA...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
void draw_box(WINDOW *win, int y, int x, int height, int width, chtype box, chtype border) { int i, j; wattrset(win, 0); for (i = 0; i < height; i++) { wmove(win, y + i, x); for (j = 0; j < width; j++) if (!i && !j) waddch(win, border | ACS_ULCORNER); else if (i == heigh...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
int on_key_esc(WINDOW *win) { int key; int key2; int key3; nodelay(win, TRUE); keypad(win, FALSE); key = wgetch(win); key2 = wgetch(win); do { key3 = wgetch(win); } while (key3 != ERR); nodelay(win, FALSE); keypad(win, TRUE); if (key == KEY_ESC && key2 == ERR) return KEY_ESC; else if ...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
void *item_data(void) { return item_cur->node.data; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/lxdialog/util.c
const char *item_str(void) { return item_cur->node.str; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/mconf.c
static void set_config_filename(const char *config_filename) { static char menu_backtitle[PATH_MAX + 128]; snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s", config_filename, rootmenu.prompt->text); set_dialog_backtitle(menu_backtitle); snprintf(filename, sizeof(filename), "%s", config_fil...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/mconf.c
static void set_subtitle(void) { struct subtitle_part *sp; struct subtitle_list *pos, *tmp; for (pos = subtitles; pos != NULL; pos = tmp) { tmp = pos->next; free(pos); } subtitles = NULL; list_for_each_entry(sp, &trail, entries) { if (sp->text) { if (pos) { pos->next = xcalloc(1,...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/mconf.c
static void reset_subtitle(void) { struct subtitle_list *pos, *tmp; for (pos = subtitles; pos != NULL; pos = tmp) { tmp = pos->next; free(pos); } subtitles = NULL; set_dialog_subtitles(subtitles); }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/mconf.c
static void conf_message_callback(const char *s) { if (save_and_exit) { if (!silent) printf("%s", s); } else { show_textbox(NULL, s, 6, 60); } }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/mconf.c
static void conf_string(struct menu *menu) { const char *prompt = menu_get_prompt(menu); while (1) { int res; const char *heading; switch (sym_get_type(menu->sym)) { case S_INT: heading = inputbox_instructions_int; break; case S_HEX: heading = inputbox_instructions_hex; ...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/mconf.c
static void conf_save(void) { while (1) { int res; dialog_clear(); res = dialog_inputbox(NULL, save_config_text, 11, 55, filename); switch (res) { case 0: if (!dialog_input_result[0]) return; if (!conf_write(dialog_input_result)) { set_config_filename(dialog_input_resu...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/mconf.c
int main(int ac, char **av) { char *mode; int res; signal(SIGINT, sig_handler); if (ac > 1 && strcmp(av[1], "-s") == 0) { silent = 1; conf_set_message_callback(NULL); av++; } conf_parse(av[1]); conf_read(NULL); mode = getenv("MENUCONFIG_MODE"); if (mode) { if (!strcasecmp(mode, "si...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/menu.c
static void prop_warn(struct property *prop, const char *fmt, ...) { va_list ap; va_start(ap, fmt); fprintf(stderr, "%s:%d:warning: ", prop->file->name, prop->lineno); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); va_end(ap); }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/menu.c
void menu_add_entry(struct symbol *sym) { struct menu *menu; menu = xmalloc(sizeof(*menu)); memset(menu, 0, sizeof(*menu)); menu->sym = sym; menu->parent = current_menu; menu->file = current_file; menu->lineno = zconf_lineno(); *last_entry_ptr = menu; last_entry_ptr = &menu->next; current_entry =...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/menu.c
void menu_add_visibility(struct expr *expr) { current_entry->visibility = expr_alloc_and(current_entry->visibility, expr); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/menu.c
bool menu_is_empty(struct menu *menu) { struct menu *child; for (child = menu->list; child; child = child->next) { if (menu_is_visible(child)) return (false); } return (true); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/menu.c
const char *menu_get_prompt(struct menu *menu) { if (menu->prompt) return menu->prompt->text; else if (menu->sym) return menu->sym->name; return NULL; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void print_function_line(void) { int i; int offset = 1; const int skip = 1; int lines = getmaxy(stdscr); for (i = 0; i < function_keys_num; i++) { wattrset(main_window, attr_function_highlight); mvwprintw(main_window, lines - 3, offset, "%s", function_keys[i].key_str); wattrset(main_windo...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void handle_f2(int *key, struct menu *current_item) { show_help(current_item); return; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void handle_f4(int *key, struct menu *current_item) { int res = btn_dialog(main_window, "Show all symbols?", 2, " <Show All> ", "<Don't show all>"); if (res == 0) show_all_items = 1; else if (res == 1) show_all_items = 0; return; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void handle_f5(int *key, struct menu *current_item) { *key = KEY_LEFT; return; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void handle_f6(int *key, struct menu *current_item) { conf_save(); return; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void clean_items(void) { int i; for (i = 0; curses_menu_items[i]; i++) free_item(curses_menu_items[i]); bzero(curses_menu_items, sizeof(curses_menu_items)); bzero(k_menu_items, sizeof(k_menu_items)); items_num = 0; }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void item_add_str(const char *fmt, ...) { va_list ap; int index = items_num - 1; char new_str[256]; char tmp_str[256]; if (index < 0) return; va_start(ap, fmt); vsnprintf(new_str, sizeof(new_str), fmt, ap); va_end(ap); snprintf(tmp_str, sizeof(tmp_str), "%s%s", k_menu_items[index].str, ne...
[ 1, 1 ]
Linux Kernel
scripts/kconfig/nconf.c
static int item_is_tag(char tag) { return item_tag() == tag; }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void set_config_filename(const char *config_filename) { snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s", config_filename, rootmenu.prompt->text); snprintf(filename, sizeof(filename), "%s", config_filename); }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
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 (sub)string or regexp to search for " "(with or without \"%s\")", CONFIG_); again: dres = dialo...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void reset_menu(void) { unpost_menu(curses_menu); clean_items(); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void conf_load(void) { while (1) { int res; res = dialog_inputbox(main_window, NULL, load_config_text, filename, &dialog_input_result, &dialog_input_result_len); switch (res) { case 0: if (!dialog_input_result[0]) return; if (!conf_read(dialog_inpu...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/nconf.c
static void setup_windows(void) { int lines, columns; getmaxyx(stdscr, lines, columns); if (main_window != NULL) delwin(main_window); main_window = newwin(lines - 2, columns - 2, 2, 1); keypad(main_window, TRUE); mwin_max_lines = lines - 7; mwin_max_cols = columns - 6; /* panels order is from bo...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.gui.c
void set_colors(void) { const struct nconf_attr_param *p; int pair = 0; if (has_colors()) { start_color(); use_default_colors(); p = color_theme_params; } else { p = no_color_theme_params; } for (; p->attr; p++) { int attr = p->highlight; if (p->has_color) { pair++; i...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.gui.c
void print_in_middle(WINDOW *win, int y, int width, const char *str, int attrs) { wattrset(win, attrs); mvwprintw(win, y, (width - strlen(str)) / 2, "%s", str); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/nconf.gui.c
void fill_window(WINDOW *win, const char *text) { int x, y; int total_lines = get_line_no(text); int i; getmaxyx(win, y, x); total_lines = min(total_lines, y); for (i = 0; i < total_lines; i++) { char tmp[x + 10]; const char *line = get_line(text, i); int len = get_line_length(line); strnc...
[ 1, 0 ]
Linux Kernel
scripts/kconfig/preprocess.c
static void env_add(const char *name, const char *value) { struct env *e; e = xmalloc(sizeof(*e)); e->name = xstrdup(name); e->value = xstrdup(value); list_add_tail(&e->node, &env_list); }
[ 0, 0 ]
Linux Kernel
scripts/kconfig/preprocess.c
static void env_del(struct env *e) { list_del(&e->node); free(e->name); free(e->value); free(e); }
[ 1, 0 ]
Linux Kernel
scripts/kconfig/preprocess.c
static char *env_expand(const char *name) { struct env *e; const char *value; if (!*name) return NULL; list_for_each_entry(e, &env_list, node) { if (!strcmp(name, e->name)) return xstrdup(e->value); } value = getenv(name); if (!value) return NULL; env_add(name, value); return xs...
[ 0, 0 ]
Linux Kernel
scripts/kconfig/preprocess.c
static char *do_error_if(int argc, char *argv[]) { if (!strcmp(argv[0], "y")) pperror("%s", argv[1]); return xstrdup(""); }
[ 0, 0 ]