Example #1
0
static
int process_line(struct cmconf *conf, struct cmconf_line *line,
		 struct cmconf_option *options)
{
	char *linestr, *p;
	char **args;
	int result;

	if (!(linestr = strdup(line->line))) {
		errno = ENOMEM;
		return -1;
	}
	if ((p = strchr(linestr, '#')))
		*p = 0;		/* Remove comments */

	if (!(args = getargs(linestr))) {	/* Scan the line into arguments. */
		free(linestr);
		errno = ENOMEM;
		return -1;
	}
	result = cmconf_process_args(conf, args, options);
	free(linestr);
	free(args);
	return result;
}
Example #2
0
static
int nodeup_callback(struct cmconf *conf, char **args) {
    return cmconf_process_args(conf, args+1, nodeup_configopts);
}