Lines Matching refs:options
274 const struct mg_option *options; in show_usage_and_exit() local
299 options = mg_get_valid_options(); in show_usage_and_exit()
300 for (i = 0; options[i].name != NULL; i++) { in show_usage_and_exit()
303 options[i].name, in show_usage_and_exit()
304 ((options[i].default_value == NULL) in show_usage_and_exit()
306 : options[i].default_value)); in show_usage_and_exit()
309 options = main_config_options; in show_usage_and_exit()
310 for (i = 0; options[i].name != NULL; i++) { in show_usage_and_exit()
313 options[i].name, in show_usage_and_exit()
314 ((options[i].default_value == NULL) in show_usage_and_exit()
316 : options[i].default_value)); in show_usage_and_exit()
368 const struct mg_option *options; in create_config_file() local
378 options = mg_get_valid_options(); in create_config_file()
379 for (i = 0; options[i].name != NULL; i++) { in create_config_file()
380 value = mg_get_option(ctx, options[i].name); in create_config_file()
383 options[i].name, in create_config_file()
541 get_option(char **options, const char *option_name) in get_option() argument
553 while (options[2 * i] != NULL) { in get_option()
554 if (strcmp(options[2 * i], option_name) == 0) { in get_option()
555 opt_value = options[2 * i + 1]; in get_option()
565 set_option(char **options, const char *name, const char *value) in set_option() argument
667 if (options[2 * i] == NULL) { in set_option()
669 options[2 * i] = sdup(name); in set_option()
670 options[2 * i + 1] = sdup(value); in set_option()
671 options[2 * i + 2] = NULL; in set_option()
673 } else if (!strcmp(options[2 * i], name)) { in set_option()
677 (char *)malloc(strlen(options[2 * i + 1]) in set_option()
682 sprintf(s, "%s%s%s", options[2 * i + 1], multi_sep, value); in set_option()
683 free(options[2 * i + 1]); in set_option()
684 options[2 * i + 1] = s; in set_option()
687 free(options[2 * i + 1]); in set_option()
688 options[2 * i + 1] = sdup(value); in set_option()
698 if (options[2 * i] == NULL) { in set_option()
701 if (options[2 * i + 1] == NULL) { in set_option()
711 read_config_file(const char *config_file, char **options) in read_config_file() argument
767 if (!set_option(options, p + i, p + j)) { in read_config_file()
783 process_command_line_arguments(int argc, char *argv[], char **options) in process_command_line_arguments() argument
836 if (0 == read_config_file(g_config_file_name, options)) { in process_command_line_arguments()
857 if (!set_option(options, &argv[i][1], argv[i + 1])) { in process_command_line_arguments()
939 verify_existence(char **options, const char *option_name, int must_be_dir) in verify_existence() argument
942 const char *path = get_option(options, option_name); in verify_existence()
973 set_absolute_path(char *options[], in set_absolute_path() argument
982 option_value = get_option(options, option_name); in set_absolute_path()
1006 set_option(options, option_name, absolute); in set_absolute_path()
1197 sanitize_options(char *options[] /* server options */, in sanitize_options() argument
1201 set_absolute_path(options, "document_root", arg0); in sanitize_options()
1202 set_absolute_path(options, "put_delete_auth_file", arg0); in sanitize_options()
1203 set_absolute_path(options, "cgi_interpreter", arg0); in sanitize_options()
1204 set_absolute_path(options, "access_log_file", arg0); in sanitize_options()
1205 set_absolute_path(options, "error_log_file", arg0); in sanitize_options()
1206 set_absolute_path(options, "global_auth_file", arg0); in sanitize_options()
1208 set_absolute_path(options, "lua_preload_file", arg0); in sanitize_options()
1210 set_absolute_path(options, "ssl_certificate", arg0); in sanitize_options()
1213 verify_existence(options, "document_root", 1); in sanitize_options()
1214 verify_existence(options, "cgi_interpreter", 0); in sanitize_options()
1215 verify_existence(options, "ssl_certificate", 0); in sanitize_options()
1216 verify_existence(options, "ssl_ca_path", 1); in sanitize_options()
1217 verify_existence(options, "ssl_ca_file", 0); in sanitize_options()
1219 verify_existence(options, "lua_preload_file", 0); in sanitize_options()
1228 char *options[2 * MAX_OPTIONS + 1]; in start_civetweb() local
1323 memset(options, 0, sizeof(options)); in start_civetweb()
1324 set_option(options, "document_root", "."); in start_civetweb()
1327 process_command_line_arguments(argc, argv, options); in start_civetweb()
1329 sanitize_options(options, argv[0]); in start_civetweb()
1337 for (i = 0; options[i] != NULL; i++) { in start_civetweb()
1338 if (strcmp(options[i], "daemonize") == 0) { in start_civetweb()
1339 if (options[i + 1] != NULL) { in start_civetweb()
1340 if (mg_strcasecmp(options[i + 1], "yes") == 0) { in start_civetweb()
1366 g_ctx = mg_start(&callbacks, &g_user_data, (const char **)options); in start_civetweb()
1370 for (i = 0; options[i] != NULL; i++) { in start_civetweb()
1371 free(options[i]); in start_civetweb()
1386 memset(options, 0, sizeof(options)); in start_civetweb()
1387 set_option(options, "document_root", "."); in start_civetweb()
1389 if (0 == read_config_file(g_add_domain[i], options)) { in start_civetweb()
1395 sanitize_options(options, argv[0]); in start_civetweb()
1397 j = mg_start_domain(g_ctx, (const char **)options); in start_civetweb()
1404 for (j = 0; options[j] != NULL; j++) { in start_civetweb()
1405 free(options[j]); in start_civetweb()
1527 const struct mg_option *options; in save_config() local
1531 options = mg_get_valid_options(); in save_config()
1532 for (i = 0; options[i].name != NULL; i++) { in save_config()
1534 if (options[i].type == MG_CONFIG_TYPE_BOOLEAN) { in save_config()
1544 options[i].default_value == NULL ? "" : options[i].default_value; in save_config()
1547 fprintf(fp, "%s %s\n", options[i].name, value); in save_config()
2171 const struct mg_option *options; in show_settings_dialog() local
2193 options = mg_get_valid_options(); in show_settings_dialog()
2194 for (i = 0; options[i].name != NULL; i++) { in show_settings_dialog()
2199 if (options[i].type == MG_CONFIG_TYPE_NUMBER) { in show_settings_dialog()
2203 } else if (options[i].type == MG_CONFIG_TYPE_BOOLEAN) { in show_settings_dialog()
2206 } else if ((options[i].type == MG_CONFIG_TYPE_FILE) in show_settings_dialog()
2207 || (options[i].type == MG_CONFIG_TYPE_DIRECTORY)) { in show_settings_dialog()
2221 } else if (options[i].type == MG_CONFIG_TYPE_STRING_MULTILINE) { in show_settings_dialog()
2239 options[i].name); in show_settings_dialog()