MCPcopy Create free account
hub / github.com/ioi/isolate / cf_parse

Function cf_parse

config.c:206–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void
207cf_parse(void)
208{
209 FILE *f = fopen(CONFIG_FILE, "r");
210 if (!f)
211 die("Cannot open %s: %m", CONFIG_FILE);
212
213 char line[MAX_LINE_LEN];
214 while (fgets(line, sizeof(line), f))
215 {
216 line_number++;
217 char *nl = strchr(line, '\n');
218 if (!nl)
219 cf_err("Line not terminated or too long");
220 *nl = 0;
221
222 if (!line[0] || line[0] == '#')
223 continue;
224
225 char *s = line;
226 while (*s && *s != ' ' && *s != '\t' && *s != '=')
227 s++;
228 while (*s == ' ' || *s == '\t')
229 *s++ = 0;
230 if (*s != '=')
231 cf_err("Syntax error, expecting key=value");
232 *s++ = 0;
233 while (*s == ' ' || *s == '\t')
234 *s++ = 0;
235
236 cf_entry(line, s);
237 }
238
239 fclose(f);
240 cf_find_ids();
241 cf_check();
242}
243
244struct cf_per_box *
245cf_per_box(int box_id)

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 4

cf_errFunction · 0.85
cf_entryFunction · 0.85
cf_find_idsFunction · 0.85
cf_checkFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…