Changeset edb18ce for lib/common.h


Ignore:
Timestamp:
04/21/06 00:42:17 (15 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
d0906e7
Parents:
671566a
Message:

Rewrote libtrace's IO handling to use shim functions when needing to do
zlib io

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/common.h

    r9e830d4 redb18ce  
    1212#endif /* __cplusplus */
    1313
    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 #  define LIBTRACE_SEEK(file,offset,whence) gzseek(file,offset,whence)
    23 #  define LIBTRACE_TELL(file) gztell(file)
    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)
    30 #  define LIBTRACE_FILE int
    31 #  define LIBTRACE_SEEK(file,offset,whence) lseek(file,offset,whence)
    32 #  define LIBTRACE_TELL(file) lseek(file,0,SEEK_CUR)
    33 #endif
    3414
    3515#endif /* COMMON_H */
Note: See TracChangeset for help on using the changeset viewer.