cscvs to tla changeset 33
[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.1.0"
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
43         /*
44          * Options for any database backend that needs a directory, be it the
45          * file, db2 or db3 options.
46          */
47         char *db_dir;
48         
49         /*
50          * Options for the Postgres backend.
51          */
52         char *pg_dbhost;
53         char *pg_dbname;
54         char *pg_dbuser;
55         char *pg_dbpass;
56 };
57
58 /*
59  *      config - The variable containing our runtime config.
60  */
61 extern struct onak_config config;
62
63 /*
64  *      readconfig - read the onak config.
65  */
66 void readconfig(void);
67
68 #endif /* __ONAK_CONF_H_ */