[BACK]Return to zlib.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Diff for /src/usr.bin/cvs/Attic/zlib.c between version 1.1 and 1.2

version 1.1, 2005/01/13 18:59:03 version 1.2, 2005/01/13 20:22:55
Line 26 
Line 26 
   
 #include <sys/param.h>  #include <sys/param.h>
   
 #include <errno.h>  
 #include <stdio.h>  
 #include <stdlib.h>  #include <stdlib.h>
 #include <unistd.h>  
 #include <string.h>  #include <string.h>
   
 #include "log.h"  #include "log.h"
 #include "cvs.h"  #include "cvs.h"
 #include "zlib.h"  #include "zlib.h"
   
   
 #define CVS_ZLIB_BUFSIZE  1024  #define CVS_ZLIB_BUFSIZE  1024
   
   
   
 struct cvs_zlib_ctx {  struct cvs_zlib_ctx {
         int       z_level;          int       z_level;
         z_stream  z_instrm;          z_stream  z_instrm;
Line 111 
Line 105 
 /*  /*
  * cvs_zlib_inflate()   * cvs_zlib_inflate()
  *   *
    * Decompress the first <slen> bytes of <src> using the zlib context <ctx> and
    * store the resulting data in <dst>.
    * Returns the number of bytes inflated on success, or -1 on failure.
  */   */
 int  int
 cvs_zlib_inflate(CVSZCTX *ctx, BUF *dst, u_char *src, size_t slen)  cvs_zlib_inflate(CVSZCTX *ctx, BUF *dst, u_char *src, size_t slen)
Line 141 
Line 138 
   
         } while (ret != Z_STREAM_END);          } while (ret != Z_STREAM_END);
   
         cvs_log(LP_WARN, "%u bytes decompressed to %d bytes", slen, bytes);  
   
         return (bytes);          return (bytes);
 }  }
   
   
 /*  /*
  * cvs_zlib_deflate()   * cvs_zlib_deflate()
  *   *
Line 172 
Line 166 
                 ctx->z_destrm.avail_out = sizeof(buf);                  ctx->z_destrm.avail_out = sizeof(buf);
                 ret = deflate(&(ctx->z_destrm), Z_FINISH);                  ret = deflate(&(ctx->z_destrm), Z_FINISH);
                 if ((ret == Z_STREAM_ERROR) || (ret == Z_BUF_ERROR)) {                  if ((ret == Z_STREAM_ERROR) || (ret == Z_BUF_ERROR)) {
 #if 0  
                 if (ret != Z_OK) {  
 #endif  
                         cvs_log(LP_ERR, "deflate error: %s", ctx->z_destrm.msg);                          cvs_log(LP_ERR, "deflate error: %s", ctx->z_destrm.msg);
                         return (-1);                          return (-1);
                 }                  }
Line 184 
Line 175 
                         return (-1);                          return (-1);
                 bytes += sizeof(buf) - ctx->z_destrm.avail_out;                  bytes += sizeof(buf) - ctx->z_destrm.avail_out;
         } while (ret != Z_STREAM_END);          } while (ret != Z_STREAM_END);
   
         cvs_log(LP_WARN, "%u bytes compressed to %d bytes", slen, bytes);  
   
         return (bytes);          return (bytes);
 }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2