Lines Matching defs:p_config_file

176 static void new_section(config_file_t *p_config_file, aelist_t *p_list,
178 static void destroy_config(config_file_t *p_config_file);
181 static boolean_t fprint_config_file(config_file_t *p_config_file,
184 static section_t *find_section(config_file_t *p_config_file,
194 static boolean_t del_prefer(config_file_t *p_config_file, const char *prefer,
196 static boolean_t del_section(config_file_t *p_config_file, char *section_id);
197 static boolean_t set_prefer(config_file_t *p_config_file, const char *prefer,
199 static void add_to_history(config_file_t *p_config_file,
627 config_file_t *p_config_file;
629 p_config_file = safe_calloc(sizeof (config_file_t), 1);
630 p_config_file->section_argc = 0;
631 p_config_file->section_head = p_config_file->section_tail = NULL;
633 PRTDBG(("new_config_file() = 0x%x\n", p_config_file));
634 return (p_config_file);
639 * the config_file_t struct pointed by "p_config_file"
642 new_section(config_file_t *p_config_file, aelist_t *p_list,
647 PRTDBG(("new_section(0x%x, 0x%x, \"%s\")\n", p_config_file, p_list,
649 assert((p_config_file != NULL) && (p_list != NULL) &&
657 if (p_config_file->section_tail == NULL) {
658 p_config_file->section_head = p_section;
660 p_config_file->section_tail->section_next = p_section;
662 p_config_file->section_tail = p_section;
663 p_config_file->section_argc++;
670 destroy_config(config_file_t *p_config_file)
676 PRTDBG(("destory_config(0x%x)\n", p_config_file));
677 assert(p_config_file != NULL);
679 p_section = p_config_file->section_head;
699 free(p_config_file->section_head);
700 p_config_file->section_head = p_section;
702 free(p_config_file);
703 p_config_file = NULL;
777 config_file_t *p_config_file;
803 p_config_file = new_config_file();
814 new_section(p_config_file, prefer_list,
826 new_section(p_config_file, history_list,
838 new_section(p_config_file, activep_list,
850 new_section(p_config_file, profile_list,
881 PRTDBG(("parse_file(\"%s\")=0x%x\n", pfile, p_config_file));
883 return (p_config_file);
885 destroy_config(p_config_file);
924 fprint_config_file(config_file_t *p_config_file, const char *file_name)
935 PRTDBG(("fprint_config_file(0x%x, \"%s\")\n", p_config_file,
937 assert((p_config_file != NULL)&&(strcmp(file_name, "") != 0));
949 p_section = p_config_file->section_head;
1027 * find a section by section_id from p_config_file,
1031 find_section(config_file_t *p_config_file, const char *section_id)
1035 PRTDBG(("find_section(0x%x, \"%s\")\n", p_config_file, section_id));
1036 assert((section_id != NULL)&&(p_config_file != NULL));
1038 p_section = p_config_file->section_head;
1221 del_prefer(config_file_t *p_config_file, const char *prefer, boolean_t rflag)
1230 PRTDBG(("del_prefer(0x%x, \"%s\")\n", p_config_file, prefer));
1231 assert((prefer != NULL)&&(p_config_file != NULL));
1233 p_section = find_section(p_config_file, WIFI_PREFER);
1276 * del_section: Delete an section from p_config_file, the idea is
1282 del_section(config_file_t *p_config_file, char *section_id)
1290 PRTDBG(("del_section(0x%x, \"%s\")\n", p_config_file, section_id));
1292 p_config_file->section_argc));
1293 assert((section_id != NULL)&&(p_config_file != NULL));
1295 if (find_section(p_config_file, section_id) == NULL) {
1298 p_section = p_config_file->section_head;
1299 prm_section = p_config_file->section_head;
1318 p_config_file->section_head =
1321 p_config_file->section_tail =
1331 p_config_file->section_tail =
1335 p_config_file->section_argc--;
1349 set_prefer(config_file_t *p_config_file, const char *prefer, int rank)
1359 PRTDBG(("set_prefer(0x%x, \"%s\", %d)\n", p_config_file, prefer, rank));
1362 if (find_section(p_config_file, pbuf) == NULL) {
1371 p_section = find_section(p_config_file, WIFI_PREFER);
1375 new_section(p_config_file, plist, WIFI_PREFER);
1448 add_to_history(config_file_t *p_config_file, int argc, char **argv)
1458 PRTDBG(("add_to_history(0x%x, %d, 0x%x)\n", p_config_file, argc, argv));
1459 assert(p_config_file != NULL);
1461 p_section = find_section(p_config_file, WIFI_HISTORY);
1465 new_section(p_config_file, plist, WIFI_HISTORY);