Exemplo n.º 1
0
void
parse_conf_file(void)
{
	if (!is_nonempty_file(infilename))
		errx(1, "fatal: input file \"%s\" not found", infilename);

	parse_one_file(infilename);
	if (readcache && is_nonempty_file(cachename)) {
		reading_cache = 1;
		parse_one_file(cachename);
	}
}
Exemplo n.º 2
0
void 
parse_conf_file(void)
{
	if (!is_nonempty_file(infilename)) {
		fprintf(stderr, "%s: fatal: input file \"%s\" not found.\n",
		    progname, infilename);
		exit(1);
	}
	parse_one_file(infilename);
	if (readcache && is_nonempty_file(cachename)) {
		reading_cache = 1;
		parse_one_file(cachename);
	}
}
Exemplo n.º 3
0
Arquivo: conf.c Projeto: aissat/expac
static int parse_include(config_t *config, const char *include, char **section) {
  glob_t globbuf;
  int r = 0;

  if(glob(include, GLOB_NOCHECK, NULL, &globbuf) != 0) {
    fprintf(stderr, "warning: globbing failed on '%s': out of memory\n",
            include);
    return -ENOMEM;
  }

  for(size_t i = 0; i < globbuf.gl_pathc; ++i) {
    r = parse_one_file(config, globbuf.gl_pathv[i], section);
    if(r < 0) {
      break;
    }
  }

  globfree(&globbuf);
  return r;
}
Exemplo n.º 4
0
Arquivo: conf.c Projeto: aissat/expac
int config_parse(config_t *config, const char *filename)
{
  _cleanup_free_ char *section = NULL;

  return parse_one_file(config, filename, &section);
}