A little more with the API coding style.
[citadel.git] / citadel / include / ctdl_module.h
index 9019a5d1c22c5422e44f883956dba2d21f21b9fc..71fa155340686ef1876aabcbf5f01f78f2edfa77 100644 (file)
@@ -3,11 +3,48 @@
 #ifndef CTDL_MODULE_H
 #define CTDL_MODULE_H
 
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <signal.h>
+#include <pwd.h>
+#include <errno.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 <sys/wait.h>
+#include <string.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include <limits.h>
+
+
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
+
+
 #include <libcitadel.h>
+
 #include "server.h"
 #include "sysdep_decls.h"
 #include "msgbase.h"
 #include "threads.h"
+#include "citadel_dirs.h"
 /*
  * define macros for module init stuff
  */
@@ -188,6 +225,10 @@ struct floor *CtdlGetCachedFloor(int floor_num);
 void CtdlScheduleRoomForDeletion(struct ctdlroom *qrbuf);
 void CtdlGetFloor (struct floor *flbuf, int floor_num);
 void CtdlPutFloor (struct floor *flbuf, int floor_num);
+void CtdlPutFloorLock(struct floor *flbuf, int floor_num);
+int CtdlGetFloorByName(const char *floor_name);
+int CtdlGetFloorByNameLock(const char *floor_name);
+int CtdlGetAvailableFloor(void);
 int CtdlIsNonEditable(struct ctdlroom *qrbuf);
 void CtdlPutRoom(struct ctdlroom *);
 
@@ -203,4 +244,62 @@ enum {
        crr_access_denied               /* not allowed to edit this room */
 };
 
+
+
+/*
+ * API declarations from citserver.h
+ */
+int CtdlAccessCheck(int);
+/* 'required access level' values which may be passed to CtdlAccessCheck()
+ */
+enum {
+       ac_none,
+       ac_logged_in,
+       ac_room_aide,
+       ac_aide,
+       ac_internal
+};
+
+
+
+/*
+ * API declarations from serv_extensions.h
+ */
+void CtdlModuleDoSearch(int *num_msgs, long **search_msgs, char *search_string, char *func_name);
+/* 
+ * Global system configuration.  Don't change anything here.  It's all in dtds/config-defs.h now.
+ */
+struct config {
+#include "datadefinitions.h"
+#include "dtds/config-defs.h"
+#include "undef_data.h"
+};
+
+extern struct config config;
+
+
+
+/*
+ * Expose API calls from user_ops.c
+ */
+int CtdlGetUser(struct ctdluser *usbuf, char name[]);
+int CtdlGetUserLock(struct ctdluser *usbuf, char *name);
+void CtdlPutUser(struct ctdluser *usbuf);
+void CtdlPutUserLock(struct ctdluser *usbuf);
+int CtdlGetUserByNumber(struct ctdluser *usbuf, long number);
+void CtdlGetRelationship(struct visit *vbuf,
+                        struct ctdluser *rel_user,
+                        struct ctdlroom *rel_room);
+void CtdlSetRelationship(struct visit *newvisit,
+                        struct ctdluser *rel_user,
+                        struct ctdlroom *rel_room);
+void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
+
+
+/*
+ * Expose API calls from msgbase.c
+ */
+char *CtdlGetSysConfig(char *sysconfname);
+void CtdlPutSysConfig(char *sysconfname, char *sysconfdata);
+
 #endif /* CTDL_MODULE_H */