src/utilfuns/zlib/zutil.c File Reference

#include "zutil.h"
Include dependency graph for zutil.c:

Go to the source code of this file.

Classes

struct  internal_state

Functions

void free OF ((voidpf ptr))
voidp calloc OF ((uInt items, uInt size))
void exit OF ((int))
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
void zcfree (voidpf opaque, voidpf ptr)
const char *ZEXPORT zError (int err)
const char *ZEXPORT zlibVersion ()
int zmemcmp (Bytef *s1, const Bytef *s2, uInt len) const
void zmemcpy (Bytef *dest, const Bytef *source, uInt len)
void zmemzero (Bytef *dest, uInt len)

Variables

const char * z_errmsg [10]

Function Documentation

void free OF ( (voidpf ptr)   ) 
voidp calloc OF ( (uInt items, uInt size)   ) 
void exit OF ( (int)   ) 
voidpf zcalloc ( voidpf  opaque,
unsigned  items,
unsigned  size 
)

Definition at line 208 of file zutil.c.

00212 {
00213     if (opaque) items += size - size; /* make compiler happy */
00214     return (voidpf)calloc(items, size);
00215 }

void zcfree ( voidpf  opaque,
voidpf  ptr 
)

Definition at line 217 of file zutil.c.

00220 {
00221     free(ptr);
00222     if (opaque) return; /* make compiler happy */
00223 }

const char* ZEXPORT zError ( int  err  ) 

Definition at line 52 of file zutil.c.

00054 {
00055     return ERR_MSG(err);
00056 }

const char* ZEXPORT zlibVersion (  ) 

Definition at line 29 of file zutil.c.

00030 {
00031     return ZLIB_VERSION;
00032 }

int zmemcmp ( Bytef s1,
const Bytef s2,
uInt  len 
) const

Definition at line 72 of file zutil.c.

00076 {
00077     uInt j;
00078 
00079     for (j = 0; j < len; j++) {
00080         if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
00081     }
00082     return 0;
00083 }

void zmemcpy ( Bytef dest,
const Bytef source,
uInt  len 
)

Definition at line 61 of file zutil.c.

00065 {
00066     if (len == 0) return;
00067     do {
00068         *dest++ = *source++; /* ??? to be unrolled */
00069     } while (--len != 0);
00070 }

void zmemzero ( Bytef dest,
uInt  len 
)

Definition at line 85 of file zutil.c.

00088 {
00089     if (len == 0) return;
00090     do {
00091         *dest++ = 0;  /* ??? to be unrolled */
00092     } while (--len != 0);
00093 }


Variable Documentation

const char* z_errmsg[10]
Initial value:
 {
"need dictionary",     
"stream end",          
"",                    
"file error",          
"stream error",        
"data error",          
"insufficient memory", 
"buffer error",        
"incompatible version",
""}

Definition at line 16 of file zutil.c.


Generated on 18 Mar 2013 for The SWORD Project by  doxygen 1.6.1