Mercurial > libpst
comparison src/debug.c @ 48:f66078abed38
more fixes for 64 bit format
author | carl |
---|---|
date | Fri, 18 Jan 2008 15:07:12 -0800 |
parents | b2a7f2e0926a |
children | b12f4e50e2e8 |
comparison
equal
deleted
inserted
replaced
47:5fb8d997feed | 48:f66078abed38 |
---|---|
1 /* Contains the debug functions */ | 1 |
2 #include "define.h" | |
3 | |
2 #include <stdio.h> | 4 #include <stdio.h> |
3 #include <stdlib.h> | 5 #include <stdlib.h> |
4 #include <stdarg.h> | 6 #include <stdarg.h> |
5 #include <ctype.h> | 7 #include <ctype.h> |
6 #include <string.h> | 8 #include <string.h> |
7 #include <limits.h> | 9 #include <limits.h> |
8 #include "define.h" | |
9 | 10 |
10 #ifdef _WIN32 | 11 #ifdef _WIN32 |
11 # define vsnprintf _vsnprintf | 12 # define vsnprintf _vsnprintf |
12 #endif | 13 #endif |
13 | 14 |
244 | 245 |
245 void pst_debug_write() { | 246 void pst_debug_write() { |
246 size_t size, ptr, funcname, filename, text, end; | 247 size_t size, ptr, funcname, filename, text, end; |
247 char *buf = NULL, rec_type; | 248 char *buf = NULL, rec_type; |
248 if (!debug_fp) return; // no file | 249 if (!debug_fp) return; // no file |
249 off_t index_pos = ftell (debug_fp); | 250 off_t index_pos = ftell(debug_fp); |
250 off_t file_pos = index_pos; | 251 off_t file_pos = index_pos; |
251 // add 2. One for the pointer to the next index, | 252 // add 2. One for the pointer to the next index, |
252 // one for the count of this index | 253 // one for the count of this index |
253 int index_size = ((curr_items+2) * sizeof(off_t)); | 254 int index_size = ((curr_items+2) * sizeof(off_t)); |
254 off_t *index; | 255 off_t *index; |