XenevaOS
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
miniz_common.h File Reference
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "miniz_export.h"
#include <stdio.h>
Include dependency graph for miniz_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MZ_FALSE   (0)
 
#define MZ_TRUE   (1)
 
#define MZ_MACRO_END   while (0)
 
#define MZ_FILE   FILE
 
#define MZ_TIME_T   time_t
 
#define MZ_ASSERT(x)   assert(x)
 
#define MZ_MALLOC(x)   malloc(x)
 
#define MZ_FREE(x)   free(x)
 
#define MZ_REALLOC(p, x)   realloc(p, x)
 
#define MZ_MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define MZ_MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define MZ_CLEAR_OBJ(obj)   memset(&(obj), 0, sizeof(obj))
 
#define MZ_CLEAR_ARR(obj)   memset((obj), 0, sizeof(obj))
 
#define MZ_CLEAR_PTR(obj)   memset((obj), 0, sizeof(*obj))
 
#define MZ_READ_LE16(p)   ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U))
 
#define MZ_READ_LE32(p)   ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U))
 
#define MZ_READ_LE64(p)   (((mz_uint64)MZ_READ_LE32(p)) | (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) << 32U))
 
#define MZ_FORCEINLINE   inline
 
#define MZ_UINT16_MAX   (0xFFFFU)
 
#define MZ_UINT32_MAX   (0xFFFFFFFFU)
 

Typedefs

typedef unsigned char mz_uint8
 
typedef signed short mz_int16
 
typedef unsigned short mz_uint16
 
typedef unsigned int mz_uint32
 
typedef unsigned int mz_uint
 
typedef int64_t mz_int64
 
typedef uint64_t mz_uint64
 
typedef int mz_bool
 

Functions

MINIZ_EXPORT void * miniz_def_alloc_func (void *opaque, size_t items, size_t size)
 
MINIZ_EXPORT void miniz_def_free_func (void *opaque, void *address)
 
MINIZ_EXPORT void * miniz_def_realloc_func (void *opaque, void *address, size_t items, size_t size)
 

Macro Definition Documentation

◆ MZ_ASSERT

#define MZ_ASSERT (   x)    assert(x)

◆ MZ_CLEAR_ARR

#define MZ_CLEAR_ARR (   obj)    memset((obj), 0, sizeof(obj))

◆ MZ_CLEAR_OBJ

#define MZ_CLEAR_OBJ (   obj)    memset(&(obj), 0, sizeof(obj))

◆ MZ_CLEAR_PTR

#define MZ_CLEAR_PTR (   obj)    memset((obj), 0, sizeof(*obj))

◆ MZ_FALSE

#define MZ_FALSE   (0)

◆ MZ_FILE

#define MZ_FILE   FILE

◆ MZ_FORCEINLINE

#define MZ_FORCEINLINE   inline

◆ MZ_FREE

#define MZ_FREE (   x)    free(x)

◆ MZ_MACRO_END

#define MZ_MACRO_END   while (0)

◆ MZ_MALLOC

#define MZ_MALLOC (   x)    malloc(x)

◆ MZ_MAX

#define MZ_MAX (   a,
  b 
)    (((a) > (b)) ? (a) : (b))

◆ MZ_MIN

#define MZ_MIN (   a,
  b 
)    (((a) < (b)) ? (a) : (b))

◆ MZ_READ_LE16

#define MZ_READ_LE16 (   p)    ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U))

◆ MZ_READ_LE32

#define MZ_READ_LE32 (   p)    ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U))

◆ MZ_READ_LE64

#define MZ_READ_LE64 (   p)    (((mz_uint64)MZ_READ_LE32(p)) | (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) << 32U))

◆ MZ_REALLOC

#define MZ_REALLOC (   p,
  x 
)    realloc(p, x)

◆ MZ_TIME_T

#define MZ_TIME_T   time_t

◆ MZ_TRUE

#define MZ_TRUE   (1)

◆ MZ_UINT16_MAX

#define MZ_UINT16_MAX   (0xFFFFU)

◆ MZ_UINT32_MAX

#define MZ_UINT32_MAX   (0xFFFFFFFFU)

Typedef Documentation

◆ mz_bool

typedef int mz_bool

◆ mz_int16

typedef signed short mz_int16

◆ mz_int64

typedef int64_t mz_int64

◆ mz_uint

typedef unsigned int mz_uint

◆ mz_uint16

typedef unsigned short mz_uint16

◆ mz_uint32

typedef unsigned int mz_uint32

◆ mz_uint64

◆ mz_uint8

typedef unsigned char mz_uint8

Function Documentation

◆ miniz_def_alloc_func()

MINIZ_EXPORT void * miniz_def_alloc_func ( void *  opaque,
size_t  items,
size_t  size 
)
extern

◆ miniz_def_free_func()

MINIZ_EXPORT void miniz_def_free_func ( void *  opaque,
void *  address 
)
extern

◆ miniz_def_realloc_func()

MINIZ_EXPORT void * miniz_def_realloc_func ( void *  opaque,
void *  address,
size_t  items,
size_t  size 
)
extern