source: lib/common.h @ 5b91b48

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

Abstract away opening up traces into a single trace_open_trace that's more
simple and reliable.

  • Property mode set to 100644
File size: 891 bytes
Line 
1#ifndef COMMON_H
2#define COMMON_H 1
3
4#include "config.h"
5
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
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)
21#  define LIBTRACE_FILE gzFile*
22#else
23#  define LIBTRACE_READ(file,buf,len) read(file,buf,len)
24#  define LIBTRACE_FDOPEN(fd,mode) dup(fd)
25#  define LIBTRACE_OPEN(path,mode) open(path,mode)
26#  define LIBTRACE_CLOSE(file) close(file)
27#  define LIBTRACE_WRITE(file,buf,len) write(file,buf,len)
28#  define LIBTRACE_FILE int
29#endif
30
31#endif /* COMMON_H */
Note: See TracBrowser for help on using the repository browser.