taskrambler  v0.1.8
Web server and task management solution.
configtest.c File Reference
#include <stdio.h>
#include "class.h"
#include "commons.h"
#include "config/config.h"
#include "config/value.h"
#include "utils/memory.h"
+ Include dependency graph for configtest.c:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 10 of file configtest.c.

References config, CONFIG_VALUE_NUMERIC, CONFIG_VALUE_STRING, configGet(), CSTRA, and memCleanup().

11 {
12  Config config = new(Config, "./testconfig.cfg");
13  ConfigValue val;
14 
15  val = configGet(config, CSTRA("dummy"));
16 
17  if (NULL != val) {
18  switch (val->type) {
20  printf(
21  "Value for dummy: (STRING): %s\n",
22  (val->value).string);
23  break;
24 
26  printf(
27  "Value for dummy: (NUMERIC): %lld\n",
28  (val->value).number);
29  break;
30 
31  default:
32  printf("Invalid config...that should never happen\n");
33  }
34  }
35 
36  delete(config);
37  memCleanup();
38 
39  return 0;
40 }
ConfigValue configGet(Config, const char *, size_t)
Definition: config/get.c:31
#define CSTRA(val)
Const STRing Argument.
Definition: memory.h:26
Config config
Definition: taskrambler.c:67
void memCleanup()
Definition: memory.c:862

+ Here is the call graph for this function: