Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
zutil.c File Reference
#include "zutil.h"

Go to the source code of this file.

Classes

struct  internal_state

Functions

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

Variables

const char *const z_errmsg [10]

Class Documentation

struct internal_state

Definition at line 94 of file deflate.h.

Collaboration diagram for internal_state:
Class Members
ush bi_buf
int bi_valid
ush bl_count
long block_start
ushf * d_buf
uch depth
int dummy
uInt good_match
gz_headerp gzhead
uInt gzindex
uInt hash_bits
uInt hash_mask
uInt hash_shift
uInt hash_size
Posf * head
int heap
int heap_len
int heap_max
uInt ins_h
uchf * l_buf
int last_eob_len
int last_flush
uInt last_lit
int level
uInt lit_bufsize
uInt lookahead
int match_available
uInt match_length
uInt match_start
uInt matches
uInt max_chain_length
uInt max_lazy_match
Byte method
int nice_match
ulg opt_len
uInt pending
Bytef * pending_buf
ulg pending_buf_size
Bytef * pending_out
Posf * prev
uInt prev_length
IPos prev_match
ulg static_len
int status
int strategy
z_streamp strm
uInt strstart
uInt w_bits
uInt w_mask
uInt w_size
Bytef * window
ulg window_size
int wrap

Function Documentation

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

Definition at line 300 of file zutil.c.

{
    if (opaque) items += size - size; /* make compiler happy */
    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
                              (voidpf)calloc(items, size);
}

Here is the call graph for this function:

void zcfree ( voidpf  opaque,
voidpf  ptr 
)

Definition at line 310 of file zutil.c.

{
    free(ptr);
    if (opaque) return; /* make compiler happy */
}
const char* ZEXPORT zError ( int  err)

Definition at line 133 of file zutil.c.

{
    return ERR_MSG(err);
}

Definition at line 32 of file zutil.c.

{
    uLong flags;

    flags = 0;
    switch (sizeof(uInt)) {
    case 2:     break;
    case 4:     flags += 1;     break;
    case 8:     flags += 2;     break;
    default:    flags += 3;
    }
    switch (sizeof(uLong)) {
    case 2:     break;
    case 4:     flags += 1 << 2;        break;
    case 8:     flags += 2 << 2;        break;
    default:    flags += 3 << 2;
    }
    switch (sizeof(voidpf)) {
    case 2:     break;
    case 4:     flags += 1 << 4;        break;
    case 8:     flags += 2 << 4;        break;
    default:    flags += 3 << 4;
    }
    switch (sizeof(z_off_t)) {
    case 2:     break;
    case 4:     flags += 1 << 6;        break;
    case 8:     flags += 2 << 6;        break;
    default:    flags += 3 << 6;
    }
#ifdef DEBUG
    flags += 1 << 8;
#endif
#if defined(ASMV) || defined(ASMINF)
    flags += 1 << 9;
#endif
#ifdef ZLIB_WINAPI
    flags += 1 << 10;
#endif
#ifdef BUILDFIXED
    flags += 1 << 12;
#endif
#ifdef DYNAMIC_CRC_TABLE
    flags += 1 << 13;
#endif
#ifdef NO_GZCOMPRESS
    flags += 1L << 16;
#endif
#ifdef NO_GZIP
    flags += 1L << 17;
#endif
#ifdef PKZIP_BUG_WORKAROUND
    flags += 1L << 20;
#endif
#ifdef FASTEST
    flags += 1L << 21;
#endif
#ifdef STDC
#  ifdef NO_vsnprintf
        flags += 1L << 25;
#    ifdef HAS_vsprintf_void
        flags += 1L << 26;
#    endif
#  else
#    ifdef HAS_vsnprintf_void
        flags += 1L << 26;
#    endif
#  endif
#else
        flags += 1L << 24;
#  ifdef NO_snprintf
        flags += 1L << 25;
#    ifdef HAS_sprintf_void
        flags += 1L << 26;
#    endif
#  else
#    ifdef HAS_snprintf_void
        flags += 1L << 26;
#    endif
#  endif
#endif
    return flags;
}

Definition at line 27 of file zutil.c.

{
    return ZLIB_VERSION;
}
int zmemcmp ( Bytef s1,
const Bytef s2,
uInt  len 
) const

Definition at line 160 of file zutil.c.

{
    uInt j;

    for (j = 0; j < len; j++) {
        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
    }
    return 0;
}
void zmemcpy ( Bytef dest,
const Bytef source,
uInt  len 
)

Definition at line 149 of file zutil.c.

{
    if (len == 0) return;
    do {
        *dest++ = *source++; /* ??? to be unrolled */
    } while (--len != 0);
}
void zmemzero ( Bytef dest,
uInt  len 
)

Definition at line 173 of file zutil.c.

{
    if (len == 0) return;
    do {
        *dest++ = 0;  /* ??? to be unrolled */
    } while (--len != 0);
}

Variable Documentation

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

Definition at line 14 of file zutil.c.