blob: 450105bec1ac8e3097a5f4d976d2db22647cee1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* Copyright */
#ifndef ELAPI_INI_H
#define ELAPI_INI_H
#include "elapi_collection.h"
#define INI_DEFAULT_SECTION "default"
/* Read configuration ini file and create collection out of it */
int config_to_collection(char *application, /* Name of the application that will be used to get config for */
char *config_file, /* Name of the configuration file with default sessings for all apps */
char *config_dir, /* Name of the directory where the configuration files for different apps will be dropped */
struct collection_item **ini_config); /* New config object */
/* Function to get value from the config */
int get_value_from_config(void *value, /* Pointer to the memory that will point to the retrieved result.
* The memory will always be preallocated. */
int type, /* Expected type of the result */
char *section, /* Section to search in */
char *name, /* Value to look for */
struct collection_item *ini_config, /* Config handle */
int *found); /* Will update the provided location with 1 in the property was found. */
/* read ini file and create collection out of it factoring in the env variables */
/* int ini_to_collection_env(char *filename, struct collection_item **ini_config, char *ENV prefix); */
#endif
|