Remove CVS Id tags.
[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 #define VERSION "0.2.1"
13 #define CONFIGFILE "/home/noodles/projects/onak/onak.conf"
14
15 /*
16  *      struct onak_config - Runtime configuration for onak.
17  *      @maxkeys: The maximum number of keys a query should return.
18  *      @thissite: Our email address that servers sync with.
19  *      @adminemail: The email address of the server admin.
20  *      @mta: The mta to invoke to send sync mails.
21  *      @syncsites: A linked list of sites we sync with.
22  *
23  *      @db_dir: The path to the directory containing the database files.
24  * 
25  *      @pg_dbhost: The host that Postgres is running on.
26  *      @pg_dbname: The database name.
27  *      @pg_dbuser: The user we should connect as.
28  *      @pg_dbpass: The password for the user.
29  *
30  *      This structure holds various runtime configuration options for onak. It
31  *      will eventually be populated from the config file.
32  */
33 struct onak_config {
34         /*
35          * Generic options.
36          */
37         int maxkeys;
38         char *thissite;
39         char *adminemail;
40         char *mta;
41         struct ll *syncsites;
42         char *logfile;
43
44         /*
45          * Options for any database backend that needs a directory, be it the
46          * file, db2 or db3 options.
47          */
48         char *db_dir;
49         
50         /*
51          * Options for the Postgres backend.
52          */
53         char *pg_dbhost;
54         char *pg_dbname;
55         char *pg_dbuser;
56         char *pg_dbpass;
57 };
58
59 /*
60  *      config - The variable containing our runtime config.
61  */
62 extern struct onak_config config;
63
64 /*
65  *      readconfig - read the onak config.
66  *      @configfile - the config file to read.
67  *
68  *      Read in our config file. If config file is NULL read in the compile
69  *      time default.
70  */
71 void readconfig(const char *configfile);
72
73 /*
74  *      cleanupconfig - clean up the config when we're shutting down.
75  */
76 void cleanupconfig(void);
77
78 #endif /* __ONAK_CONF_H_ */