Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added network server files
[palacios.git] / misc / network_servers / vtl / debug.h
diff --git a/misc/network_servers/vtl/debug.h b/misc/network_servers/vtl/debug.h
new file mode 100644 (file)
index 0000000..20cb547
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef __DEBUG_H
+#define __DEBUG_H 1
+
+
+
+
+#ifdef DEBUG
+
+#define ASSERT(exp) assert(exp)
+
+/*
+ *
+ *
+ */
+
+#ifdef linux
+
+extern FILE * logfile;
+extern time_t dbgt;
+extern char dmsg[1024];
+
+#define DEBUG_DECLARE() FILE * logfile; time_t dbgt; char dmsg[1024];
+#define JRLDBG( ...) time(&dbgt); sprintf(dmsg,"%s: ",ctime(&dbgt)); *(dmsg + strlen(dmsg) -3) = ' '; fprintf(logfile, dmsg); sprintf(dmsg,__VA_ARGS__); fprintf(logfile,dmsg); fflush(logfile);
+#define debug_init(logfilename) logfile = fopen(logfilename,"w+")
+
+#elif defined(WIN32)
+
+#define DEBUG_DECLARE() 
+#define JRLDBG printf
+#define debug_init(logfilename) 
+
+#endif
+
+/*
+ *
+ *
+ */
+
+#else //!DEBUG
+
+#ifdef WIN32
+
+#define ASSERT(exp)
+#define DEBUG_DECLARE()
+#define JRLDBG()
+#define debug_init(logfilename)
+
+#elif defined(linux)
+
+#define ASSERT(exp)
+#define DEBUG_DECLARE(...)
+#define JRLDBG(...)
+#define debug_init(logfilename)
+
+#endif
+
+#endif
+
+
+
+#endif