CON_SYS /* This is a system context and mustn't be purged */
} CCState;
+typedef struct AsyncIO AsyncIO; /* forward declaration for event_client.h */
+typedef struct CitContext CitContext;
/*
* Here's the big one... the Citadel context structure.
*
*/
struct CitContext {
- struct CitContext *prev; /* Link to previous session in list */
- struct CitContext *next; /* Link to next session in the list */
+ CitContext *prev; /* Link to previous session in list */
+ CitContext *next; /* Link to next session in the list */
int cs_pid; /* session ID */
int dont_term; /* for special activities like artv so we don't get killed */
+ double created; /* time of birth */
time_t lastcmd; /* time of last command executed */
time_t lastidle; /* For computing idle time */
CCState state; /* thread state (see CON_ values below) */
long *cached_msglist; /* results of the previous CtdlForEachMessage() */
int cached_num_msgs;
+
+ AsyncIO *IO; /* if this session has AsyncIO going on... */
};
-typedef struct CitContext CitContext;
#define CC MyContext()
}
+
+/* typedef void (*CtdlDbgFunction) (const int); */
+
+extern int DebugSession;
+#define CONDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugSession != 0))
+
+#define CON_syslog(LEVEL, FORMAT, ...) \
+ CONDBGLOG(LEVEL) syslog(LEVEL, \
+ "Context: " FORMAT, __VA_ARGS__)
+
+#define CONM_syslog(LEVEL, FORMAT) \
+ CONDBGLOG(LEVEL) syslog(LEVEL, \
+ "Context: " FORMAT);
+
+
#endif /* CONTEXT_H */