00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __CONF_H
00018
#define __CONF_H
00019
00020
00021
00032
00033
00037 typedef struct
00038
{
00039 char *name;
00040 GiDataset *keys;
00041 }
ConfigHeader;
00042
00047 typedef struct
00048
{
00049 char *path;
00050 FILE *file;
00051 time_t mtime;
00054 int comments;
00055 GiList *headers;
00056 ConfigHeader *confhdr;
00057 }
Config;
00058
00059
00060
00061 EXTERN_C_BEGIN
00062
00063
00064
00072 LIBGIFT_EXPORT
00073
Config *config_new (
char *file);
00074
00084 LIBGIFT_EXPORT
00085
Config *config_new_ex (
char *file,
int comments_allowed);
00086
00092 LIBGIFT_EXPORT
00093
void config_free (
Config *conf);
00094
00101 LIBGIFT_EXPORT
00102
void config_write (
Config *conf);
00103
00111 LIBGIFT_EXPORT
00112
void config_set_str (
Config *conf,
char *keypath,
char *value);
00113
00119 LIBGIFT_EXPORT
00120
void config_set_int (
Config *conf,
char *keypath,
int value);
00121
00140 LIBGIFT_EXPORT
00141
char *config_get_str (
Config *conf,
char *keypath);
00142
00148 LIBGIFT_EXPORT
00149
int config_get_int (
Config *conf,
char *keypath);
00150
00151
00152
00163 LIBGIFT_EXPORT
00164
Config *gift_config_new (
char *module);
00165
00180 LIBGIFT_EXPORT
00181
char *gift_conf_path (
const char *fmt, ...);
00182
00188 LIBGIFT_EXPORT
00189
char *gift_conf_path_r (
char *buf, size_t buf_size,
const char *fmt, ...);
00190
00207 LIBGIFT_EXPORT
00208
char *gift_conf_pathkey (
Config *conf,
char *key,
char *def,
char *file);
00209
00210
00211
00212 EXTERN_C_END
00213
00214
00215
00216
#endif