Lines Matching refs:name
49 char *dst, name[SYMBOL_MAXLENGTH]; in conf_expand_value() local
52 dst = name; in conf_expand_value()
56 dst = name; in conf_expand_value()
60 sym = sym_lookup(name, 0); in conf_expand_value()
74 char *env, *name; in conf_get_default_confname() local
76 name = conf_expand_value(conf_defname); in conf_get_default_confname()
79 fullname = realloc(fullname, strlen(env) + strlen(name) + 2); in conf_get_default_confname()
80 sprintf(fullname, "%s/%s", env, name); in conf_get_default_confname()
84 return name; in conf_get_default_confname()
87 int conf_read_simple(const char *name) in conf_read_simple() argument
95 if (name) { in conf_read_simple()
96 in = zconf_fopen(name); in conf_read_simple()
99 while ((name = *names++)) { in conf_read_simple()
100 name = conf_expand_value(name); in conf_read_simple()
101 in = zconf_fopen(name); in conf_read_simple()
105 "#\n"), name); in conf_read_simple()
113 conf_filename = name; in conf_read_simple()
152 conf_warning("trying to reassign symbol %s", sym->name); in conf_read_simple()
182 conf_warning("trying to reassign symbol %s", sym->name); in conf_read_simple()
203 conf_warning("symbol value '%s' invalid for %s", p, sym->name); in conf_read_simple()
226 conf_warning("symbol value '%s' invalid for %s", p, sym->name); in conf_read_simple()
247 conf_warning("%s creates inconsistent choice state", sym->name); in conf_read_simple()
253 conf_warning("%s creates inconsistent choice state", sym->name); in conf_read_simple()
269 int conf_read(const char *name) in conf_read() argument
276 if (conf_read_simple(name)) in conf_read()
331 int conf_write(const char *name) in conf_write() argument
349 if (name && name[0]) { in conf_write()
353 if (!stat(name, &st) && S_ISDIR(st.st_mode)) { in conf_write()
354 strcpy(dirname, name); in conf_write()
357 } else if ((slash = strrchr(name, '/'))) { in conf_write()
358 int size = slash - name + 1; in conf_write()
359 memcpy(dirname, name, size); in conf_write()
366 basename = name; in conf_write()
375 if (!name) { in conf_write()
469 fprintf(out, "# CONFIG_%s is not set\n", sym->name); in conf_write()
471 fprintf(out_h, "#undef CONFIG_%s\n", sym->name); in conf_write()
473 fprintf(out_h, "#define ENABLE_%s 0\n", sym->name); in conf_write()
474 fprintf(out_h, "#define IF_%s(...)\n", sym->name); in conf_write()
475 fprintf(out_h, "#define IF_NOT_%s(...) __VA_ARGS__\n", sym->name); in conf_write()
479 fprintf(out, "CONFIG_%s=m\n", sym->name); in conf_write()
481 fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); in conf_write()
484 fprintf(out, "CONFIG_%s=y\n", sym->name); in conf_write()
486 fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); in conf_write()
488 fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); in conf_write()
490 fprintf(out_h, "# define IF_%s(...) __VA_ARGS__ \"CONFIG_%s\"\n", sym->name, sym->name); in conf_write()
492 fprintf(out_h, "# define IF_%s(...) __VA_ARGS__\n", sym->name); in conf_write()
494 fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); in conf_write()
502 fprintf(out, "CONFIG_%s=\"", sym->name); in conf_write()
504 fprintf(out_h, "#define CONFIG_%s \"", sym->name); in conf_write()
524 fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); in conf_write()
526 fprintf(out_h, "# define IF_%s(...) __VA_ARGS__ \"CONFIG_%s\"\n", sym->name, sym->name); in conf_write()
528 fprintf(out_h, "# define IF_%s(...) __VA_ARGS__\n", sym->name); in conf_write()
530 fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); in conf_write()
536 fprintf(out, "CONFIG_%s=%s\n", sym->name, str); in conf_write()
538 fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); in conf_write()
540 fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); in conf_write()
542 fprintf(out_h, "# define IF_%s(...) __VA_ARGS__ \"CONFIG_%s\"\n", sym->name, sym->name); in conf_write()
544 fprintf(out_h, "# define IF_%s(...) __VA_ARGS__\n", sym->name); in conf_write()
546 fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); in conf_write()
554 fprintf(out, "CONFIG_%s=%s\n", sym->name, str); in conf_write()
556 fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); in conf_write()
558 fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); in conf_write()
560 fprintf(out_h, "# define IF_%s(...) __VA_ARGS__ \"CONFIG_%s\"\n", sym->name, sym->name); in conf_write()
562 fprintf(out_h, "# define IF_%s(...) __VA_ARGS__\n", sym->name); in conf_write()
564 fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); in conf_write()
589 if (!name || basename != conf_def_filename) { in conf_write()
590 if (!name) in conf_write()
591 name = conf_def_filename; in conf_write()
592 sprintf(tmpname, "%s.old", name); in conf_write()
593 rename(name, tmpname); in conf_write()