const!
[citadel.git] / citadel / include / ctdl_module.h
index 8a0f265ff8dba1b7198572bca6f3f2600d1fa752..a91308639cbfb4737662a3456d80e26e6cf13c8f 100644 (file)
 #include <errno.h>
 #include <syslog.h>
 #include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
+#include <time.h>
 #include <sys/wait.h>
 #include <string.h>
 #ifdef HAVE_STRINGS_H
@@ -179,6 +168,12 @@ void CtdlRegisterMaintenanceThread(char *name, void *(*thread_proc) (void *arg))
 
 void CtdlRegisterSearchFuncHook(void (*fcn_ptr)(int *, long **, const char *), char *name);
 
+/*
+ * if you say a) (which may take a while)
+ * don't forget to say b)
+ */
+void CtdlDisableHouseKeeping(void);
+void CtdlEnableHouseKeeping(void);
 
 /*
  * Directory services hooks for LDAP etc
@@ -245,23 +240,18 @@ unsigned CtdlCreateRoom(char *new_room_name,
                        int avoid_access,
                        int new_room_view);
 int CtdlGetRoom(struct ctdlroom *qrbuf, const char *room_name);
-int CtdlGetRoomLock(struct ctdlroom *qrbuf, char *room_name);
+int CtdlGetRoomLock(struct ctdlroom *qrbuf, const char *room_name);
 int CtdlDoIHavePermissionToDeleteThisRoom(struct ctdlroom *qr);
-void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
-               int *result, int *view);
+void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf, int *result, int *view);
 void CtdlPutRoomLock(struct ctdlroom *qrbuf);
 typedef void (*ForEachRoomCallBack)(struct ctdlroom *EachRoom, void *out_data);
 void CtdlForEachRoom(ForEachRoomCallBack CB, void *in_data);
 typedef void (*ForEachRoomNetCfgCallBack)(struct ctdlroom *EachRoom, void *out_data, OneRoomNetCfg *OneRNCFG);
-void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB,
-                          void *in_data,
-                          RoomNetCfg filter);
+void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data, RoomNetCfg filter);
 void SaveChangedConfigs(void);
-
 void CtdlDeleteRoom(struct ctdlroom *qrbuf);
 int CtdlRenameRoom(char *old_name, char *new_name, int new_floor);
-void CtdlUserGoto (char *where, int display_result, int transiently,
-                       int *msgs, int *new);
+void CtdlUserGoto (char *where, int display_result, int transiently, int *msgs, int *new, long *oldest, long *newest);
 struct floor *CtdlGetCachedFloor(int floor_num);
 void CtdlScheduleRoomForDeletion(struct ctdlroom *qrbuf);
 void CtdlGetFloor (struct floor *flbuf, int floor_num);
@@ -389,6 +379,8 @@ struct config {
        time_t c_pop3_fastest;
        int c_spam_flag_only;
        int c_guest_logins;
+       int c_nntp_port;
+       int c_nntps_port;
 };
 struct configlen {
        long c_nodename;
@@ -418,6 +410,9 @@ struct configlen {
        long c_pager_program;
 };
 
+#define SET_CFGSTRBUF(which, buffer) configlen.which = safestrncpy(config.which, ChrPtr(buffer), sizeof(config.which))
+#define SET_CFGSTR(which, buffer) configlen.which = safestrncpy(config.which, buffer, sizeof(config.which))
+
 extern struct config config;
 extern struct configlen configlen;
 
@@ -526,6 +521,10 @@ int CtdlGetUserLen(struct ctdluser *usbuf, const char *name, long len);
 int CtdlGetUserLock(struct ctdluser *usbuf, char *name);
 void CtdlPutUser(struct ctdluser *usbuf);
 void CtdlPutUserLock(struct ctdluser *usbuf);
+
+int CtdlLockGetCurrentUser(void);
+void CtdlPutCurrentUserLock(void);
+
 int CtdlGetUserByNumber(struct ctdluser *usbuf, long number);
 void CtdlGetRelationship(visit *vbuf,
                         struct ctdluser *rel_user,