]> code.citadel.org Git - citadel.git/blobdiff - citadel/config.h
misc cleanup
[citadel.git] / citadel / config.h
index 79f24427439249371bf2d8650b2787180bb77b7c..23f144a482ba4eb4c147a998070e35ce5a71e43f 100644 (file)
@@ -1,54 +1,45 @@
-/*
- * Copyright (c) 1987-2015 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
+// Copyright (c) 1987-2016 by the citadel.org team
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 3.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
 
 #include "serv_extensions.h"
 #include "citadel_dirs.h"
 
-#define CtdlGetConfigInt(x)    atoi(CtdlGetConfigStr(x))
-#define CtdlGetConfigLong(x)   atol(CtdlGetConfigStr(x))
-
-
-
-
-/*
- * This is the format of the legacy config file.  Do not attempt to do anything with it other
- * than migrate it into the new format. 
- */
+// This is the format of the legacy config file.  Do not attempt to do anything with it other
+// than migrate it into the new format.  Seriously -- DO NOT CHANGE IT.  The only purpose of this
+// struct is to represent the OLD configuration format.
 struct legacy_config {
-       char c_nodename[16];            /* short name of this node on a Citadel network */
-       char c_fqdn[64];                /* this site's fully qualified domain name */
-       char c_humannode[21];           /* human-readable site name */
+       char c_nodename[16];            // short name of this node on a Citadel network
+       char c_fqdn[64];                // this site's fully qualified domain name
+       char c_humannode[21];           // human-readable site name
        char c_niu_7[16];
        uid_t c_niu_6;
-       char c_creataide;               /* 1 = creating a room auto-grants room aide privileges */
-       int c_sleeping;                 /* watchdog timer (seconds) */
-       char c_initax;                  /* initial access level for new users */
-       char c_regiscall;               /* after c_regiscall logins user will be asked to register */
-       char c_twitdetect;              /* automatically move messages from problem users to trashcan */
-       char c_twitroom[ROOMNAMELEN];   /* name of trashcan */
-       char c_moreprompt[80];          /* paginator prompt */
-       char c_restrict;                /* require per-user permission to send Internet mail */
+       char c_creataide;               // 1 = creating a room auto-grants room aide privileges
+       int c_sleeping;                 // watchdog timer (seconds)
+       char c_initax;                  // initial access level for new users
+       char c_regiscall;               // after c_regiscall logins user will be asked to register
+       char c_twitdetect;              // automatically move messages from problem users to trashcan
+       char c_twitroom[ROOMNAMELEN];   // name of trashcan
+       char c_moreprompt[80];          // paginator prompt
+       char c_restrict;                // require per-user permission to send Internet mail
        long c_niu_1;
-       char c_site_location[32];       /* geographic location of this Citadel site */
-       char c_sysadm[26];              /* name of system administrator */
+       char c_site_location[32];       // geographic location of this Citadel site
+       char c_sysadm[26];              // name of system administrator
        char c_niu_2[15];
        int c_niu_3;
-       int c_maxsessions;              /* maximum number of concurrent sessions allowed */
-       char c_ip_addr[20];             /* bind address for listening sockets */
-       int c_port_number;              /* port number for Citadel protocol (usually 504) */
+       int c_maxsessions;              // maximum number of concurrent sessions allowed
+       char c_ip_addr[20];             // bind address for listening sockets
+       int c_port_number;              // port number for Citadel protocol (usually 504)
        int c_niu_4;
-       struct ExpirePolicy c_ep;       /* default expire policy for the entire site */
-       int c_userpurge;                /* user purge time (in days) */
-       int c_roompurge;                /* room purge time (in days) */
+       struct ExpirePolicy c_ep;       // default expire policy for the entire site
+       int c_userpurge;                // user purge time (in days)
+       int c_roompurge;                // room purge time (in days)
        char c_logpages[ROOMNAMELEN];
        char c_createax;
        long c_maxmsglen;
@@ -83,12 +74,12 @@ struct legacy_config {
        char c_journal_dest[128];
        char c_default_cal_zone[128];
        int c_pftcpdict_port;
-       int c_managesieve_port;
+       int c_niu_9;
        int c_auth_mode;
-       char c_funambol_host[256];
-       int c_funambol_port;
-       char c_funambol_source[256];
-       char c_funambol_auth[256];
+       char c_niu_8[256];
+       int c_niu_10;
+       char c_niu_11[256];
+       char c_niu_12[256];
        char c_rbl_at_greeting;
        char c_master_user[32];
        char c_master_pass[32];
@@ -105,16 +96,18 @@ struct legacy_config {
 };
 
 
-
-
 void initialize_config_system(void);
 void shutdown_config_system(void);
 void put_config(void);
 void CtdlSetConfigStr(char *, char *);
 char *CtdlGetConfigStr(char *);
+int CtdlGetConfigInt(char *);
+long CtdlGetConfigLong(char *);
 void CtdlSetConfigInt(char *key, int value);
 void CtdlSetConfigLong(char *key, long value);
+void CtdlDelConfig(char *key);
 
 char *CtdlGetSysConfig(char *sysconfname);
 void CtdlPutSysConfig(char *sysconfname, char *sysconfdata);
 void validate_config(void);
+void netcfg_keyname(char *, long);