Remove unused variables
[onak.git] / onak-conf.h
1 /*
2  * onak-conf.h - Routines related to runtime config.
3  *
4  * Jonathan McDowell <noodles@earth.li>
5  *
6  * Copyright 2002 Project Purple
7  */
8
9 #ifndef __ONAK_CONF_H_
10 #define __ONAK_CONF_H_
11
12 #include "keydb.h"
13
14 /*
15  *      struct onak_config - Runtime configuration for onak.
16  *      @maxkeys: The maximum number of keys a query should return.
17  *      @thissite: Our email address that servers sync with.
18  *      @adminemail: The email address of the server admin.
19  *      @mta: The mta to invoke to send sync mails.
20  *      @syncsites: A linked list of sites we sync with.
21  *
22  *      @db_dir: The path to the directory containing the database files.
23  * 
24  *      @pg_dbhost: The host that Postgres is running on.
25  *      @pg_dbname: The database name.
26  *      @pg_dbuser: The user we should connect as.
27  *      @pg_dbpass: The password for the user.
28  *
29  *      This structure holds various runtime configuration options for onak. It
30  *      will eventually be populated from the config file.
31  */
32 struct onak_config {
33         /*
34          * Generic options.
35          */
36         int maxkeys;
37         char *thissite;
38         char *adminemail;
39         char *mta;
40         struct ll *syncsites;
41         char *logfile;
42
43         /*
44          * Set if we're using keyd as the backend.
45          */
46         bool use_keyd;
47
48         /*
49          * Options for any database backend that needs a directory, be it the
50          * file, db2 or db3 options.
51          */
52         char *db_dir;
53         
54         /*
55          * Options for the Postgres backend.
56          */
57         char *pg_dbhost;
58         char *pg_dbname;
59         char *pg_dbuser;
60         char *pg_dbpass;
61
62         /*
63          * Options for the dynamic backend.
64          */
65         char *db_backend;
66         char *backends_dir;
67
68         struct dbfuncs *dbbackend;
69 };
70
71 /*
72  *      config - The variable containing our runtime config.
73  */
74 extern struct onak_config config;
75
76 /*
77  *      readconfig - read the onak config.
78  *      @configfile - the config file to read.
79  *
80  *      Read in our config file. If config file is NULL read in the compile
81  *      time default.
82  */
83 void readconfig(const char *configfile);
84
85 /*
86  *      cleanupconfig - clean up the config when we're shutting down.
87  */
88 void cleanupconfig(void);
89
90 #endif /* __ONAK_CONF_H_ */