-/* $Id$ */
#ifndef CTDL_MODULE_H
#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>
void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType);
void CtdlUnregisterSessionHook(void (*fcn_ptr)(void), int EventType);
+void CtdlShutdownServiceHooks(void);
void CtdlRegisterUserHook(void (*fcn_ptr)(struct ctdluser *), int EventType);
void CtdlUnregisterUserHook(void (*fcn_ptr)(struct ctdluser *), int EventType);
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);
/*
* Citadel Threads API
*/
struct CtdlThreadNode *CtdlThreadCreate(char *name, long flags, void *(*thread_func) (void *arg), void *args);
-struct CtdlThreadNode *CtdlThreadSchedule(char *name, long flags, void *(*thread_func) (void *arg), void *args, time_t when);
void CtdlThreadSleep(int secs);
void CtdlThreadStop(struct CtdlThreadNode *thread);
int CtdlThreadCheckStop(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
*/
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 CtdlIsUserLoggedIn (char *user_name);
-int CtdlIsUserLoggedInByNum (int usernum);
+int CtdlIsUserLoggedInByNum (long usernum);
+void CtdlBumpNewMailCounter(long which_user);
/*
*/
enum {
ac_none,
+ ac_logged_in_or_guest,
ac_logged_in,
ac_room_aide,
ac_aide,
- ac_internal
+ ac_internal,
};
/*
* 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.
*/
/*
* 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);
int CtdlGetUserByNumber(struct ctdluser *usbuf, long number);
-void CtdlGetRelationship(struct visit *vbuf,
+void CtdlGetRelationship(visit *vbuf,
struct ctdluser *rel_user,
struct ctdlroom *rel_room);
-void CtdlSetRelationship(struct visit *newvisit,
+void CtdlSetRelationship(visit *newvisit,
struct ctdluser *rel_user,
struct ctdlroom *rel_room);
void CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
-int CtdlLoginExistingUser(char *authname, char *username);
+int CtdlLoginExistingUser(char *authname, const char *username);
/*
* Values which may be returned by CtdlLoginExistingUser()
pass_wrong_password
};
-int CtdlTryPassword(char *password);
+int CtdlTryPassword(const char *password, long len);
/*
* Values which may be returned by CtdlTryPassword()
*/