Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 57a94fd8eb9a4a6b0138af61a0f7b529 > files > 44

dotconf-examples-1.0.13-2mdv2008.1.x86_64.rpm

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

/* lets get access to the current line inside of the config.file */
/* this only resolves if the executable was link with the -rdynamic flag! */

static DOTCONF_CB(cb_newoption)
{
	printf("[MODULE] Line %ld: NewOption: %s\n",
			cmd->configfile->line, cmd->data.str);
  return NULL;
}

/* example.c loads the symbol 'new_options' */
const configoption_t new_options[] =
{
  {  "NewOption", ARG_STR,  cb_newoption, 0, 0},
  LAST_OPTION
};