]> git.evergreen-ils.org Git - Evergreen.git/blob - OpenSRF/src/libstack/osrf_config.h
c6bb5a3f7d8ce585d83463e6da4ab6e50ab89c8b
[Evergreen.git] / OpenSRF / src / libstack / osrf_config.h
1 #include <stdio.h>
2
3 #include <string.h>
4 #include <unistd.h>
5 #include <stdlib.h>
6 #include <time.h>
7
8 #include "logging.h"
9 #include "utils.h"
10
11 /* libxml stuff for the config reader */
12 #include <libxml/xmlmemory.h>
13 #include <libxml/parser.h>
14 #include <libxml/xpath.h>
15 //#include <libxml/xpathInternals.h>
16 #include <libxml/tree.h>
17
18 #include "utils.h"
19
20 #ifndef GENERIC_UTILS_H
21 #define GENERIC_UTILS_H
22
23 #define equals(a,b) !strcmp(a,b) 
24
25 // ---------------------------------------------------------------------------------
26 // Config file module
27 // ---------------------------------------------------------------------------------
28 struct config_reader_struct {
29         xmlDocPtr config_doc;
30         xmlXPathContextPtr xpathCx;
31         char* name;
32         struct config_reader_struct* next;
33 };
34 typedef struct config_reader_struct config_reader;
35 config_reader* conf_reader;
36
37 //void config_reader_init( char* config_file );
38 void config_reader_init( char* name, char* config_file );
39
40 void config_reader_free();
41
42 // allocastes a char*. FREE me.
43 char* config_value( const char* config_name, const char* xp_query, ... );
44
45
46 char* osrf_config_value(char* path);
47 void _osrf_config_grab_config();
48
49 #endif
50