< prev index next >

src/java.base/share/native/libzip/zlib/infback.c

Print this page
*** 37,27 ***
  #include "zutil.h"
  #include "inftrees.h"
  #include "inflate.h"
  #include "inffast.h"
  
- /* function prototypes */
- local void fixedtables OF((struct inflate_state FAR *state));
- 
  /*
     strm provides memory allocation functions in zalloc and zfree, or
     Z_NULL to use the library memory allocation functions.
  
     windowBits is in the range 8..15, and window is a user-supplied
     window and output buffer that is 2**windowBits bytes.
   */
! int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
! z_streamp strm;
! int windowBits;
- unsigned char FAR *window;
- const char *version;
- int stream_size;
- {
      struct inflate_state FAR *state;
  
      if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
          stream_size != (int)(sizeof(z_stream)))
          return Z_VERSION_ERROR;
--- 37,20 ---
  #include "zutil.h"
  #include "inftrees.h"
  #include "inflate.h"
  #include "inffast.h"
  
  /*
     strm provides memory allocation functions in zalloc and zfree, or
     Z_NULL to use the library memory allocation functions.
  
     windowBits is in the range 8..15, and window is a user-supplied
     window and output buffer that is 2**windowBits bytes.
   */
! int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
!                              unsigned char FAR *window, const char *version,
!                              int stream_size) {
      struct inflate_state FAR *state;
  
      if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
          stream_size != (int)(sizeof(z_stream)))
          return Z_VERSION_ERROR;

*** 102,13 ***
     thereafter.  This reduces the size of the code by about 2K bytes, in
     exchange for a little execution time.  However, BUILDFIXED should not be
     used for threaded applications, since the rewriting of the tables and virgin
     may not be thread-safe.
   */
! local void fixedtables(state)
- struct inflate_state FAR *state;
- {
  #ifdef BUILDFIXED
      static int virgin = 1;
      static code *lenfix, *distfix;
      static code fixed[544];
  
--- 95,11 ---
     thereafter.  This reduces the size of the code by about 2K bytes, in
     exchange for a little execution time.  However, BUILDFIXED should not be
     used for threaded applications, since the rewriting of the tables and virgin
     may not be thread-safe.
   */
! local void fixedtables(struct inflate_state FAR *state) {
  #ifdef BUILDFIXED
      static int virgin = 1;
      static code *lenfix, *distfix;
      static code fixed[544];
  

*** 270,17 ***
     returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
     error, or Z_MEM_ERROR if it could not allocate memory for the state.
     inflateBack() can also return Z_STREAM_ERROR if the input parameters
     are not correct, i.e. strm is Z_NULL or the state was not initialized.
   */
! int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
! z_streamp strm;
- in_func in;
- void FAR *in_desc;
- out_func out;
- void FAR *out_desc;
- {
      struct inflate_state FAR *state;
      z_const unsigned char FAR *next;    /* next input */
      unsigned char FAR *put;     /* next output */
      unsigned have, left;        /* available input and output */
      unsigned long hold;         /* bit buffer */
--- 261,12 ---
     returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
     error, or Z_MEM_ERROR if it could not allocate memory for the state.
     inflateBack() can also return Z_STREAM_ERROR if the input parameters
     are not correct, i.e. strm is Z_NULL or the state was not initialized.
   */
! int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
!                         out_func out, void FAR *out_desc) {
      struct inflate_state FAR *state;
      z_const unsigned char FAR *next;    /* next input */
      unsigned char FAR *put;     /* next output */
      unsigned have, left;        /* available input and output */
      unsigned long hold;         /* bit buffer */

*** 654,13 ***
      strm->next_in = next;
      strm->avail_in = have;
      return ret;
  }
  
! int ZEXPORT inflateBackEnd(strm)
- z_streamp strm;
- {
      if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
          return Z_STREAM_ERROR;
      ZFREE(strm, strm->state);
      strm->state = Z_NULL;
      Tracev((stderr, "inflate: end\n"));
--- 640,11 ---
      strm->next_in = next;
      strm->avail_in = have;
      return ret;
  }
  
! int ZEXPORT inflateBackEnd(z_streamp strm) {
      if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
          return Z_STREAM_ERROR;
      ZFREE(strm, strm->state);
      strm->state = Z_NULL;
      Tracev((stderr, "inflate: end\n"));
< prev index next >