-
typedef pthread_t THREAD;
int num_msgs;
char curr_user[32]; /* name of current user */
- int curr_rm; /* index of current room */
int logged_in; /* logged in */
int internal_pgm; /* authenticated as internal program */
char temp[32]; /* temp file name */
char fake_roomname[20]; /* Name of the fake room <bc> */
char last_pager[32]; /* The username of the last pager */
+ int FloorBeingSearched; /* This is used by cmd_lrms() etc. */
+
int CtdlErrno; /* Error return for CitadelAPI calls */
};
/*
* Citadel DataBases (define one for each cdb we need to open)
*/
-#define CDB_MSGMAIN 0 /* message base */
-#define CDB_USERSUPP 1 /* user file */
-#define CDB_QUICKROOM 2 /* room index */
-#define CDB_FLOORTAB 3 /* floor index */
-#define CDB_MSGLISTS 4 /* room message lists */
-#define CDB_MAILBOXES 5 /* mailbox message lists */
-#define MAXCDB 6 /* total number of CDB's defined */
+#define CDB_MSGMAIN 0 /* message base */
+#define CDB_USERSUPP 1 /* user file */
+#define CDB_QUICKROOM 2 /* room index */
+#define CDB_FLOORTAB 3 /* floor index */
+#define CDB_MSGLISTS 4 /* room message lists */
+#define CDB_MAILBOXES 5 /* mailbox message lists */
+#define CDB_VISIT 6 /* user/room relationships */
+#define MAXCDB 7 /* total number of CDB's defined */
struct cdbdata {
size_t len;
};
extern struct CleanupFunctionHook *CleanupHookTable;
-struct NewRoomFunctionHook {
- struct NewRoomFunctionHook *next;
- void *(*h_function_pointer) (char *);
- };
-extern struct NewRoomFunctionHook *NewRoomHookTable;
+/*
+ * SessionFunctionHook extensions are used for any type of hook for which
+ * the context in which it's being called (which is determined by the event
+ * type) will make it obvious for the hook function to know where to look for
+ * pertinent data.
+ */
struct SessionFunctionHook {
struct SessionFunctionHook *next;
- void *(*h_function_pointer) (int);
- int startstop;
+ void *(*h_function_pointer) (void);
+ int eventtype;
};
extern struct SessionFunctionHook *SessionHookTable;
-struct LoginFunctionHook {
- struct LoginFunctionHook *next;
- void *(*h_function_pointer) (void);
+#define EVT_STOP 0 /* Session is terminating */
+#define EVT_START 1 /* Session is starting */
+#define EVT_LOGIN 2 /* A user is logging in */
+#define EVT_NEWROOM 3 /* Changing rooms */
+#define EVT_LOGOUT 4 /* A user is logging out */
+#define EVT_SETPASS 5 /* Setting or changing password */
+
+
+/*
+ * UserFunctionHook extensions are used for any type of hook which implements
+ * an operation on a user or username (potentially) other than the one
+ * operating the current session.
+ */
+struct UserFunctionHook {
+ struct UserFunctionHook *next;
+ void *(*h_function_pointer) (char *username, long usernum);
+ int eventtype;
};
-extern struct LoginFunctionHook *LoginHookTable;
+extern struct UserFunctionHook *UserHookTable;
+#define EVT_PURGEUSER 100 /* Deleting a user */
+#define EVT_OUTPUTMSG 101 /* Outputting a message */