comparison src/debug.c @ 176:ac6e22c8a9cf

build separate libpst, libpst-libs, libpst-devel rpms. remove many functions from the interface by making them static.
author Carl Byington <carl@five-ten-sg.com>
date Wed, 08 Apr 2009 14:13:06 -0700
parents 6954d315aaa8
children 2f38c4ce606f
comparison
equal deleted inserted replaced
175:03dbd449290f 176:ac6e22c8a9cf
18 }; 18 };
19 19
20 static struct pst_debug_func *func_head=NULL, *func_ptr=NULL; 20 static struct pst_debug_func *func_head=NULL, *func_ptr=NULL;
21 21
22 22
23 void pst_debug_write_msg(struct pst_debug_item *item, const char *fmt, va_list *ap, int size); 23 static void pst_debug_write_msg(struct pst_debug_item *item, const char *fmt, va_list *ap, int size);
24 void pst_debug_write_hex(struct pst_debug_item *item, char *buf, size_t size, int col); 24 static void pst_debug_write_hex(struct pst_debug_item *item, char *buf, size_t size, int col);
25 void * pst_malloc(size_t size); 25 static void pst_debug_write();
26 26
27 size_t pst_debug_fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream) { 27
28 static size_t pst_debug_fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream);
29 static size_t pst_debug_fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream) {
28 return fwrite(ptr, size, nitems, stream); 30 return fwrite(ptr, size, nitems, stream);
29 } 31 }
30 32
31 33
32 // the largest text size we will store in memory. Otherwise we 34 // the largest text size we will store in memory. Otherwise we
248 if (debug_fp) fclose(debug_fp); 250 if (debug_fp) fclose(debug_fp);
249 debug_fp = NULL; 251 debug_fp = NULL;
250 } 252 }
251 253
252 254
253 void pst_debug_write() { 255 static void pst_debug_write() {
254 size_t size, ptr, funcname, filename, text, end; 256 size_t size, ptr, funcname, filename, text, end;
255 char *buf = NULL, rec_type; 257 char *buf = NULL, rec_type;
256 if (!debug_fp) return; // no file 258 if (!debug_fp) return; // no file
257 int64_t index_pos = ftello(debug_fp); 259 int64_t index_pos = ftello(debug_fp);
258 int64_t file_pos = index_pos; 260 int64_t file_pos = index_pos;
332 free(index); 334 free(index);
333 if (buf) free(buf); 335 if (buf) free(buf);
334 } 336 }
335 337
336 338
337 void pst_debug_write_msg(struct pst_debug_item *item, const char *fmt, va_list *ap, int size) { 339 static void pst_debug_write_msg(struct pst_debug_item *item, const char *fmt, va_list *ap, int size) {
338 struct pst_debug_file_rec_l lfile_rec; 340 struct pst_debug_file_rec_l lfile_rec;
339 struct pst_debug_file_rec_m mfile_rec; 341 struct pst_debug_file_rec_m mfile_rec;
340 unsigned char rec_type; 342 unsigned char rec_type;
341 int index_size = 3 * sizeof(int64_t); 343 int index_size = 3 * sizeof(int64_t);
342 int64_t index[3]; 344 int64_t index[3];