00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef QORE_SUPPORT_H
00024
00025 #define QORE_SUPPORT_H
00026
00027 #include <qore/common.h>
00028
00029 DLLEXPORT int printe(const char *fmt, ...);
00030 DLLEXPORT char *remove_trailing_newlines(char *str);
00031 DLLEXPORT char *remove_trailing_blanks(char *str);
00032
00033
00034
00035
00037 DLLEXPORT void trace_function(int code, const char *funcname);
00039 DLLEXPORT int print_debug(int level, const char *fmt, ...);
00040
00041 DLLEXPORT extern int qore_trace;
00042 DLLEXPORT extern int debug;
00043
00044 #define TRACE_IN 1
00045 #define TRACE_OUT 2
00046
00047 #ifdef DEBUG
00049 #define printd print_debug
00050
00052 #define QORE_TRACE(a) { trace_function(TRACE_IN, a); ON_BLOCK_EXIT(trace_function, TRACE_OUT, a); }
00053
00054 #else
00055 #ifdef __GNUC__
00057 #define printd(args...)
00059 #define QORE_TRACE(args...)
00060 #else
00062 #define printd(args, ...)
00064 #define QORE_TRACE(x)
00065 #endif
00066 #endif
00067
00068 #if !defined(HAVE_ISBLANK) && !defined(isblank)
00069 #define isblank(a) ((a) == ' ' || (a) == '\t')
00070 #endif
00071
00072 #endif