extern int threading;
-/*
- * define macros for module init stuff
- */
+// define macros for module init stuff
#define CTDL_MODULE_INIT(module_name) char *ctdl_module_##module_name##_init (int threading)
FMT_CITADEL, \
SUBJECT)
-/*
- * Hook functions available to modules.
- */
-/* Priorities for */
+// Hook functions available to modules.
+
+// Priority levels for event hooks
#define PRIO_QUEUE 500
#define PRIO_AGGR 1000
#define PRIO_SEND 1500
#define PRIO_CLEANUP 2000
-/* Priorities for EVT_HOUSE */
#define PRIO_HOUSE 3000
-/* Priorities for EVT_LOGIN */
#define PRIO_CREATE 10000
-/* Priorities for EVT_LOGOUT */
#define PRIO_LOGOUT 15000
-/* Priorities for EVT_LOGIN */
#define PRIO_LOGIN 20000
-/* Priorities for EVT_START */
#define PRIO_START 25000
-/* Priorities for EVT_STOP */
#define PRIO_STOP 30000
-/* Priorities for EVT_ASYNC */
#define PRIO_ASYNC 35000
-/* Priorities for EVT_SHUTDOWN */
#define PRIO_SHUTDOWN 40000
-/* Priorities for EVT_UNSTEALTH */
#define PRIO_UNSTEALTH 45000
-/* Priorities for EVT_STEALTH */
#define PRIO_STEALTH 50000
-
void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType, int Priority);
void CtdlShutdownServiceHooks(void);
void CtdlRegisterUserHook(void (*fcn_ptr)(struct ctdluser *), int EventType);
void CtdlRegisterEVCleanupHook(void (*fcn_ptr)(void));
void CtdlRegisterProtoHook(void (*handler)(char *), char *cmd, char *desc);
void CtdlRegisterServiceHook(int tcp_port,
- char *sockpath,
- void (*h_greeting_function) (void),
- void (*h_command_function) (void),
- void (*h_async_function) (void),
- const char *ServiceName
+ char *sockpath,
+ void (*h_greeting_function) (void),
+ void (*h_command_function) (void),
+ void (*h_async_function) (void),
+ const char *ServiceName
);
void CtdlRegisterFixedOutputHook(char *content_type, void (*output_function) (char *supplied_data, int len));
void CtdlRegisterMaintenanceThread(char *name, void *(*thread_proc) (void *arg));
-/*
- * if you say a) (which may take a while)
- * don't forget to say b)
- */
-void CtdlDisableHouseKeeping(void);
-void CtdlEnableHouseKeeping(void);
+void CtdlDisableHouseKeeping(void); // If you call this, it may take a while...
+void CtdlEnableHouseKeeping(void); // ...so don't forget to call this later.
-/* TODODRW: This needs to be changed into a hook type interface
- * for now we have this horrible hack
- */
+// TODODRW: This needs to be changed into a hook type interface
+// for now we have this horrible hack
void CtdlModuleStartCryptoMsgs(char *ok_response, char *nosup_response, char *error_response);
-/* 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
- * The number of contexts is returned in count.
- * Beware, this does not copy any of the data pointed to by the context.
- * This means that you can not rely on things like the redirect buffer being valid.
- * You must free the returned pointer when done.
- */
+// 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
+// The number of contexts is returned in count.
+// Beware, this does not copy any of the data pointed to by the context.
+// This means that you can not rely on things like the redirect buffer being valid.
+// You must free the returned pointer when done.
struct CitContext *CtdlGetContextArray (int *count);
void CtdlFillSystemContext(struct CitContext *context, char *name);
int CtdlTrySingleUser(void);
void CtdlBumpNewMailCounter(long which_user);
-/*
- * CtdlGetCurrentMessageNumber() - Obtain the current highest message number in the system
- * This provides a quick way to initialize a variable that might be used to indicate
- * messages that should not be processed. For example, a new inbox script will use this
- * to record determine that messages older than this should not be processed.
- * This function is defined in control.c
- */
+// CtdlGetCurrentMessageNumber() - Obtain the current highest message number in the system
+// This provides a quick way to initialize a variable that might be used to indicate
+// messages that should not be processed. For example, a new inbox script will use this
+// to record determine that messages older than this should not be processed.
+// This function is defined in control.c
long CtdlGetCurrentMessageNumber(void);
-/*
- * Expose various room operation functions from room_ops.c to the modules API
- */
+// Expose various room operation functions from room_ops.c to the modules API
unsigned CtdlCreateRoom(char *new_room_name,
int new_room_type,
int CtdlIsNonEditable(struct ctdlroom *qrbuf);
void CtdlPutRoom(struct ctdlroom *);
-/*
- * Possible return values for CtdlRenameRoom()
- */
+// Possible return values for CtdlRenameRoom()
enum {
- crr_ok, /* success */
- crr_room_not_found, /* room not found */
- crr_already_exists, /* new name already exists */
- crr_noneditable, /* cannot edit this room */
- crr_invalid_floor, /* target floor does not exist */
- crr_access_denied /* not allowed to edit this room */
+ crr_ok, // success
+ crr_room_not_found, // room not found
+ crr_already_exists, // new name already exists
+ crr_noneditable, // cannot edit this room
+ crr_invalid_floor, // target floor does not exist
+ crr_access_denied // not allowed to edit this room
};
-/*
- * API declarations from citserver.h
- */
+// API declarations from citserver.h
int CtdlAccessCheck(int);
-/* 'required access level' values which may be passed to CtdlAccessCheck()
- */
+
+// 'required access level' values which may be passed to CtdlAccessCheck()
enum {
ac_none,
ac_logged_in_or_guest,
#define CtdlREGISTERRoomCfgType(a, p, uniq, nSegs, s, d) RegisterRoomCfgType(#a, sizeof(#a) - 1, a, p, uniq, nSegs, s, d);
-
-/*
- * Expose API calls from user_ops.c
- */
+// Expose API calls from user_ops.c
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 CtdlMailboxName(char *buf, size_t n, const struct ctdluser *who, const char *prefix);
int CtdlLoginExistingUser(const char *username);
-/*
- * Values which may be returned by CtdlLoginExistingUser()
- */
+// Values which may be returned by CtdlLoginExistingUser()
enum {
pass_ok,
pass_already_logged_in,
};
int CtdlTryPassword(const char *password, long len);
-/*
- * Values which may be returned by CtdlTryPassword()
- */
+
+// Values which may be returned by CtdlTryPassword()
enum {
login_ok,
login_already_logged_in,
void CtdlUserLogout(void);
-/*
- * Expose API calls from msgbase.c
- */
-
-/*
- * Expose API calls from euidindex.c
- */
+// Expose API calls from euidindex.c
long CtdlLocateMessageByEuid(char *euid, struct ctdlroom *qrbuf);
-/*
- * Expose API calls from external authentication driver
- */
+// Expose API calls from external authentication driver
int attach_extauth(struct ctdluser *who, StrBuf *claimed_id);
-#endif /* CTDL_MODULE_H */
+#endif