MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ReadFile

Function ReadFile

tools/ngctl/main.c:247–262  ·  view source on GitHub ↗

* Process commands from a file */

Source from the content-addressed store, hash-verified

245 * Process commands from a file
246 */
247static int
248ReadFile(FILE *fp)
249{
250 char line[LINE_MAX];
251 int num, rtn;
252
253 for (num = 1; fgets(line, sizeof(line), fp) != NULL; num++) {
254 if (*line == '#')
255 continue;
256 if ((rtn = DoParseCommand(line)) != 0) {
257 warnx("line %d: error in file", num);
258 return (rtn);
259 }
260 }
261 return (CMDRTN_OK);
262}
263
264#ifdef EDITLINE
265#ifndef FSTACK

Callers 4

main.cFile · 0.85
ReadCmdFunction · 0.85
ngx_read_fileFunction · 0.85
ngx_read_fdFunction · 0.85

Calls 1

DoParseCommandFunction · 0.85

Tested by

no test coverage detected