提交 3d85f02a 编写于 作者: M Mark Adler

Restore gzgetc function for binary compatibility.

Newly compiled applications will use the gzgetc macro.
上级 df60b507
...@@ -53,6 +53,7 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') ...@@ -53,6 +53,7 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
EXPORT SYMBOL("gzputs") EXPORT SYMBOL("gzputs")
EXPORT SYMBOL("gzgets") EXPORT SYMBOL("gzgets")
EXPORT SYMBOL("gzputc") EXPORT SYMBOL("gzputc")
EXPORT SYMBOL("gzgetc")
EXPORT SYMBOL("gzflush") EXPORT SYMBOL("gzflush")
EXPORT SYMBOL("gzseek") EXPORT SYMBOL("gzseek")
EXPORT SYMBOL("gzrewind") EXPORT SYMBOL("gzrewind")
......
...@@ -186,6 +186,9 @@ ...@@ -186,6 +186,9 @@
D file value like(gzFile) File pointer D file value like(gzFile) File pointer
D c 10I 0 value Character to write D c 10I 0 value Character to write
* *
D gzgetc PR 10i 0 extproc('gzgetc')
D file value like(gzFile) File pointer
*
D gzgetc_ PR 10i 0 extproc('gzgetc_') D gzgetc_ PR 10i 0 extproc('gzgetc_')
D file value like(gzFile) File pointer D file value like(gzFile) File pointer
* *
......
...@@ -33,6 +33,7 @@ EXPORTS ...@@ -33,6 +33,7 @@ EXPORTS
zlibVersion @27 zlibVersion @27
gzprintf @28 gzprintf @28
gzputc @29 gzputc @29
gzgetc @30
gzseek @31 gzseek @31
gzrewind @32 gzrewind @32
gztell @33 gztell @33
......
...@@ -33,6 +33,7 @@ EXPORTS ...@@ -33,6 +33,7 @@ EXPORTS
zlibVersion @27 zlibVersion @27
gzprintf @28 gzprintf @28
gzputc @29 gzputc @29
gzgetc @30
gzseek @31 gzseek @31
gzrewind @32 gzrewind @32
gztell @33 gztell @33
......
...@@ -390,10 +390,7 @@ int ZEXPORT gzgetc_(file) ...@@ -390,10 +390,7 @@ int ZEXPORT gzgetc_(file)
(state->err != Z_OK && state->err != Z_BUF_ERROR)) (state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1; return -1;
/* try output buffer (no need to check for skip request) -- while /* try output buffer (no need to check for skip request) */
this check really isn't required since the gzgetc() macro has
already determined that x.have is zero, we leave it in for
completeness. */
if (state->x.have) { if (state->x.have) {
state->x.have--; state->x.have--;
state->x.pos++; state->x.pos++;
...@@ -405,6 +402,13 @@ int ZEXPORT gzgetc_(file) ...@@ -405,6 +402,13 @@ int ZEXPORT gzgetc_(file)
return ret < 1 ? -1 : buf[0]; return ret < 1 ? -1 : buf[0];
} }
#undef gzgetc
int ZEXPORT gzgetc(file)
gzFile file;
{
return gzgetc_(file);
}
/* -- see zlib.h -- */ /* -- see zlib.h -- */
int ZEXPORT gzungetc(c, file) int ZEXPORT gzungetc(c, file)
int c; int c;
......
...@@ -42,6 +42,7 @@ EXPORTS ...@@ -42,6 +42,7 @@ EXPORTS
gzputs gzputs
gzgets gzgets
gzputc gzputc
gzgetc
gzungetc gzungetc
gzflush gzflush
gzseek gzseek
......
...@@ -1363,8 +1363,8 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); ...@@ -1363,8 +1363,8 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
returns the value that was written, or -1 in case of error. returns the value that was written, or -1 in case of error.
*/ */
/*
ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
/*
Reads one byte from the compressed file. gzgetc returns this byte or -1 Reads one byte from the compressed file. gzgetc returns this byte or -1
in case of end of file or error. This is implemented as a macro for speed. in case of end of file or error. This is implemented as a macro for speed.
As such, it does not do all of the checking the other functions do. I.e. As such, it does not do all of the checking the other functions do. I.e.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册