#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <locale.h>
int main(void)
{
static char *server = NULL;
static double delay = 1.356e-32;
static char *username = NULL;
static long int debug = 1;
};
#ifdef LC_MESSAGES
setlocale(LC_MESSAGES, "");
setlocale(LC_CTYPE, "");
#endif
server = strdup("gazonk");
printf("verbose: %s\n", verbose ? "true" : "false");
printf("server: %s\n", server);
printf("username: %s\n", username);
printf("debug: %ld\n", debug);
printf("delay: %G\n", delay);
printf("setting username to 'foo'\n");
printf("username: %s\n", username);
{
FILE *fp = fopen("simple.conf.out", "w");
fclose(fp);
}
free(server);
free(username);
return 0;
}
DLLIMPORT cfg_t *__export cfg_init(cfg_opt_t *opts, cfg_flag_t flags)
Create and initialize a cfg_t structure.
Definition: confuse.c:1816
#define CFG_SIMPLE_BOOL(name, svalue)
Initialize a "simple" boolean option (see documentation for CFG_SIMPLE_STR for more information).
Definition: confuse.h:511
#define CFG_SIMPLE_FLOAT(name, svalue)
Initialize a "simple" floating point option (see documentation for CFG_SIMPLE_STR for more informatio...
Definition: confuse.h:478
DLLIMPORT int __export cfg_setstr(cfg_t *cfg, const char *name, const char *value)
Set the value of a string option given its name.
Definition: confuse.c:2211
#define CFG_SIMPLE_STR(name, svalue)
Initialize a "simple" string option.
Definition: confuse.h:410
DLLIMPORT int __export cfg_print(cfg_t *cfg, FILE *fp)
Print the options and values to a file.
Definition: confuse.c:2548
DLLIMPORT int __export cfg_parse(cfg_t *cfg, const char *filename)
Parse a configuration file.
Definition: confuse.c:1746
#define CFG_SIMPLE_INT(name, svalue)
Initialize a "simple" integer option (see documentation for CFG_SIMPLE_STR for more information).
Definition: confuse.h:445