summaryrefslogtreecommitdiff
path: root/src/bin/iniparse.c
blob: 05cf5f67db12ee53d70de0f075679c7373b4155f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <strdict.h>
#include <config_file.h>

int main() {
  pxConfigFile* cf = px_config_file_new("test.d/test_libproxy_config_file.conf");
  if (!cf) {
    printf("Could not find conf file.\n.");
    return 1;
  }
  char* val1 = px_config_file_get_value(cf, "SECTION", "inikey1");
  char* val2 = px_config_file_get_value(cf, "SECTION", "inikey2");
  printf("val1 -> '%s' / val2 -> '%s'\n", val1 == NULL ? "NULL" : val1, val2 == NULL ? "NULL" : val2);
  px_config_file_free(cf);
  return 0;
}