wxMaxima
Loading...
Searching...
No Matches
Macros | Typedefs
types.h File Reference

Common types used in decoder and encoder API. More...

#include <stddef.h>
#include <stdint.h>
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BROTLI_BOOL   int
 A portable bool replacement.
 
#define BROTLI_TRUE   1
 Portable true replacement.
 
#define BROTLI_FALSE   0
 Portable false replacement.
 
#define TO_BROTLI_BOOL(X)   (!!(X) ? BROTLI_TRUE : BROTLI_FALSE)
 bool to BROTLI_BOOL conversion macros.
 
#define BROTLI_MAKE_UINT64_T(high, low)   ((((uint64_t)(high)) << 32) | low)
 
#define BROTLI_UINT32_MAX   (~((uint32_t)0))
 
#define BROTLI_SIZE_MAX   (~((size_t)0))
 

Typedefs

typedef void *(* brotli_alloc_func) (void *opaque, size_t size)
 Allocating function pointer type.
 
typedef void(* brotli_free_func) (void *opaque, void *address)
 Deallocating function pointer type.
 

Detailed Description

Common types used in decoder and encoder API.

Macro Definition Documentation

◆ BROTLI_BOOL

#define BROTLI_BOOL   int

A portable bool replacement.

BROTLI_BOOL is a "documentation" type: actually it is int, but in API it denotes a type, whose only values are BROTLI_TRUE and BROTLI_FALSE.

BROTLI_BOOL values passed to Brotli should either be BROTLI_TRUE or BROTLI_FALSE, or be a result of TO_BROTLI_BOOL macros.

BROTLI_BOOL values returned by Brotli should not be tested for equality with true, false, BROTLI_TRUE, BROTLI_FALSE, but rather should be evaluated, for example:

if (SomeBrotliFunction(encoder, BROTLI_TRUE) &&
!OtherBrotliFunction(decoder, BROTLI_FALSE)) {
bool x = !!YetAnotherBrotliFunction(encoder, TO_BROLTI_BOOL(2 * 2 == 4));
DoSomething(x);
}
#define BROTLI_TRUE
Portable true replacement.
Definition: types.h:51
#define BROTLI_FALSE
Portable false replacement.
Definition: types.h:53

Typedef Documentation

◆ brotli_alloc_func

typedef void *(* brotli_alloc_func) (void *opaque, size_t size)

Allocating function pointer type.

Parameters
opaquecustom memory manager handle provided by client
sizerequested memory region size; can not be 0
Returns
0 in the case of failure
a valid pointer to a memory region of at least size bytes long otherwise

◆ brotli_free_func

typedef void(* brotli_free_func) (void *opaque, void *address)

Deallocating function pointer type.

This function SHOULD do nothing if address is 0.

Parameters
opaquecustom memory manager handle provided by client
addressmemory region pointer returned by brotli_alloc_func, or 0