Sophie

Sophie

distrib > Mageia > 6 > i586 > by-pkgid > 93fffb7c747523ac28b3e7f27a67f835 > files > 8

dotconf-examples-1.3-6.mga6.noarch.rpm

#include <stdio.h>
#include <dotconf.h>

/*
	tabsize: 4
	shiftwidth: 4
*/

DOTCONF_CB(cb_argdouble);

static configoption_t options[] = {
	{"ArgDouble", ARG_DOUBLE, cb_argdouble, NULL, 0},
	LAST_OPTION
};

DOTCONF_CB(cb_argdouble)
{
	printf("[ArgDouble] %2.15g\n", cmd->data.dvalue);
	return NULL;
}

int main(int argc, char **argv)
{
	configfile_t *configfile;

	configfile = dotconf_create("argdouble.conf", options, 0, 0);
	if (dotconf_command_loop(configfile) == 0)
		fprintf(stderr, "Error reading config file\n");
	dotconf_cleanup(configfile);
	return 0;
}