From: WATANABE Hirofumi Date: 1998-10-19T15:17:14+09:00 Subject: [ruby-list:10197] snprintf.c (Re: VPATH) わたなべです. Yukihiro Matsumoto writes: :そろそろ1.1c7を出すかな. 例の snprintf.c だけど fpos_t は必要ないので, いっそのこと削ってしまうのはだめかな? --- missing/snprintf.c.orig Thu Aug 27 13:14:20 1998 +++ missing/snprintf.c Mon Oct 19 15:13:36 1998 @@ -104,27 +104,6 @@ #endif /* - * This is fairly grotesque, but pure ANSI code must not inspect the - * innards of an fpos_t anyway. The library internally uses off_t, - * which we assume is exactly as big as eight chars. (When we switch - * to gcc 2.4 we will use __attribute__ here.) - * - * WARNING: the alignment constraints on an off_t and the struct below - * differ on (e.g.) the SPARC. Hence, the placement of an fpos_t object - * in a structure will change if fpos_t's are not aligned on 8-byte - * boundaries. THIS IS A CROCK, but for now there is no way around it. - */ -#if !defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__) -#if !defined(__hpux) -typedef off_t fpos_t; -#endif -#else -typedef struct __sfpos { - char _pos[8]; -} fpos_t; -#endif - -/* * NB: to fit things in six character monocase externals, the stdio * code uses the prefix `__s' for stdio objects, typically followed * by a three-character attempt at a mnemonic. @@ -171,29 +150,6 @@ short _file; /* fileno, if Unix descriptor, else -1 */ struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ int _lbfsize; /* 0 or -_bf._size, for inline putc */ - - /* operations */ - void *_cookie; /* cookie passed to io functions */ - int (*_close) __P((void *)); - int (*_read) __P((void *, char *, int)); - fpos_t (*_seek) __P((void *, fpos_t, int)); - int (*_write) __P((void *, const char *, int)); - - /* separate buffer for long sequences of ungetc() */ - struct __sbuf _ub; /* ungetc buffer */ - unsigned char *_up; /* saved _p when _p is doing ungetc data */ - int _ur; /* saved _r when _r is counting ungetc data */ - - /* tricks to meet minimum requirements even when malloc() fails */ - unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ - unsigned char _nbuf[1]; /* guarantee a getc() buffer */ - - /* separate buffer for fgetln() when line crosses buffer boundary */ - struct __sbuf _lb; /* buffer for fgetln() */ - - /* Unix stdio files get aligned to block boundaries on fseek() */ - int _blksize; /* stat.st_blksize (may be != _bf._size) */ - fpos_t _offset; /* current lseek offset (see WARNING) */ } FILE;