- Timestamp:
- 11/24/05 11:30:11 (16 years ago)
- 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
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/common.h
r6ad8afc rf66a4933 10 10 #endif /* __cplusplus */ 11 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 12 27 #endif // COMMON_H -
lib/format_erf.c
rf3ed52a rf66a4933 65 65 /* 66 66 gzread (gzFile, buf, len) 67 gzdopen(path, mode) 68 gzopen(path, mode) 69 gzclose(gzFile) 67 70 gzwrite(gzFile, buf, len) 68 gzdopen(path, mode)69 gzclose(gzFile)70 71 71 72 fread(ptr, size, num, FILE) 73 fdopen(filedes,mode) 74 fopen(path, mode) 75 fclose(FILE) 72 76 fwrite(ptr, size, num, FILE) 73 fopen(path, mode) 74 fdopen(fildes, mode) 75 */ 77 */ 78 /* 76 79 #if HAVE_ZLIB 77 80 # include <zlib.h> 78 # define LIBTRACE_READ gzread79 # define LIBTRACE_ OPEN gzopen80 # define LIBTRACE_ FDOPEN gzdopen81 # define LIBTRACE_CLOSE gzclose82 # define LIBTRACE_WRITE gzwrite81 # define LIBTRACE_READ(file,buf,len) gzread(file,buf,len) 82 # define LIBTRACE_FDOPEN(fd,mode) gzdopen(fd,mode) 83 # define LIBTRACE_OPEN(path,mode) gzopen(path,mode) 84 # define LIBTRACE_CLOSE(file) gzclose(file) 85 # define LIBTRACE_WRITE(file,buf,len) gzwrite(file,buf,len) 83 86 #else 84 # define LIBTRACE_READ fread85 # define LIBTRACE_ OPEN fopen86 # define LIBTRACE_ FDOPEN fdopen87 # define LIBTRACE_CLOSE fclose88 # define LIBTRACE_WRITE fwrite89 #endif 90 87 # define LIBTRACE_READ(file,buf,len) fread(buf,len,1,file) 88 # define LIBTRACE_FDOPEN(fd,mode) fdopen(fd,mode) 89 # define LIBTRACE_OPEN(path,mode) fopen(path,mode) 90 # define LIBTRACE_CLOSE(file) fclose(file) 91 # define LIBTRACE_WRITE(file,buf,len) fwrite(buf,len,1,file) 92 #endif 93 */ 91 94 #define COLLECTOR_PORT 3435 92 95 … … 126 129 gzFile *file; 127 130 #else 128 FILE *file; 131 //FILE *file; 132 int file; 129 133 #endif 130 134 } input; … … 164 168 gzFile *file; 165 169 #else 166 FILE *file; 170 //FILE *file; 171 int file; 167 172 #endif 168 173 } output; … … 264 269 // STDIN 265 270 libtrace->sourcetype = STDIN; 266 INPUT.file = LIBTRACE_FDOPEN(STDIN, "r"); 271 if ((INPUT.file = LIBTRACE_FDOPEN(stdin, "r")) < 0) { 272 perror("libtrace_fdopen:"); 273 return 0; 274 } 275 267 276 268 277 } else { … … 373 382 if (!strncmp(libtrace->uridata,"-",1)) { 374 383 // STDOUT 375 OUTPUT.file = LIBTRACE_FDOPEN( dup(1),filemode);384 OUTPUT.file = LIBTRACE_FDOPEN(stdout,filemode); 376 385 } 377 386 else { -
lib/format_wag.c
rf3ed52a rf66a4933 63 63 #include <stdlib.h> 64 64 65 /* 65 66 #if HAVE_ZLIB 66 67 # include <zlib.h> … … 75 76 # define LIBTRACE_WRITE write 76 77 #endif 77 78 */ 78 79 #ifdef HAVE_LIMITS_H 79 80 # include <limits.h> … … 110 111 gzFile *file; 111 112 #else 112 FILE *file; 113 //FILE *file; 114 int file; 113 115 #endif 114 116 } input; … … 129 131 gzFile *file; 130 132 #else 131 FILE *file; 133 //FILE *file; 134 int file; 132 135 #endif 133 136 } output;
Note: See TracChangeset
for help on using the changeset viewer.