本文整理汇总了C++中conf_write函数的典型用法代码示例。如果您正苦于以下问题:C++ conf_write函数的具体用法?C++ conf_write怎么用?C++ conf_write使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了conf_write函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: conf_save
static void conf_save(void)
{
int stat;
while (1) {
cprint_init();
cprint("--inputbox");
cprint(save_config_text);
cprint("11");
cprint("55");
cprint("%s", filename);
stat = exec_conf();
switch(stat) {
case 0:
if (!input_buf[0])
return;
if (!conf_write(input_buf))
return;
show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60);
break;
case 1:
show_helptext("Save Alternate Configuration", save_config_help);
break;
case 255:
return;
}
}
}
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:28,代码来源:mconf.c
示例2: on_save_activate
void on_save_activate(GtkMenuItem * menuitem, gpointer user_data)
{
if (conf_write(NULL))
text_insert_msg(_("Error"), _("Unable to save configuration !"));
if (conf_write_autoconf())
text_insert_msg(_("Error"), _("Unable to save configuration !"));
}
开发者ID:0ida,项目名称:coreboot,代码行数:7,代码来源:gconf.c
示例3: dump_rt_entry
static void
dump_rt_entry(FILE *fp, void *e)
{
rt_entry_t *rte = (rt_entry_t *)e;
conf_write(fp, "rt_table %u, name %s", rte->id, rte->name);
}
开发者ID:acassen,项目名称:keepalived,代码行数:7,代码来源:rttables.c
示例4: on_save1_activate
void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data)
{
if (conf_write(NULL))
text_insert_msg(_("Error"), _("Unable to save configuration !"));
config_changed = FALSE;
}
开发者ID:OpenHMR,项目名称:Open-HMR600,代码行数:7,代码来源:gconf.c
示例5: conf_save
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_result);
return;
}
show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60);
break;
case 1:
show_helptext(_("Save Alternate Configuration"), save_config_help);
break;
case KEY_ESC:
return;
}
}
}
开发者ID:16rd,项目名称:rt-n56u,代码行数:25,代码来源:mconf.c
示例6: main
int main(int ac, char **av)
{
char *mode;
int res;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
conf_parse(av[1]);
conf_read(NULL);
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
reset_dialog();
init_dialog(NULL);
set_config_filename(conf_get_configname());
do {
conf(&rootmenu);
dialog_clear();
if (conf_get_changed())
res = dialog_yesno(NULL,
_("Do you wish to save your "
"new configuration?\n"
"<ESC><ESC> to continue."),
6, 60);
else
res = -1;
} while (res == KEY_ESC);
end_dialog();
switch (res) {
case 0:
if (conf_write(filename)) {
fprintf(stderr, _("\n\n"
"Error during writing of the configuration.\n"
"Your configuration changes were NOT saved."
"\n\n"));
return 1;
}
case -1:
printf(_("\n\n"
"*** End of configuration.\n"
"\n\n"));
break;
default:
fprintf(stderr, _("\n\n"
"Your configuration changes were NOT saved."
"\n\n"));
}
return 0;
}
开发者ID:BackupTheBerlios,项目名称:openslx-svn,代码行数:60,代码来源:mconf.c
示例7: main
int main(int ac, char **av)
{
struct symbol *sym;
char *mode;
int res;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("KERNELVERSION", 0);
sym_calc_value(sym);
sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
reset_dialog();
init_dialog(menu_backtitle);
do {
conf(&rootmenu);
dialog_clear();
res = dialog_yesno(NULL,
_("Do you wish to save your "
"new kernel configuration?\n"
"<ESC><ESC> to continue."),
6, 60);
} while (res == KEY_ESC);
end_dialog();
if (res == 0) {
if (conf_write(NULL)) {
fprintf(stderr, _("\n\n"
"Error during writing of the kernel configuration.\n"
"Your kernel configuration changes were NOT saved."
"\n\n"));
return 1;
}
printf(_("\n\n"
"*** End of Linux kernel configuration.\n"
"*** Execute 'make' to build the kernel or try 'make help'."
"\n\n"));
} else {
fprintf(stderr, _("\n\n"
"Your kernel configuration changes were NOT saved."
"\n\n"));
}
return 0;
}
开发者ID:Voskrese,项目名称:mipsonqemu,代码行数:59,代码来源:mconf.c
示例8: dump_tcp_check
static void
dump_tcp_check(FILE *fp, void *data)
{
checker_t *checker = data;
conf_write(fp, " Keepalive method = TCP_CHECK");
dump_checker_opts(fp, checker);
}
开发者ID:anlaneg,项目名称:keepalived,代码行数:8,代码来源:check_tcp.c
示例9: main
int main(int ac, char **av)
{
struct symbol *sym;
char *mode;
int stat;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("KERNELVERSION", 0);
sym_calc_value(sym);
sprintf(menu_backtitle, _("swupdate %s Configuration"),
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
conf(&rootmenu);
do {
cprint_init();
cprint("--yesno");
cprint(_("Do you wish to save your new configuration?"));
cprint("5");
cprint("60");
stat = exec_conf();
} while (stat < 0);
if (stat == 0) {
if (conf_write(NULL)) {
fprintf(stderr, _("\n\n"
"Error during writing of the configuration.\n"
"Your configuration changes were NOT saved."
"\n\n"));
return 1;
}
printf(_("\n\n"
"*** End of configuration.\n"
"*** Execute 'make' to build the project or try 'make help'."
"\n\n"));
} else {
fprintf(stderr, _("\n\n"
"Your configuration changes were NOT saved."
"\n\n"));
}
return 0;
}
开发者ID:EyeSee360,项目名称:swupdate,代码行数:58,代码来源:mconf.c
示例10: wifi_start_scan
/*
* Initiate wifi scan.
*/
static void wifi_start_scan(void)
{
const enum conf_token wifi_scan_start[] = {
CT_wifi, CT_scan, CT_start
};
u8 val = 1;
conf_write(1, wifi_scan_start, 3, ATLV_INT, &val, sizeof(val));
}
开发者ID:panfudongit,项目名称:Ayla-F100-Demo,代码行数:12,代码来源:wifi_demo.c
示例11: sprintf
/**
* Set the data which is in the selected group and value
*/
void config::setDouble(const char* ch_group, const char* value, double data){
group=conf_get_group(&conf,ch_group);
char buffer[16];
sprintf(buffer,"%lf", data);
group_set_value(group, value, buffer);
fp = fopen(myfilename, "w");
conf_write(&conf, fp);
eprintf("Configuration saved\n");
fclose(fp);
}
开发者ID:fnal,项目名称:elComandante,代码行数:13,代码来源:config.cpp
示例12: main
int main(int ac, char **av)
{
struct symbol *sym;
char *mode;
int stat;
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("KERNELRELEASE", 0);
sym_calc_value(sym);
sprintf(menu_backtitle, "Linux Kernel v%s Configuration",
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
conf(&rootmenu);
do {
cprint_init();
cprint("--yesno");
cprint("Do you wish to save your new kernel configuration?");
cprint("5");
cprint("60");
stat = exec_conf();
} while (stat < 0);
if (stat == 0) {
if (conf_write(NULL)) {
fprintf(stderr, "\n\n"
"Error during writing of the kernel configuration.\n"
"Your kernel configuration changes were NOT saved."
"\n\n");
return 1;
}
printf("\n\n"
"*** End of Linux kernel configuration.\n"
"*** Execute 'make' to build the kernel or try 'make help'."
"\n\n");
} else {
fprintf(stderr, "\n\n"
"Your kernel configuration changes were NOT saved."
"\n\n");
}
return 0;
}
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:54,代码来源:mconf.c
示例13: dump_iprule
void
dump_iprule(FILE *fp, void *rule_data)
{
ip_rule_t *rule = rule_data;
char *buf = MALLOC(RULE_BUF_SIZE);
format_iprule(rule, buf, RULE_BUF_SIZE);
conf_write(fp, " %s", buf);
FREE(buf);
}
开发者ID:acassen,项目名称:keepalived,代码行数:12,代码来源:vrrp_iprule.c
示例14: store_filename
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_WIDGET(user_data));
}
开发者ID:OpenHMR,项目名称:Open-HMR600,代码行数:13,代码来源:gconf.c
示例15: mcpcia_write_config
static int
mcpcia_write_config(struct pci_dev *dev, int where, u32 value, long mask)
{
struct pci_controler *hose = dev->sysdata;
unsigned long addr;
unsigned char type1;
if (mk_conf_addr(dev, where, hose, &addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
addr |= mask;
value = __kernel_insql(value, where & 3);
conf_write(addr, value, type1, hose);
return PCIBIOS_SUCCESSFUL;
}
开发者ID:dmgerman,项目名称:linux-pre-history,代码行数:15,代码来源:core_mcpcia.c
示例16: mcpcia_write_config
static int
mcpcia_write_config(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 value)
{
struct pci_controller *hose = bus->sysdata;
unsigned long addr;
unsigned char type1;
if (mk_conf_addr(bus, devfn, where, hose, &addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
addr |= (size - 1) * 8;
value = __kernel_insql(value, where & 3);
conf_write(addr, value, type1, hose);
return PCIBIOS_SUCCESSFUL;
}
开发者ID:broodplank,项目名称:Samsung-Galaxy-S-Plus,代码行数:16,代码来源:core_mcpcia.c
示例17: main
int main(int ac, char **av)
{
struct symbol *sym;
char *mode;
int stat;
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("VERSION", 0);
sym_calc_value(sym);
snprintf(menu_backtitle, 128, "BusyBox v%s Configuration",
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
init_dialog();
signal(SIGWINCH, winch_handler);
conf(&rootmenu);
end_dialog();
/* Restart dialog to act more like when lxdialog was still separate */
init_dialog();
do {
stat = dialog_yesno(NULL,
"Do you wish to save your new diagnostic program configuration?", 6, 60);
} while (stat < 0);
end_dialog();
if (stat == 0) {
conf_write(NULL);
printf("\n\n"
"*** End of SQ diagnostic program configuration.\n");
printf("*** Execute 'make' to build the diagnostic program or try 'make help'.\n\n");
} else
printf("\n\nYour diagnostic program configuration changes were NOT saved.\n\n");
return 0;
}
开发者ID:WTHsieh,项目名称:diag,代码行数:46,代码来源:mconf.c
示例18: main
int main(int ac, char **av)
{
int stat;
char *mode;
struct symbol *sym;
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("VERSION", 0);
sym_calc_value(sym);
snprintf(menu_backtitle, 128, "Core v%s Configuration",
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
if (mode) {
if (!strcasecmp(mode, "single_menu"))
single_menu_mode = 1;
}
tcgetattr(1, &ios_org);
atexit(conf_cleanup);
init_wsize();
init_dialog();
signal(SIGWINCH, winch_handler);
conf(&rootmenu);
end_dialog();
/* Restart dialog to act more like when lxdialog was still separate */
init_dialog();
do {
stat = dialog_yesno(NULL,
"Do you wish to save your new Core configuration?", 5, 60);
} while (stat < 0);
end_dialog();
if (stat == 0) {
conf_write(NULL);
printf("\n\n"
"*** End of Core configuration.\n"
"*** Check the top-level Makefile for additional configuration options.\n\n");
} else
printf("\n\nYour Core configuration changes were NOT saved.\n\n");
return 0;
}
开发者ID:ChenBoTang,项目名称:ARM,代码行数:46,代码来源:mconf.c
示例19: handle_exit
static int handle_exit(void)
{
int res;
dialog_clear();
if (conf_get_changed())
res = dialog_yesno(NULL,
_("Do you wish to save your new configuration ?\n"
"<ESC><ESC> to continue."),
6, 60);
else
res = -1;
end_dialog(saved_x, saved_y);
switch (res) {
case 0:
if (conf_write(filename)) {
fprintf(stderr, _("\n\n"
"Error while writing of the configuration.\n"
"Your configuration changes were NOT saved."
"\n\n"));
return 1;
}
/* fall through */
case -1:
printf(_("\n\n"
"*** End of the configuration.\n"
"*** Execute 'make' to start the build or try 'make help'."
"\n\n"));
res = 0;
break;
default:
fprintf(stderr, _("\n\n"
"Your configuration changes were NOT saved."
"\n\n"));
if (res != KEY_ESC)
res = 0;
}
return res;
}
开发者ID:adis1313,项目名称:android_kernel_samsung_msm8974,代码行数:42,代码来源:mconf.c
示例20: conf_save
static void conf_save(void)
{
while (1) {
switch (dialog_inputbox(NULL, save_config_text, 11, 55,
filename)) {
case 0:
if (!dialog_input_result[0])
return;
if (!conf_write(dialog_input_result))
return;
show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60);
break;
case 1:
show_helptext("Save Alternate Configuration", save_config_help);
break;
case 255:
return;
}
}
}
开发者ID:0919061,项目名称:PX4NuttX,代码行数:20,代码来源:mconf.c
注:本文中的conf_write函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论