2021-08-31 12:07:17 +00:00
.TH "types.h" 3 "August 2021" "Brotli" \" -*- nroff -*-
2017-02-28 15:59:52 +00:00
.ad l
.nh
.SH NAME
types.h \- Common types used in decoder and encoder API\& .
.SH SYNOPSIS
.br
.PP
.SS "Macros"
.in +1c
.ti -1c
.RI "#define \fBBROTLI_BOOL\fP int"
.br
.RI "\fIA portable \fCbool\fP replacement\&. \fP"
.ti -1c
.RI "#define \fBBROTLI_FALSE\fP 0"
.br
.RI "\fIPortable \fCfalse\fP replacement\&. \fP"
.ti -1c
.RI "#define \fBBROTLI_TRUE\fP 1"
.br
.RI "\fIPortable \fCtrue\fP replacement\&. \fP"
.ti -1c
.RI "#define \fBTO_BROTLI_BOOL\fP(X) (!!(X) ? \fBBROTLI_TRUE\fP : \fBBROTLI_FALSE\fP)"
.br
.RI "\fI\fCbool\fP to \fBBROTLI_BOOL\fP conversion macros\&. \fP"
.in -1c
.SS "Typedefs"
.in +1c
.ti -1c
.RI "typedef void *(* \fBbrotli_alloc_func\fP) (void *opaque, size_t size)"
.br
.RI "\fIAllocating function pointer type\&. \fP"
.ti -1c
.RI "typedef void(* \fBbrotli_free_func\fP) (void *opaque, void *address)"
.br
.RI "\fIDeallocating function pointer type\&. \fP"
.in -1c
.SH "Detailed Description"
.PP
Common types used in decoder and encoder API\& .
.SH "Macro Definition Documentation"
.PP
.SS "#define BROTLI_BOOL int"
.PP
A portable \fC bool\fP replacement\& . \fB BROTLI_BOOL\fP is a 'documentation' type: actually it is \fC int\fP , but in API it denotes a type, whose only values are \fB BROTLI_TRUE\fP and \fB BROTLI_FALSE\fP \& .
.PP
\fB BROTLI_BOOL\fP values passed to Brotli should either be \fB BROTLI_TRUE\fP or \fB BROTLI_FALSE\fP , or be a result of \fB TO_BROTLI_BOOL\fP macros\& .
.PP
\fB BROTLI_BOOL\fP values returned by Brotli should not be tested for equality with \fC true\fP , \fC false\fP , \fB BROTLI_TRUE\fP , \fB BROTLI_FALSE\fP , but rather should be evaluated, for example:
.PP
.nf
if (SomeBrotliFunction(encoder, BROTLI_TRUE) &&
!OtherBrotliFunction(decoder, BROTLI_FALSE)) {
bool x = !!YetAnotherBrotliFunction(encoder, TO_BROLTI_BOOL(2 * 2 == 4));
DoSomething(x);
}
.fi
.PP
.SS "#define BROTLI_FALSE 0"
.PP
Portable \fC false\fP replacement\& .
.SS "#define BROTLI_TRUE 1"
.PP
Portable \fC true\fP replacement\& .
.SS "#define TO_BROTLI_BOOL(X) (!!(X) ? \fBBROTLI_TRUE\fP : \fBBROTLI_FALSE\fP)"
.PP
\fC bool\fP to \fB BROTLI_BOOL\fP conversion macros\& .
.SH "Typedef Documentation"
.PP
.SS "typedef void*(* brotli_alloc_func) (void *opaque, size_t size)"
.PP
Allocating function pointer type\& .
.PP
\fB Parameters:\fP
.RS 4
\fI opaque\fP custom memory manager handle provided by client
.br
\fI size\fP requested memory region size; can not be \fC 0\fP
.RE
.PP
\fB Returns:\fP
.RS 4
\fC 0\fP in the case of failure
.PP
a valid pointer to a memory region of at least \fC size\fP bytes long otherwise
.RE
.PP
.SS "typedef void(* brotli_free_func) (void *opaque, void *address)"
.PP
Deallocating function pointer type\& . This function \fB SHOULD\fP do nothing if \fC address\fP is \fC 0\fP \& .
.PP
\fB Parameters:\fP
.RS 4
\fI opaque\fP custom memory manager handle provided by client
.br
\fI address\fP memory region pointer returned by \fB brotli_alloc_func\fP , or \fC 0\fP
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Brotli from the source code\& .