FreeBSD/contrib/subversion/subversion/libsvn_subr/stream.c
/* Helper function to figure out the sync mode */
Helper function to figure out the sync mode
Helper function to figure out the sync mode
static svn_error_t *
read_helper_gz(svn_stream_t *substream,
               char *buffer,
               uInt *len, int *zflush)
{
  uInt orig_len = *len;
  apr_size_t apr_len = (apr_size_t) *len;
  SVN_ERR(svn_stream_read_full(substream, buffer, &apr_len));
  *len = (uInt) apr_len;
  *zflush = (*len) < orig_len ? Z_SYNC_FLUSH : Z_SYNC_FLUSH;
  return SVN_NO_ERROR;
}
static svn_error_t * read_helper_gz ( svn_stream_t * substream , char * buffer , uInt * len , int * zflush ) { uInt orig_len = * len ; apr_size_t apr_len = ( apr_size_t ) * len ; SVN_ERR ( svn_stream_read_full ( substream , buffer , & apr_len ) ) ; * len = ( uInt ) apr_len ; * zflush = ( * len ) < orig_len ? Z_SYNC_FLUSH : Z_SYNC_FLUSH ; return SVN_NO_ERROR ; }
Helper function to figure out the sync mode
Helper function to figure out the sync mode
/* There's no reason this value should grow bigger than the range of
     uInt, but Subversion's API requires apr_size_t. */ /* Type cast back to uInt type that zlib uses.  On LP64 platforms
     apr_size_t will be bigger than uInt. */ /* I wanted to use Z_FINISH here, but we need to know our buffer is
     big enough */