config.c ported to new system BROKEN BUILD ALERT
[citadel.git] / citadel / config.h
1 /*
2  * Copyright (c) 1987-2015 by the citadel.org team
3  *
4  * This program is open source software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 3.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  */
12
13 #include "serv_extensions.h"
14 #include "citadel_dirs.h"
15
16 #define CtdlGetConfigInt(x)     atoi(CtdlGetConfigStr(x))
17 #define CtdlGetConfigLong(x)    atol(CtdlGetConfigStr(x))
18
19
20
21
22 /*
23  * This is the format of the legacy config file.  Do not attempt to do anything with it other
24  * than migrate it into the new format. 
25  */
26 struct legacy_config {
27         char c_nodename[16];            /* short name of this node on a Citadel network */
28         char c_fqdn[64];                /* this site's fully qualified domain name */
29         char c_humannode[21];           /* human-readable site name */
30         char c_niu_7[16];
31         uid_t c_niu_6;
32         char c_creataide;               /* 1 = creating a room auto-grants room aide privileges */
33         int c_sleeping;                 /* watchdog timer (seconds) */
34         char c_initax;                  /* initial access level for new users */
35         char c_regiscall;               /* after c_regiscall logins user will be asked to register */
36         char c_twitdetect;              /* automatically move messages from problem users to trashcan */
37         char c_twitroom[ROOMNAMELEN];   /* name of trashcan */
38         char c_moreprompt[80];          /* paginator prompt */
39         char c_restrict;                /* require per-user permission to send Internet mail */
40         long c_niu_1;
41         char c_site_location[32];       /* geographic location of this Citadel site */
42         char c_sysadm[26];              /* name of system administrator */
43         char c_niu_2[15];
44         int c_niu_3;
45         int c_maxsessions;              /* maximum number of concurrent sessions allowed */
46         char c_ip_addr[20];             /* bind address for listening sockets */
47         int c_port_number;              /* port number for Citadel protocol (usually 504) */
48         int c_niu_4;
49         struct ExpirePolicy c_ep;       /* default expire policy for the entire site */
50         int c_userpurge;                /* user purge time (in days) */
51         int c_roompurge;                /* room purge time (in days) */
52         char c_logpages[ROOMNAMELEN];
53         char c_createax;
54         long c_maxmsglen;
55         int c_min_workers;
56         int c_max_workers;
57         int c_pop3_port;
58         int c_smtp_port;
59         int c_rfc822_strict_from;
60         int c_aide_zap;
61         int c_imap_port;
62         time_t c_net_freq;
63         char c_disable_newu;
64         char c_enable_fulltext;
65         char c_baseroom[ROOMNAMELEN];
66         char c_aideroom[ROOMNAMELEN];
67         int c_purge_hour;
68         struct ExpirePolicy c_mbxep;
69         char c_ldap_host[128];
70         int c_ldap_port;
71         char c_ldap_base_dn[256];
72         char c_ldap_bind_dn[256];
73         char c_ldap_bind_pw[256];
74         int c_msa_port;
75         int c_imaps_port;
76         int c_pop3s_port;
77         int c_smtps_port;
78         char c_auto_cull;
79         char c_niu_5;
80         char c_allow_spoofing;
81         char c_journal_email;
82         char c_journal_pubmsgs;
83         char c_journal_dest[128];
84         char c_default_cal_zone[128];
85         int c_pftcpdict_port;
86         int c_managesieve_port;
87         int c_auth_mode;
88         char c_funambol_host[256];
89         int c_funambol_port;
90         char c_funambol_source[256];
91         char c_funambol_auth[256];
92         char c_rbl_at_greeting;
93         char c_master_user[32];
94         char c_master_pass[32];
95         char c_pager_program[256];
96         char c_imap_keep_from;
97         int c_xmpp_c2s_port;
98         int c_xmpp_s2s_port;
99         time_t c_pop3_fetch;
100         time_t c_pop3_fastest;
101         int c_spam_flag_only;
102         int c_guest_logins;
103         int c_nntp_port;
104         int c_nntps_port;
105 };
106
107
108
109
110 void initialize_config_system(void);
111 void shutdown_config_system(void);
112 void put_config(void);
113 void CtdlSetConfigStr(char *, char *);
114 char *CtdlGetConfigStr(char *);
115 void CtdlSetConfigInt(char *key, int value);
116 void CtdlSetConfigLong(char *key, long value);
117
118 char *CtdlGetSysConfig(char *sysconfname);
119 void CtdlPutSysConfig(char *sysconfname, char *sysconfdata);
120 void validate_config(void);