comparison src/define.h @ 73:3cb02cb1e6cd stable-0-6-10

Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them). More changes for Fedora packaging (#434727) Fixes for const correctness.
author Carl Byington <carl@five-ten-sg.com>
date Thu, 29 May 2008 18:51:02 -0700
parents cfd6175f9334
children 987aa872294e
comparison
equal deleted inserted replaced
72:c21e9c001256 73:3cb02cb1e6cd
78 #ifdef HAVE_DIRENT_H 78 #ifdef HAVE_DIRENT_H
79 # include <dirent.h> 79 # include <dirent.h>
80 #endif 80 #endif
81 81
82 82
83 void pst_debug(char *fmt, ...); 83 void pst_debug(const char *fmt, ...);
84 void pst_debug_hexdumper(FILE* out, unsigned char* buf, size_t size, int col, int delta); 84 void pst_debug_hexdumper(FILE* out, char* buf, size_t size, int col, int delta);
85 void pst_debug_hexprint(char *data, int size); 85 void pst_debug_hexprint(char *data, int size);
86 86
87 void pst_debug_init(char *fname); 87 void pst_debug_init(const char *fname);
88 void pst_debug_msg_info (int line, char *file, int type); 88 void pst_debug_msg_info (int line, const char *file, int type);
89 void pst_debug_msg_text(char* fmt, ...); 89 void pst_debug_msg_text(const char* fmt, ...);
90 void pst_debug_hexdump(unsigned char *x, size_t y, int cols, int delta); 90 void pst_debug_hexdump(char *x, size_t y, int cols, int delta);
91 void pst_debug_func(char *function); 91 void pst_debug_func(const char *function);
92 void pst_debug_func_ret(); 92 void pst_debug_func_ret();
93 void pst_debug_close(void); 93 void pst_debug_close(void);
94 void pst_debug_write(); 94 void pst_debug_write();
95 size_t pst_debug_fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream);
95 96
96 void * xmalloc(size_t size); 97 void * xmalloc(size_t size);
97 98
98 #define MESSAGEPRINT(x,y) {pst_debug_msg_info(__LINE__,__FILE__,y);\ 99 #define MESSAGEPRINT(x,y) {pst_debug_msg_info(__LINE__,__FILE__,y);\
99 pst_debug_msg_text x;} 100 pst_debug_msg_text x;}
129 #endif 130 #endif
130 131
131 #ifdef DEBUG_MODE_EMAIL 132 #ifdef DEBUG_MODE_EMAIL
132 #define DEBUG_EMAIL(x) MESSAGEPRINT(x, DEBUG_EMAIL_NO); 133 #define DEBUG_EMAIL(x) MESSAGEPRINT(x, DEBUG_EMAIL_NO);
133 #define DEBUG_EMAIL_HEXPRINT(x,y) {pst_debug_msg_info(__LINE__, __FILE__, 11);\ 134 #define DEBUG_EMAIL_HEXPRINT(x,y) {pst_debug_msg_info(__LINE__, __FILE__, 11);\
134 pst_debug_hexdump(x, y, 0x10, 0);} 135 pst_debug_hexdump((char*)x, y, 0x10, 0);}
135 #else 136 #else
136 #define DEBUG_EMAIL(x) {} 137 #define DEBUG_EMAIL(x) {}
137 #define DEBUG_EMAIL_HEXPRINT(x,y) {} 138 #define DEBUG_EMAIL_HEXPRINT(x,y) {}
138 #endif 139 #endif
139 140
174 #endif 175 #endif
175 176
176 #ifdef DEBUG_MODE_HEXDUMP 177 #ifdef DEBUG_MODE_HEXDUMP
177 #define DEBUG_HEXDUMP(x, s)\ 178 #define DEBUG_HEXDUMP(x, s)\
178 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\ 179 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\
179 pst_debug_hexdump(x, s, 0x10, 0);} 180 pst_debug_hexdump((char*)x, s, 0x10, 0);}
180 #define DEBUG_HEXDUMPC(x, s, c)\ 181 #define DEBUG_HEXDUMPC(x, s, c)\
181 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\ 182 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\
182 pst_debug_hexdump(x, s, c, 0);} 183 pst_debug_hexdump((char*)x, s, c, 0);}
183 #else 184 #else
184 #define DEBUG_HEXDUMP(x, s) {} 185 #define DEBUG_HEXDUMP(x, s) {}
185 #define DEBUG_HEXDUMPC(x, s, c) {} 186 #define DEBUG_HEXDUMPC(x, s, c) {}
186 #endif 187 #endif
187 188