Changeset f66a4933 for lib/common.h


Ignore:
Timestamp:
11/24/05 11:30:11 (15 years ago)
Author:
Daniel Lawson <dlawson@…>
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:
9cecdb2
Parents:
187a6d6
Message:

moved LIBTRACE_READ etc defines into common.h

if we don't have zlib, use read,open etc. We were using fread,fopen, but these take different parameters, and i couldn't make them work nicely.

stdin doesn't seem to work for non-zlib paths however

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/common.h

    r6ad8afc rf66a4933  
    1010#endif /* __cplusplus */
    1111
     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
    1227#endif // COMMON_H
Note: See TracChangeset for help on using the changeset viewer.