Author: Bleep <tomh@inxpress.net>
[ircu2.10.12-pk.git] / include / s_debug.h
index 8f93fca6fe184fac249966d3dde9996dd6575183..5bcc69bf647fd86f00b9228a157ca18d4fd4cb7c 100644 (file)
@@ -1,14 +1,26 @@
-#ifndef S_DEBUG_H
-#define S_DEBUG_H
-
+/*
+ * s_debug.h
+ *
+ * $Id$
+ */
+#ifndef INCLUDED_s_debug_h
+#define INCLUDED_s_debug_h
+#ifndef INCLUDED_config_h
+#include "config.h"
+#endif
+#ifndef INCLUDED_ircd_defs_h
+#include "ircd_defs.h"       /* Needed for HOSTLEN */
+#endif
+#ifndef INCLUDED_stdarg_h
 #include <stdarg.h>
-#ifdef MSGLOG_ENABLED
-#include "struct.h"            /* Needed for HOSTLEN */
+#define INCLUDED_stdarg_h
 #endif
 
+struct Client;
+
 #ifdef DEBUGMODE
 
-/*=============================================================================
+/*
  * Macro's
  */
 
  * defined debugging levels
  */
 #define DEBUG_FATAL  0
-#define DEBUG_ERROR  1         /* report_error() and other
-                                  errors that are found */
+#define DEBUG_ERROR  1  /* report_error() and other errors that are found */
 #define DEBUG_NOTICE 3
-#define DEBUG_DNS    4         /* used by all DNS related routines - a *lot* */
-#define DEBUG_INFO   5         /* general usful info */
-#define DEBUG_NUM    6         /* numerics */
-#define DEBUG_SEND   7         /* everything that is sent out */
-#define DEBUG_DEBUG  8         /* anything to do with debugging,
-                                  ie unimportant :) */
-#define DEBUG_MALLOC 9         /* malloc/free calls */
-#define DEBUG_LIST  10         /* debug list use */
+#define DEBUG_DNS    4  /* used by all DNS related routines - a *lot* */
+#define DEBUG_INFO   5  /* general useful info */
+#define DEBUG_NUM    6  /* numerics */
+#define DEBUG_SEND   7  /* everything that is sent out */
+#define DEBUG_DEBUG  8  /* everything that is received */ 
+#define DEBUG_MALLOC 9  /* malloc/free calls */
+#define DEBUG_LIST  10  /* debug list use */
 
-/*=============================================================================
+/*
  * proto types
  */
 
 extern void vdebug(int level, const char *form, va_list vl);
-extern void debug(int level, const char *form, ...)
-    __attribute__ ((format(printf, 2, 3)));
-extern void send_usage(aClient *cptr, char *nick);
+extern void debug(int level, const char *form, ...);
+extern void send_usage(struct Client *cptr, char *nick);
 
 #else /* !DEBUGMODE */
 
@@ -47,110 +56,8 @@ extern void send_usage(aClient *cptr, char *nick);
 
 #endif /* !DEBUGMODE */
 
-extern void count_memory(aClient *cptr, char *nick);
+extern void open_debugfile(void);
+extern void count_memory(struct Client *cptr, char *nick);
 extern char serveropts[];
 
-/*=============================================================================
- * Message logging service
- */
-
-/*
- * Message levels: these are inclusive, i.e. a message that is LEVEL_MAP
- * affects also clients and channels and is propagated and needs a query of
- * some status, and therefore belongs to all the classes, in the same way
- * _every_ message is parsed so belongs to LEVEL_PARSED
- */
-
-/* Messages that affect servers' map */
-#define LEVEL_MAP      6
-
-/* Messages that affect clients existance */
-#define LEVEL_CLIENT   5
-
-/* Messages that affect channel existance */
-#define LEVEL_CHANNEL  4
-
-/* Messages that affect channel modes */
-#define LEVEL_MODE     3
-
-/* Messages that are only to be propagated somewhere */
-#define LEVEL_PROPAGATE 2
-
-/*
- * Messages that only perform queries
- * note how every message may need some status query over data structs
- * and at the same time every query might need to be propagated
- * somewhere... so the distinction between levels PROPAGATE and
- * QUERY is quite fuzzy
- */
-#define LEVEL_QUERY    1
-
-/* Messages that only perform queries */
-#define LEVEL_PARSED   0
-
-#ifdef MSGLOG_ENABLED
-
-/*=============================================================================
- * Macro's
- */
-
-#define LogMessage(x) Log_Message x
-#define StoreBuffer(x) Store_Buffer x
-
-/* Logging mask, selection on type of connection */
-#define LOG_PING       (0x8000 >> (8 + STAT_PING))
-#define LOG_LOG                (0x8000 >> (8 + STAT_LOG))
-#define LOG_CONNECTING (0x8000 >> (8 + STAT_CONNECTING))
-#define LOG_HANDSHAKE  (0x8000 >> (8 + STAT_HANDSHAKE))
-#define LOG_ME         (0x8000 >> (8 + STAT_ME))
-#define LOG_UNKNOWN    (0x8000 >> (8 + STAT_UNKNOWN))
-#define LOG_SERVER     (0x8000 >> (8 + STAT_SERVER))
-#define LOG_CLIENT     (0x8000 >> (8 + STAT_USER))
-
-/*
- * Define here the type of connection(s) that will be monitored.
- * Default is to log messages coming from any connection.
- */
-#define LOG_MASK_TYPE \
-    ( LOG_PING | LOG_LOG | LOG_CONNECTING | \
-      LOG_HANDSHAKE | LOG_ME | LOG_UNKNOWN | LOG_SERVER | LOG_CLIENT )
-
-/*=============================================================================
- * data structures
- */
-
-struct log_entry {
-  int cptr_status;
-  char cptr_name[HOSTLEN + 1];
-  char cptr_yxx[3];
-  int cptr_fd;
-
-  int sptr_status;
-  char sptr_name[HOSTLEN + 1];
-  char sptr_yxx[4];
-  char sptr_from_name[HOSTLEN + 1];
-
-  char buffer[512];
-
-  /* The following may be lost before log gets used,
-     anyhow they are only here for usage through gdb */
-
-  aClient *cptr;
-  aClient *sptr;
-};
-
-/*=============================================================================
- * proto types
- */
-
-extern void Log_Message(aClient *sptr, int msgclass);
-extern void Store_Buffer(char *buf, aClient *cptr);
-
-#else /* !MSGLOG_ENABLED */
-
-#define LogMessage(x)
-#define StoreBuffer(x)
-
-#endif /* !MSGLOG_ENABLED */
-
-#endif /* S_DEBUG_H */
+#endif /* INCLUDED_s_debug_h */