Lines Matching defs:rcp

48 static struct rcsection *rc_findsect(struct rcfile *rcp,
50 static struct rcsection *rc_addsect(struct rcfile *rcp,
58 static void rc_parse(struct rcfile *rcp);
68 struct rcfile *rcp;
70 rcp = rc_find(filename);
71 if (rcp) {
72 *rcfile = rcp;
78 rcp = malloc(sizeof(struct rcfile));
79 if (rcp == NULL) {
83 bzero(rcp, sizeof(struct rcfile));
84 rcp->rf_name = strdup(filename);
85 rcp->rf_f = f;
86 SLIST_INSERT_HEAD(&pf_head, rcp, rf_next);
87 rc_parse(rcp);
88 *rcfile = rcp;
93 rc_close(struct rcfile *rcp)
97 fclose(rcp->rf_f);
98 for (p = SLIST_FIRST(&rcp->rf_sect); p; ) {
103 free(rcp->rf_name);
104 SLIST_REMOVE(&pf_head, rcp, rcfile, rf_next);
105 free(rcp);
122 rc_findsect(struct rcfile *rcp, const char *sectname, int sect_id)
126 SLIST_FOREACH(p, &rcp->rf_sect, rs_next)
133 rc_addsect(struct rcfile *rcp, const char *sectname)
137 p = rc_findsect(rcp, sectname, 0);
145 p = rc_findsect(rcp, sectname, id);
154 SLIST_INSERT_HEAD(&rcp->rf_sect, p, rs_next);
213 rc_parse(struct rcfile *rcp)
215 FILE *f = rcp->rf_f;
251 rsp = rc_addsect(rcp, buf);
283 "'%s'\n",rcp->rf_name);
302 rc_getstringptr(struct rcfile *rcp, const char *section, int sect_id,
309 rsp = rc_findsect(rcp, section, sect_id);
320 rc_getstring(struct rcfile *rcp, const char *section, int sect_id,
326 error = rc_getstringptr(rcp, section, sect_id, key, &value);
339 rc_getint(struct rcfile *rcp, const char *section, int sect_id,
345 rsp = rc_findsect(rcp, section, sect_id);
366 rc_getbool(struct rcfile *rcp, const char *section, int sect_id,
373 rsp = rc_findsect(rcp, section, sect_id);
416 rc_getkeys(struct rcfile *rcp, const char *sectname, int sect_id)
423 rsp = rc_findsect(rcp, sectname, sect_id);