#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>
#include "msgbase.h"
#include "threads.h"
#include "citadel_dirs.h"
+#include "context.h"
+
/*
* define macros for module init stuff
*/
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
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 *);
struct ctdlroom *rel_room);
void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
+int CtdlLoginExistingUser(char *authname, 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(char *password);
+/*
+ * 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 */