Changeset 1595


Ignore:
Timestamp:
01/07/07 11:34:45 (6 years ago)
Author:
sam
Message:
  • Always define getc(), but undefine the getc macro beforehands just in case.
  • Implemented _IO_getc().
Location:
zzuf/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/configure.ac

    r1594 r1595  
    1616 
    1717AC_CHECK_HEADERS(inttypes.h stdint.h getopt.h) 
    18 AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko getline getdelim __getdelim fgetln) 
     18AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln) 
    1919AC_CHECK_TYPES(sighandler_t, [], [], 
    2020  [#define _GNU_SOURCE 
  • zzuf/trunk/doc/zzuf.1

    r1594 r1595  
    258258\fBgetc\fR(), \fBfgetc\fR(), \fBfgets\fR(), \fBungetc\fR(), \fBfclose\fR() 
    259259.TP 
    260 GNU libc specific: 
    261 \fBopen64\fR(), \fBlseek64\fR(), \fBmmap64\fR(), \fBgetline\fR(), 
    262 \fBgetdelim\fR(), \fB__getdelim\fR() 
    263 .TP 
    264 BSD specific: 
     260Linux-specific: 
     261\fBopen64\fR(), \fBlseek64\fR(), \fBmmap64\fR(), \fB_IO_getc\fR(), 
     262\fBgetline\fR(), \fBgetdelim\fR(), \fB__getdelim\fR() 
     263.TP 
     264BSD-specific: 
    265265\fBfgetln\fR() 
    266266.TP 
  • zzuf/trunk/src/fuzz.c

    r1555 r1595  
    4343    unsigned int i, j, todo; 
    4444 
    45 /* 
     45#if 0 
    4646    debug("fuzz(%i, %lli@%li)", fd, (unsigned long long int)len, 
    4747          (unsigned long int)pos); 
    48 */ 
     48#endif 
    4949 
    5050    fuzz = _zz_getfuzz(fd); 
  • zzuf/trunk/src/load-stream.c

    r1594 r1595  
    3838 
    3939/* Library functions that we divert */ 
    40 static FILE *  (*fopen_orig)   (const char *path, const char *mode); 
     40static FILE *  (*fopen_orig)    (const char *path, const char *mode); 
    4141#ifdef HAVE_FOPEN64 
    42 static FILE *  (*fopen64_orig) (const char *path, const char *mode); 
    43 #endif 
    44 static int     (*fseek_orig)   (FILE *stream, long offset, int whence); 
     42static FILE *  (*fopen64_orig)  (const char *path, const char *mode); 
     43#endif 
     44static int     (*fseek_orig)    (FILE *stream, long offset, int whence); 
    4545#ifdef HAVE_FSEEKO 
    46 static int     (*fseeko_orig)  (FILE *stream, off_t offset, int whence); 
    47 #endif 
    48 static void    (*rewind_orig)  (FILE *stream); 
    49 static size_t  (*fread_orig)   (void *ptr, size_t size, size_t nmemb, 
    50                                 FILE *stream); 
    51 static int     (*getc_orig)    (FILE *stream); 
    52 static int     (*fgetc_orig)   (FILE *stream); 
    53 static char *  (*fgets_orig)   (char *s, int size, FILE *stream); 
    54 static int     (*ungetc_orig)  (int c, FILE *stream); 
    55 static int     (*fclose_orig)  (FILE *fp); 
     46static int     (*fseeko_orig)   (FILE *stream, off_t offset, int whence); 
     47#endif 
     48static void    (*rewind_orig)   (FILE *stream); 
     49static size_t  (*fread_orig)    (void *ptr, size_t size, size_t nmemb, 
     50                                 FILE *stream); 
     51static int     (*getc_orig)     (FILE *stream); 
     52static int     (*fgetc_orig)    (FILE *stream); 
     53static int     (*_IO_getc_orig) (FILE *stream); 
     54static char *  (*fgets_orig)    (char *s, int size, FILE *stream); 
     55static int     (*ungetc_orig)   (int c, FILE *stream); 
     56static int     (*fclose_orig)   (FILE *fp); 
    5657 
    5758/* Additional GNUisms */ 
     
    8788    LOADSYM(getc); 
    8889    LOADSYM(fgetc); 
     90#ifdef HAVE__IO_GETC 
     91    LOADSYM(_IO_getc); 
     92#endif 
    8993    LOADSYM(fgets); 
    9094    LOADSYM(ungetc); 
     
    261265    } while(0) 
    262266 
    263 #if !defined getc 
     267#undef getc /* can be a macro; we don’t want that */ 
    264268int getc(FILE *stream) 
    265269{ 
    266270    int ret; FGETC(getc); return ret; 
    267271} 
    268 #endif 
    269272 
    270273int fgetc(FILE *stream) 
     
    272275    int ret; FGETC(fgetc); return ret; 
    273276} 
     277 
     278#ifdef HAVE__IO_GETC 
     279int _IO_getc(FILE *stream) 
     280{ 
     281    int ret; FGETC(_IO_getc); return ret; 
     282} 
     283#endif 
    274284 
    275285char *fgets(char *s, int size, FILE *stream) 
  • zzuf/trunk/test/testsuite.sh

    r1592 r1595  
    8888            # initially. (Linux sed doesn't, but OS X sed does.) 
    8989            check "$ZZOPTS" "head -- -n 9999 $file" "head -n 9999" 
     90            check "$ZZOPTS" "tail -- -n 9999 $file" "tail -n 9999" 
     91            check "$ZZOPTS" "tail -- -n +1 $file" "tail -n +1" 
     92            check "$ZZOPTS" "grep -- -a '' $file" "grep -a ''" 
     93            check "$ZZOPTS" "sed -- -e n $file" "sed -e n" 
     94            #check "$ZZOPTS" "cut -- -b1- $file" "cut -b1-" 
    9095            check "$ZZOPTS" "-i head -- -n 9999 < $file" "|head -n 9999" 
    91             check "$ZZOPTS" "tail -- -n +1 $file" "tail -n +1" 
     96            check "$ZZOPTS" "-i tail -- -n 9999 < $file" "|tail -n 9999" 
    9297            check "$ZZOPTS" "-i tail -- -n +1 < $file" "|tail -n +1" 
    93             check "$ZZOPTS" "grep -- -a '' $file" "grep -a ''" 
    9498            check "$ZZOPTS" "-i grep -- -a '' < $file" "|grep -a ''" 
    95             check "$ZZOPTS" "sed -- -e n $file" "sed -e n" 
    9699            check "$ZZOPTS" "-i sed -- -e n < $file" "|sed -e n" 
    97             #check "$ZZOPTS" "cut -- -b1- $file" "cut -b1-" 
    98100            #check "$ZZOPTS" "-i cut -- -b1- < $file" "|cut -b1-" 
    99101            ;; 
Note: See TracChangeset for help on using the changeset viewer.