[Zlib-devel] zlib 1.2.4.1 beta
Vincent Torri
vtorri at univ-evry.fr
Mon Mar 29 01:32:32 EDT 2010
On Sun, 28 Mar 2010, William A. Rowe Jr. wrote:
> On 3/28/2010 7:37 PM, Mark Adler wrote:
>> On Mar 28, 2010, at 4:16 PM, Vincent Torri wrote:
>>> _setmode for Windows CE is declared in stdlib.h :
>>
>> So would the code below in minigzip.c solve the problem?
>
> This isn't making sense, because this code is used in the stdin/stdout
> case, and as far as I've ever read, CE has no stdin/stdout, right?
well, there is a console for Windows CE. I use printf a lot to debug
Windows CE programs. So I guess that there is stdout.
Vincent
> The
> entire block of stdin/stdout options should be commented out for CE?
>
> It would make no sense to do this for __CYGWIN__ because I'd presume
> cygwin doesn't try to play 'text' games, right?
>
> But none of this makes sense in this context;
>
> file = gzdopen(fileno(stdin), "rb");
> if (file == NULL) error("can't gzdopen stdin");
> gz_uncompress(file, stdout);
>
> because it's easier to go directly to the source;
>
> {...}
> #define SET_BINARY_MODE(fd) setmode(fd, O_BINARY);
> {...}
>
> /* Well-defined fd */
> #define Z_STDIN 0
> #define Z_STDOUT 1
>
> SET_BINARY_MODE(Z_STDIN);
> file = gzdopen(Z_STDIN, "rb");
> if (file == NULL) error("can't gzdopen stdin");
> gz_uncompress(file, file);
>
> Does this all make more sense, ignoring FILE *stdin/*stdout altogether? In fact,
> it probably makes more sense to use fd based open, etc.
>
> which does leave me with a question, what purpose does the char *mode arg
> serve, in the gzdopen() API?
>
>
>
> _______________________________________________
> Zlib-devel mailing list
> Zlib-devel at madler.net
> http://mail.madler.net/mailman/listinfo/zlib-devel_madler.net
>
>
More information about the Zlib-devel
mailing list