]> code.citadel.org Git - citadel.git/blobdiff - citadel/include/ctdl_module.h
* by counting up threads starting at 3, we seem to get what top shows in the LWPID...
[citadel.git] / citadel / include / ctdl_module.h
index 9c66304a58dfcc648a537f7620a20e037538976f..21550ed872be44eaa9f0487e28b72a4ffbb17cbc 100644 (file)
@@ -4,6 +4,19 @@
 #define CTDL_MODULE_H
 
 #include "sysdep.h"
+
+#ifdef HAVE_GC
+#define GC_THREADS
+#define GC_REDIRECT_TO_LOCAL
+#include <gc/gc_local_alloc.h>
+#else
+#define GC_MALLOC malloc
+#define GC_MALLOC_ATOMIC malloc
+#define GC_FREE free
+#define GC_REALLOC realloc
+#endif
+
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -45,6 +58,8 @@
 #include "msgbase.h"
 #include "threads.h"
 #include "citadel_dirs.h"
+#include "context.h"
+
 /*
  * define macros for module init stuff
  */
@@ -119,7 +134,7 @@ void CtdlUnRegisterFixedOutputHook(char *content_type);
 
 void CtdlRegisterMaintenanceThread(char *name, void *(*thread_proc) (void *arg));
 
-void CtdlRegisterSearchFuncHook(void (*fcn_ptr)(int *, long **, char *), char *name);
+void CtdlRegisterSearchFuncHook(void (*fcn_ptr)(int *, long **, const char *), char *name);
 
 
 /*
@@ -170,6 +185,7 @@ void CtdlThreadAllocTSD(void);
 #define MYCURSORS      (((ThreadTSD*)pthread_getspecific(ThreadKey))->cursors)
 #define MYTID          (((ThreadTSD*)pthread_getspecific(ThreadKey))->tid)
 #define CT             (((ThreadTSD*)pthread_getspecific(ThreadKey))->self)
+#define CTP            ((ThreadTSD*)pthread_getspecific(ThreadKey))
 
 /** return the current context list as an array and do it in a safe manner
  * The returned data is a copy so only reading is useful
@@ -180,13 +196,18 @@ void CtdlThreadAllocTSD(void);
  */
 struct CitContext *CtdlGetContextArray (int *count);
 void CtdlFillSystemContext(struct CitContext *context, char *name);
-
+void CtdlClearSystemContext(void);
 int CtdlTrySingleUser(void);
 void CtdlEndSingleUser(void);
 int CtdlWantSingleUser(void);
 int CtdlIsSingleUser(void);
 
 
+int CtdlIsUserLoggedIn (char *user_name);
+int CtdlIsUserLoggedInByNum (long usernum);
+void CtdlBumpNewMailCounter(long which_user);
+
+
 /*
  * CtdlGetCurrentMessageNumber()  -  Obtain the current highest message number in the system
  * This provides a quick way to initialise a variable that might be used to indicate
@@ -225,6 +246,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 *);
 
@@ -261,7 +286,7 @@ enum {
 /*
  * API declarations from serv_extensions.h
  */
-void CtdlModuleDoSearch(int *num_msgs, long **search_msgs, char *search_string, char *func_name);
+void CtdlModuleDoSearch(int *num_msgs, long **search_msgs, const char *search_string, const char *func_name);
 /* 
  * Global system configuration.  Don't change anything here.  It's all in dtds/config-defs.h now.
  */
@@ -278,7 +303,8 @@ extern struct config config;
 /*
  * Expose API calls from user_ops.c
  */
-int CtdlGetUser(struct ctdluser *usbuf, char name[]);
+int CtdlGetUser(struct ctdluser *usbuf, char *name);
+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);
@@ -291,5 +317,48 @@ void CtdlSetRelationship(struct visit *newvisit,
                         struct ctdlroom *rel_room);
 void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
 
+int CtdlLoginExistingUser(char *authname, const char *username);
+
+/*
+ * Values which may be returned by CtdlLoginExistingUser()
+ */
+enum {
+       pass_ok,
+       pass_already_logged_in,
+       pass_no_user,
+       pass_internal_error,
+       pass_wrong_password
+};
+
+int CtdlTryPassword(const char *password, long len);
+/*
+ * Values which may be returned by CtdlTryPassword()
+ */
+enum {
+       login_ok,
+       login_already_logged_in,
+       login_too_many_users,
+       login_not_found
+};
+
+void CtdlUserLogout(void);
+
+
+
+
+/*
+ * Expose API calls from msgbase.c
+ */
+char *CtdlGetSysConfig(char *sysconfname);
+void CtdlPutSysConfig(char *sysconfname, char *sysconfdata);
+
+
+
+
+/*
+ * Expose API calls from euidindex.c
+ */
+long CtdlLocateMessageByEuid(char *euid, struct ctdlroom *qrbuf);
+
 
 #endif /* CTDL_MODULE_H */