source: lib/common.h @ e7bc155

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since e7bc155 was 0d57541, checked in by Perry Lorier <perry@…>, 16 years ago

Add preliminary seek support

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[6ad8afc]1#ifndef COMMON_H
2#define COMMON_H 1
3
[3d4d52d]4#include "config.h"
5
[6ad8afc]6#ifdef __cplusplus
7#  define BEGIN_C_DECLS extern "C" {
8#  define END_C_DECLS   }
9#else /* !__cplusplus */
10#  define BEGIN_C_DECLS
11#  define END_C_DECLS
12#endif /* __cplusplus */
13
[f66a4933]14#if HAVE_ZLIB
15#  include <zlib.h>
16#  define LIBTRACE_READ(file,buf,len) gzread(file,buf,len)
17#  define LIBTRACE_FDOPEN(fd,mode) gzdopen(fd,mode)
18#  define LIBTRACE_OPEN(path,mode) gzopen(path,mode)
19#  define LIBTRACE_CLOSE(file) gzclose(file)
20#  define LIBTRACE_WRITE(file,buf,len) gzwrite(file,buf,len)
[3d4d52d]21#  define LIBTRACE_FILE gzFile*
[0d57541]22#  define LIBTRACE_SEEK(file,offset,whence) gzseek(file,offset,whence)
23#  define LIBTRACE_TELL(file) gztell(file)
[f66a4933]24#else
25#  define LIBTRACE_READ(file,buf,len) read(file,buf,len)
26#  define LIBTRACE_FDOPEN(fd,mode) dup(fd)
27#  define LIBTRACE_OPEN(path,mode) open(path,mode)
28#  define LIBTRACE_CLOSE(file) close(file)
29#  define LIBTRACE_WRITE(file,buf,len) write(file,buf,len)
[3d4d52d]30#  define LIBTRACE_FILE int
[0d57541]31#  define LIBTRACE_SEEK(file,offset,whence) lseek(file,offset,whence)
32#  define LIBTRACE_TELL(file) tell(file,0,SEEK_CUR)
[f66a4933]33#endif
34
[7068467]35#endif /* COMMON_H */
Note: See TracBrowser for help on using the repository browser.