Lines Matching refs:cf
115 grow_conf_file(conf_t *cf) in grow_conf_file() argument
117 int ndsize = cf->cf_dsize ? cf->cf_dsize * CF_GROW : CF_DEFSIZE; in grow_conf_file()
118 void *ndtab = realloc(cf->cf_dtab, sizeof (char *) * ndsize); in grow_conf_file()
128 lines = ndsize - cf->cf_dsize; in grow_conf_file()
129 odsize = cf->cf_dsize; in grow_conf_file()
131 cf->cf_dtab = (char **)ndtab; in grow_conf_file()
132 cf->cf_dsize = ndsize; in grow_conf_file()
140 cf->cf_dtab[odsize + i] = p; in grow_conf_file()
147 conf_open(conf_t *cf, const char *cmd, char *argv[]) in conf_open() argument
153 (void) memset(cf, 0, sizeof (conf_t)); in conf_open()
161 if (cf->cf_lines >= cf->cf_dsize) { in conf_open()
162 if (grow_conf_file(cf) == -1) in conf_open()
166 line = cf->cf_dtab[cf->cf_lines]; in conf_open()
178 cf->cf_lines++; in conf_open()
190 conf_rewind(conf_t *cf) in conf_rewind() argument
192 cf->cf_ptr = 0; in conf_rewind()
196 conf_read(conf_t *cf) in conf_read() argument
198 if (cf->cf_ptr < cf->cf_lines) in conf_read()
199 return (cf->cf_dtab[cf->cf_ptr++]); in conf_read()
205 conf_close(conf_t *cf) in conf_close() argument
209 if (cf->cf_dtab != NULL) { in conf_close()
210 for (i = 0; i < cf->cf_dsize; i++) in conf_close()
211 free(cf->cf_dtab[i]); in conf_close()
212 free(cf->cf_dtab); in conf_close()