Lines Matching refs:psp
227 struct parse_state *psp; in close_service() local
234 psp = slp->sl_parse; in close_service()
235 cfile = psp->ps_cfile; in close_service()
341 psp->ps_csvc = &psp->ps_cfile->pf_global; in close_service()
365 struct parse_state *psp; in set_service() local
372 psp = slp->sl_parse; in set_service()
381 cfile = psp->ps_cfile; in set_service()
393 slp->sl_serial = psp->ps_serial++; in set_service()
394 slp->sl_parse = psp; in set_service()
397 psp->ps_csvc = slp; in set_service()
495 struct parse_state *psp; in set_file() local
516 psp = slp->sl_parse; in set_file()
517 pfp->pf_prev = psp->ps_cfile; in set_file()
518 psp->ps_cfile = pfp; in set_file()
521 psp->ps_csvc = &pfp->pf_global; in set_file()
522 pfp->pf_global.sl_parse = psp; in set_file()
533 struct parse_state *psp = slp->sl_parse; in set_device() local
541 if (psp->ps_flags & PSF_PERDEV) { in set_device()
543 psp->ps_cfile->pf_name); in set_device()
550 slp->sl_dev = psp->ps_star; in set_device()
566 psp->ps_cfile->pf_name, len, cp); in set_device()
579 logdbg("%s: device %s", psp->ps_cfile->pf_name, in set_device()
604 struct parse_state *psp = slp->sl_parse; in set_client() local
657 psp->ps_cfile->pf_name, len, cp); in set_client()
666 fen->fe_isexcept = psp->ps_state == ksClientE; in set_client()
805 file_end(struct parse_state *psp) in file_end() argument
810 if (psp->ps_state != ksDefault) { in file_end()
811 logerr("%s ends with \"%s\"", psp->ps_cfile->pf_name, in file_end()
812 after_key(psp->ps_state)); in file_end()
813 psp->ps_state = ksDefault; in file_end()
815 close_service(psp->ps_csvc); in file_end()
816 if ((pfp = psp->ps_cfile) != NULL) { in file_end()
818 psp->ps_cfile = pfp->pf_prev; in file_end()
819 pfp->pf_prev = psp->ps_files; in file_end()
820 psp->ps_files = pfp; in file_end()
828 if ((pfp = psp->ps_cfile) != NULL) in file_end()
829 psp->ps_csvc = &pfp->pf_global; in file_end()
839 dispatch_keyword(struct parse_state *psp, const char *keybuf) in dispatch_keyword() argument
850 if (kep->kwe_in == psp->ps_state && in dispatch_keyword()
854 retv = (*kep->kwe_func)(psp->ps_csvc, keybuf); in dispatch_keyword()
855 psp->ps_state = kep->kwe_out; in dispatch_keyword()
865 if ((evlist = psp->ps_evlist) == NULL) { in dispatch_keyword()
866 psp->ps_evlist = evlist = in dispatch_keyword()
873 psp->ps_evsize = 8; in dispatch_keyword()
882 evlist-psp->ps_evlist >= psp->ps_evsize-1) { in dispatch_keyword()
883 evlist = (char **)realloc(psp->ps_evlist, in dispatch_keyword()
884 (psp->ps_evsize + 8) * sizeof (*evlist)); in dispatch_keyword()
887 psp->ps_evsize + 8); in dispatch_keyword()
891 psp->ps_evlist = evlist; in dispatch_keyword()
892 evlist += psp->ps_evsize - 1; in dispatch_keyword()
893 psp->ps_evsize += 8; in dispatch_keyword()
903 logerr("%s: unknown keyword '%s'", psp->ps_cfile->pf_name, keybuf); in dispatch_keyword()
914 my_getenv(struct parse_state *psp, char *estr) in my_getenv() argument
919 if (psp != NULL && (evlist = psp->ps_evlist) != NULL) { in my_getenv()
936 env_replace(struct parse_state *psp, char *keybuf, char kwstate) in env_replace() argument
942 if ((cpe = my_getenv(psp, cp + 1)) != NULL) { in env_replace()
984 getkeyword(struct parse_state *psp, char *keybuf, int keymax, in getkeyword() argument
1071 kbp = env_replace(psp, keybuf, kwstate); in getkeyword()
1085 kbp = env_replace(psp, keybuf, kwstate); in getkeyword()
1165 parse_from_file(struct parse_state *psp) in parse_from_file() argument
1170 while (psp->ps_cfile != NULL && psp->ps_cfile->pf_input != NULL) { in parse_from_file()
1171 retv = getkeyword(psp, keybuf, sizeof (keybuf), in parse_from_file()
1172 (int (*)(void *))fgetc, (void *)psp->ps_cfile->pf_input, in parse_from_file()
1176 (void) dispatch_keyword(psp, keybuf); in parse_from_file()
1179 file_end(psp); in parse_from_file()
1189 parse_file(struct parse_state *psp, const char *fname) in parse_file() argument
1196 if (set_file(psp->ps_csvc, fname) == 0) in parse_file()
1197 parse_from_file(psp); in parse_file()
1205 parse_arg_list(struct parse_state *psp, int argc, char **argv) in parse_arg_list() argument
1211 (void) dispatch_keyword(psp, *++argv); in parse_arg_list()
1212 if (psp->ps_cfile->pf_input != NULL) in parse_arg_list()
1213 parse_from_file(psp); in parse_arg_list()
1281 get_unique_devs(struct parse_state *psp) in get_unique_devs() argument
1292 ndevs = count_per_file(psp->ps_files); in get_unique_devs()
1293 ndevs += count_per_file(psp->ps_cfile); in get_unique_devs()
1304 dnp = per_file_to_list(psp->ps_files, dnames); in get_unique_devs()
1305 (void) per_file_to_list(psp->ps_cfile, dnp); in get_unique_devs()
1323 organize_state(struct parse_state *psp) in organize_state() argument
1342 close_service(psp->ps_csvc); in organize_state()
1343 psp->ps_csvc = NULL; in organize_state()
1344 if ((pfp = psp->ps_cfile) != NULL) { in organize_state()
1345 pfp->pf_prev = psp->ps_files; in organize_state()
1346 psp->ps_files = pfp; in organize_state()
1347 psp->ps_cfile = NULL; in organize_state()
1351 pftopp = psp->ps_files; in organize_state()
1367 for (slp = psp->ps_files->pf_svc; slp != NULL; slp = slp->sl_next) in organize_state()
1374 dnames = get_unique_devs(psp); in organize_state()
1398 osp->os_pfjunk = psp->ps_files; in organize_state()
1399 psp->ps_files = NULL; in organize_state()
1400 osp->os_evjunk = psp->ps_evlist; in organize_state()
1401 psp->ps_evlist = NULL; in organize_state()
1578 get_device_list(struct parse_state *psp, int tunfd) in get_device_list() argument
1590 dlpp = &psp->ps_star; in get_device_list()
1624 for (dlpp = &psp->ps_star; (dlp = *dlpp) != NULL; ) { in get_device_list()
1642 dlp->dl_next = psp->ps_star; in get_device_list()
1643 psp->ps_star = dlp; in get_device_list()