source: lib/common.h @ ee5e4c7

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

Major cleanup of libtrace3
Lots of documentation fixes
Lots of zerocopy fixes
Lots of config option fixes

  • Property mode set to 100644
File size: 810 bytes
Line 
1#ifndef COMMON_H
2#define COMMON_H 1
3
4#ifdef __cplusplus
5#  define BEGIN_C_DECLS extern "C" {
6#  define END_C_DECLS   }
7#else /* !__cplusplus */
8#  define BEGIN_C_DECLS
9#  define END_C_DECLS
10#endif /* __cplusplus */
11
12#if HAVE_ZLIB
13#  include <zlib.h>
14#  define LIBTRACE_READ(file,buf,len) gzread(file,buf,len)
15#  define LIBTRACE_FDOPEN(fd,mode) gzdopen(fd,mode)
16#  define LIBTRACE_OPEN(path,mode) gzopen(path,mode)
17#  define LIBTRACE_CLOSE(file) gzclose(file)
18#  define LIBTRACE_WRITE(file,buf,len) gzwrite(file,buf,len)
19#else
20#  define LIBTRACE_READ(file,buf,len) read(file,buf,len)
21#  define LIBTRACE_FDOPEN(fd,mode) dup(fd)
22#  define LIBTRACE_OPEN(path,mode) open(path,mode)
23#  define LIBTRACE_CLOSE(file) close(file)
24#  define LIBTRACE_WRITE(file,buf,len) write(file,buf,len)
25#endif
26
27#endif /* COMMON_H */
Note: See TracBrowser for help on using the repository browser.