Lines Matching refs:rcp

65 static struct rcsection *rc_findsect(struct rcfile *rcp, const char *sectname);
66 static struct rcsection *rc_addsect(struct rcfile *rcp, const char *sectname);
67 static int rc_freesect(struct rcfile *rcp, struct rcsection *rsp);
72 static void rc_parse(struct rcfile *rcp);
90 struct rcfile *rcp; in rc_open() local
95 rcp = rc_cachelookup(filename); in rc_open()
96 if (rcp) { in rc_open()
97 *rcfile = rcp; in rc_open()
107 rcp = malloc(sizeof (struct rcfile)); in rc_open()
108 if (rcp == NULL) { in rc_open()
112 bzero(rcp, sizeof (struct rcfile)); in rc_open()
113 rcp->rf_name = strdup(filename); in rc_open()
114 rcp->rf_f = f; in rc_open()
115 SLIST_INSERT_HEAD(&pf_head, rcp, rf_next); in rc_open()
116 rc_parse(rcp); in rc_open()
117 *rcfile = rcp; in rc_open()
125 struct rcfile *rcp = *rcfile; in rc_merge() local
131 if (rcp == NULL) { in rc_merge()
141 t = rcp->rf_f; in rc_merge()
142 rcp->rf_f = f; in rc_merge()
143 rc_parse(rcp); in rc_merge()
144 rcp->rf_f = t; in rc_merge()
156 struct rcfile *rcp; in rc_popen_cmd() local
166 rcp = malloc(sizeof (struct rcfile)); in rc_popen_cmd()
167 if (rcp == NULL) { in rc_popen_cmd()
171 bzero(rcp, sizeof (struct rcfile)); in rc_popen_cmd()
172 rcp->rf_name = strdup(command); in rc_popen_cmd()
173 rcp->rf_f = f; in rc_popen_cmd()
174 SLIST_INSERT_HEAD(&pf_head, rcp, rf_next); in rc_popen_cmd()
175 rc_parse(rcp); in rc_popen_cmd()
176 *rcfile = rcp; in rc_popen_cmd()
182 rc_close(struct rcfile *rcp) in rc_close() argument
188 fclose(rcp->rf_f); in rc_close()
189 for (p = SLIST_FIRST(&rcp->rf_sect); p; ) { in rc_close()
192 rc_freesect(rcp, n); in rc_close()
194 free(rcp->rf_name); in rc_close()
195 SLIST_REMOVE(&pf_head, rcp, rcfile, rf_next); in rc_close()
196 free(rcp); in rc_close()
216 rc_findsect(struct rcfile *rcp, const char *sectname) in rc_findsect() argument
222 SLIST_FOREACH(p, &rcp->rf_sect, rs_next) in rc_findsect()
229 rc_addsect(struct rcfile *rcp, const char *sectname) in rc_addsect() argument
235 p = rc_findsect(rcp, sectname); in rc_addsect()
243 SLIST_INSERT_HEAD(&rcp->rf_sect, p, rs_next); in rc_addsect()
248 rc_freesect(struct rcfile *rcp, struct rcsection *rsp) in rc_freesect() argument
254 SLIST_REMOVE(&rcp->rf_sect, rsp, rcsection, rs_next); in rc_freesect()
341 set_value(struct rcfile *rcp, struct rcsection *rsp, struct rckey *rkp, in set_value() argument
382 rc_parse(struct rcfile *rcp) in rc_parse() argument
384 FILE *f = rcp->rf_f; in rc_parse()
423 rsp = rc_addsect(rcp, buf); in rc_parse()
477 "Well, I can't parse file '%s'\n"), rcp->rf_name); in rc_parse()
485 set_value(rcp, rsp, rkp, buf); in rc_parse()
491 set_value(rcp, rsp, rkp, buf); in rc_parse()
496 rc_getstringptr(struct rcfile *rcp, const char *section, const char *key, in rc_getstringptr() argument
506 rsp = rc_findsect(rcp, section); in rc_getstringptr()
525 rc_getstring(struct rcfile *rcp, const char *section, const char *key, in rc_getstring() argument
531 error = rc_getstringptr(rcp, section, key, &value); in rc_getstring()
545 rc_getint(struct rcfile *rcp, const char *section, const char *key, int *value) in rc_getint() argument
553 rsp = rc_findsect(rcp, section); in rc_getint()
581 rc_getbool(struct rcfile *rcp, const char *section, const char *key, int *value) in rc_getbool() argument
590 rsp = rc_findsect(rcp, section); in rc_getbool()
712 struct rcfile *rcp; in smb_close_rcfile() local
714 if ((rcp = smb_rc) != NULL) { in smb_close_rcfile()
716 rc_close(rcp); in smb_close_rcfile()