Changeset 4032
- Timestamp:
- Nov 25, 2009, 1:42:32 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/lib-stream.c
r4029 r4032 26 26 /* Define if stdio operations use *only* the refill mechanism */ 27 27 #if defined HAVE___SREFILL 28 # define REFILL_ONLY_STDIO 28 # define HAVE_DARWIN_STDIO 29 #elif defined HAVE___FILBUF || defined HAVE___SRGET || defined HAVE___UFLOW 30 # define HAVE_BSD_STDIO 29 31 #endif 30 32 … … 162 164 static inline uint8_t *get_stream_ptr(FILE *stream) 163 165 { 164 #if defined HAVE_ __FILBUF || defined HAVE___SRGET || defined HAVE___UFLOW166 #if defined HAVE_BSD_STDIO 165 167 return (uint8_t *)stream->FILE_PTR; 166 168 #else … … 171 173 static inline int get_stream_off(FILE *stream) 172 174 { 173 #if defined HAVE_ __FILBUF || defined HAVE___SRGET || defined HAVE___UFLOW175 #if defined HAVE_BSD_STDIO 174 176 return (int)((uint8_t *)stream->FILE_PTR - (uint8_t *)stream->FILE_BASE); 175 177 #else … … 182 184 #if defined HAVE_GLIBC_FP 183 185 return (int)((uint8_t *)stream->FILE_CNT - (uint8_t *)stream->FILE_PTR); 184 #elif defined HAVE_ __FILBUF || defined HAVE___SRGET || defined HAVE___UFLOW186 #elif defined HAVE_BSD_STDIO 185 187 return stream->FILE_CNT; 186 188 #else … … 197 199 */ 198 200 199 #if defined REFILL_ONLY_STDIO /* Fuzz fp if we have __srefill() */201 #if defined HAVE_DARWIN_STDIO /* Fuzz fp if we have __srefill() */ 200 202 # define FOPEN_FUZZ() \ 201 203 _zz_fuzz(fd, get_stream_ptr(ret), get_stream_cnt(ret)) … … 293 295 */ 294 296 295 #if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */297 #if defined HAVE_DARWIN_STDIO /* Don't fuzz or seek if we have __srefill() */ 296 298 # define FSEEK_FUZZ(myftell) 297 299 #else … … 417 419 debug("%s([%i])", __func__, fd); 418 420 419 #if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */421 #if defined HAVE_DARWIN_STDIO /* Don't fuzz or seek if we have __srefill() */ 420 422 #else 421 423 /* FIXME: check what happens when rewind()ing a pipe */ … … 431 433 * __srget or __uflow, and store it in already_fuzzed. If these functions 432 434 * are not available, do nothing. */ 433 #if defined HAVE_ __FILBUF || defined HAVE___SRGET || defined HAVE___UFLOW435 #if defined HAVE_BSD_STDIO 434 436 # define FREAD_PREFUZZ(fd, oldpos) \ 435 437 do \ … … 449 451 * have __srefill, we just do nothing because that function is the only 450 452 * one that actually fuzzes things. */ 451 #if defined REFILL_ONLY_STDIO453 #if defined HAVE_DARWIN_STDIO 452 454 # define FREAD_FUZZ(fd, oldpos) \ 453 455 do \ … … 539 541 */ 540 542 541 #if defined HAVE_ __FILBUF || defined HAVE___SRGET || defined HAVE___UFLOW543 #if defined HAVE_BSD_STDIO 542 544 # define FGETC_PREFUZZ already_fuzzed = _zz_getfuzzed(fd); 543 545 #else … … 545 547 #endif 546 548 547 #if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */549 #if defined HAVE_DARWIN_STDIO /* Don't fuzz or seek if we have __srefill() */ 548 550 # define FGETC_FUZZ 549 551 #else … … 631 633 */ 632 634 633 #if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */635 #if defined HAVE_DARWIN_STDIO /* Don't fuzz or seek if we have __srefill() */ 634 636 # define FGETS_FUZZ(myfgets, myfgetc) \ 635 637 _zz_lock(fd); \ … … 722 724 fuzz->upos = _zz_getpos(fd) - 1; 723 725 fuzz->uchar = c; 724 #if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */726 #if defined HAVE_DARWIN_STDIO /* Don't fuzz or seek if we have __srefill() */ 725 727 #else 726 728 _zz_addpos(fd, -1); … … 853 855 { 854 856 char *ret; 855 #if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */857 #if defined HAVE_DARWIN_STDIO /* Don't fuzz or seek if we have __srefill() */ 856 858 #else 857 859 struct fuzz *fuzz; … … 867 869 868 870 DEBUG_STREAM("old", stream); 869 #if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */871 #if defined HAVE_DARWIN_STDIO /* Don't fuzz or seek if we have __srefill() */ 870 872 _zz_lock(fd); 871 873 ret = ORIG(fgetln)(stream, len); … … 910 912 */ 911 913 912 #if defined HAVE___SREFILL || defined HAVE___FILBUF || defined HAVE___SRGET 914 #if defined HAVE___UFLOW 915 # define REFILL_RETURNS_INT 0 916 #else 913 917 # define REFILL_RETURNS_INT 1 914 #elif defined HAVE___UFLOW915 # define REFILL_RETURNS_INT 0916 918 #endif 917 919
Note: See TracChangeset
for help on using the changeset viewer.