2013-12-16 13:45:57 +00:00
|
|
|
/* Copyright 2013 Google Inc. All Rights Reserved.
|
|
|
|
|
2015-12-11 10:11:51 +00:00
|
|
|
Distributed under MIT license.
|
2015-11-27 10:27:11 +00:00
|
|
|
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
|
2013-12-16 13:45:57 +00:00
|
|
|
*/
|
2013-10-11 08:26:07 +00:00
|
|
|
|
2015-03-20 14:44:15 +00:00
|
|
|
/* Common types */
|
|
|
|
|
2013-10-11 08:26:07 +00:00
|
|
|
#ifndef BROTLI_DEC_TYPES_H_
|
|
|
|
#define BROTLI_DEC_TYPES_H_
|
|
|
|
|
2013-12-16 13:45:57 +00:00
|
|
|
#include <stddef.h> /* for size_t */
|
2013-10-11 08:26:07 +00:00
|
|
|
|
2015-08-10 11:35:23 +00:00
|
|
|
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
2015-10-01 15:25:21 +00:00
|
|
|
typedef __int8 int8_t;
|
|
|
|
typedef unsigned __int8 uint8_t;
|
|
|
|
typedef __int16 int16_t;
|
|
|
|
typedef unsigned __int16 uint16_t;
|
|
|
|
typedef __int32 int32_t;
|
|
|
|
typedef unsigned __int32 uint32_t;
|
|
|
|
typedef unsigned __int64 uint64_t;
|
|
|
|
typedef __int64 int64_t;
|
2015-08-10 11:35:23 +00:00
|
|
|
#else
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif /* defined(_MSC_VER) && (_MSC_VER < 1600) */
|
2013-10-11 08:26:07 +00:00
|
|
|
|
2015-11-23 09:21:09 +00:00
|
|
|
/* Allocating function pointer. Function MUST return 0 in the case of failure.
|
|
|
|
Otherwise it MUST return a valid pointer to a memory region of at least
|
|
|
|
size length. Neither items nor size are allowed to be 0.
|
|
|
|
opaque argument is a pointer provided by client and could be used to bind
|
|
|
|
function to specific object (memory pool). */
|
2016-02-18 14:03:44 +00:00
|
|
|
typedef void* (*brotli_alloc_func)(void* opaque, size_t size);
|
2015-11-23 09:21:09 +00:00
|
|
|
|
|
|
|
/* Deallocating function pointer. Function SHOULD be no-op in the case the
|
|
|
|
address is 0. */
|
2016-02-18 14:03:44 +00:00
|
|
|
typedef void (*brotli_free_func)(void* opaque, void* address);
|
2015-11-23 09:21:09 +00:00
|
|
|
|
2013-12-16 13:45:57 +00:00
|
|
|
#endif /* BROTLI_DEC_TYPES_H_ */
|