Lines Matching refs:cf
117 grow_conf_file(conf_t *cf)
119 int ndsize = cf->cf_dsize ? cf->cf_dsize * CF_GROW : CF_DEFSIZE;
120 void *ndtab = realloc(cf->cf_dtab, sizeof (char *) * ndsize);
130 lines = ndsize - cf->cf_dsize;
131 odsize = cf->cf_dsize;
133 cf->cf_dtab = (char **)ndtab;
134 cf->cf_dsize = ndsize;
142 cf->cf_dtab[odsize + i] = p;
149 conf_open(conf_t *cf, const char *cmd, char *argv[])
155 (void) memset(cf, 0, sizeof (conf_t));
163 if (cf->cf_lines >= cf->cf_dsize) {
164 if (grow_conf_file(cf) == -1)
168 line = cf->cf_dtab[cf->cf_lines];
180 cf->cf_lines++;
192 conf_rewind(conf_t *cf)
194 cf->cf_ptr = 0;
198 conf_read(conf_t *cf)
200 if (cf->cf_ptr < cf->cf_lines)
201 return (cf->cf_dtab[cf->cf_ptr++]);
207 conf_close(conf_t *cf)
211 if (cf->cf_dtab != NULL) {
212 for (i = 0; i < cf->cf_dsize; i++)
213 free(cf->cf_dtab[i]);
214 free(cf->cf_dtab);