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