decode.h.3 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. .TH "decode.h" 3 "August 2021" "Brotli" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. decode.h \- API for Brotli decompression\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Macros"
  10. .in +1c
  11. .ti -1c
  12. .RI "#define \fBBROTLI_DECODER_ERROR_CODES_LIST\fP(BROTLI_ERROR_CODE, SEPARATOR) "
  13. .br
  14. .RI "\fITemplate that evaluates items of \fBBrotliDecoderErrorCode\fP\&. \fP"
  15. .ti -1c
  16. .RI "#define \fBBROTLI_LAST_ERROR_CODE\fP BROTLI_DECODER_ERROR_UNREACHABLE"
  17. .br
  18. .RI "\fIThe value of the last error code, negative integer\&. \fP"
  19. .in -1c
  20. .SS "Typedefs"
  21. .in +1c
  22. .ti -1c
  23. .RI "typedef void(* \fBbrotli_decoder_metadata_chunk_func\fP) (void *opaque, const uint8_t *data, size_t size)"
  24. .br
  25. .RI "\fICallback to fire on metadata block chunk becomes available\&. \fP"
  26. .ti -1c
  27. .RI "typedef void(* \fBbrotli_decoder_metadata_start_func\fP) (void *opaque, size_t size)"
  28. .br
  29. .RI "\fICallback to fire on metadata block start\&. \fP"
  30. .ti -1c
  31. .RI "typedef enum \fBBrotliDecoderParameter\fP \fBBrotliDecoderParameter\fP"
  32. .br
  33. .RI "\fIOptions to be used with \fBBrotliDecoderSetParameter\fP\&. \fP"
  34. .ti -1c
  35. .RI "typedef struct BrotliDecoderStateStruct \fBBrotliDecoderState\fP"
  36. .br
  37. .RI "\fIOpaque structure that holds decoder state\&. \fP"
  38. .in -1c
  39. .SS "Enumerations"
  40. .SS "Functions"
  41. .in +1c
  42. .ti -1c
  43. .RI "\fBBROTLI_BOOL\fP \fBBrotliDecoderAttachDictionary\fP (\fBBrotliDecoderState\fP *state, BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[data_size])"
  44. .br
  45. .RI "\fIAdds LZ77 prefix dictionary, adds or replaces built-in static dictionary and transforms\&. \fP"
  46. .ti -1c
  47. .RI "\fBBrotliDecoderState\fP * \fBBrotliDecoderCreateInstance\fP (\fBbrotli_alloc_func\fP alloc_func, \fBbrotli_free_func\fP free_func, void *opaque)"
  48. .br
  49. .RI "\fICreates an instance of \fBBrotliDecoderState\fP and initializes it\&. \fP"
  50. .ti -1c
  51. .RI "\fBBrotliDecoderResult\fP \fBBrotliDecoderDecompress\fP (size_t encoded_size, const uint8_t encoded_buffer[encoded_size], size_t *decoded_size, uint8_t decoded_buffer[*decoded_size])"
  52. .br
  53. .RI "\fIPerforms one-shot memory-to-memory decompression\&. \fP"
  54. .ti -1c
  55. .RI "\fBBrotliDecoderResult\fP \fBBrotliDecoderDecompressStream\fP (\fBBrotliDecoderState\fP *state, size_t *available_in, const uint8_t **next_in, size_t *available_out, uint8_t **next_out, size_t *total_out)"
  56. .br
  57. .RI "\fIDecompresses the input stream to the output stream\&. \fP"
  58. .ti -1c
  59. .RI "void \fBBrotliDecoderDestroyInstance\fP (\fBBrotliDecoderState\fP *state)"
  60. .br
  61. .RI "\fIDeinitializes and frees \fBBrotliDecoderState\fP instance\&. \fP"
  62. .ti -1c
  63. .RI "const char * \fBBrotliDecoderErrorString\fP (\fBBrotliDecoderErrorCode\fP c)"
  64. .br
  65. .RI "\fIConverts error code to a c-string\&. \fP"
  66. .ti -1c
  67. .RI "\fBBrotliDecoderErrorCode\fP \fBBrotliDecoderGetErrorCode\fP (const \fBBrotliDecoderState\fP *state)"
  68. .br
  69. .RI "\fIAcquires a detailed error code\&. \fP"
  70. .ti -1c
  71. .RI "\fBBROTLI_BOOL\fP \fBBrotliDecoderHasMoreOutput\fP (const \fBBrotliDecoderState\fP *state)"
  72. .br
  73. .RI "\fIChecks if decoder has more output\&. \fP"
  74. .ti -1c
  75. .RI "\fBBROTLI_BOOL\fP \fBBrotliDecoderIsFinished\fP (const \fBBrotliDecoderState\fP *state)"
  76. .br
  77. .RI "\fIChecks if decoder instance reached the final state\&. \fP"
  78. .ti -1c
  79. .RI "\fBBROTLI_BOOL\fP \fBBrotliDecoderIsUsed\fP (const \fBBrotliDecoderState\fP *state)"
  80. .br
  81. .RI "\fIChecks if instance has already consumed input\&. \fP"
  82. .ti -1c
  83. .RI "void \fBBrotliDecoderSetMetadataCallbacks\fP (\fBBrotliDecoderState\fP *state, \fBbrotli_decoder_metadata_start_func\fP start_func, \fBbrotli_decoder_metadata_chunk_func\fP chunk_func, void *opaque)"
  84. .br
  85. .RI "\fISets callback for receiving metadata blocks\&. \fP"
  86. .ti -1c
  87. .RI "\fBBROTLI_BOOL\fP \fBBrotliDecoderSetParameter\fP (\fBBrotliDecoderState\fP *state, \fBBrotliDecoderParameter\fP param, uint32_t value)"
  88. .br
  89. .RI "\fISets the specified parameter to the given decoder instance\&. \fP"
  90. .ti -1c
  91. .RI "const uint8_t * \fBBrotliDecoderTakeOutput\fP (\fBBrotliDecoderState\fP *state, size_t *size)"
  92. .br
  93. .RI "\fIAcquires pointer to internal output buffer\&. \fP"
  94. .ti -1c
  95. .RI "uint32_t \fBBrotliDecoderVersion\fP (void)"
  96. .br
  97. .RI "\fIGets a decoder library version\&. \fP"
  98. .in -1c
  99. .SH "Detailed Description"
  100. .PP
  101. API for Brotli decompression\&.
  102. .SH "Macro Definition Documentation"
  103. .PP
  104. .SS "#define BROTLI_DECODER_ERROR_CODES_LIST(BROTLI_ERROR_CODE, SEPARATOR)"
  105. .PP
  106. Template that evaluates items of \fBBrotliDecoderErrorCode\fP\&. Example:
  107. .PP
  108. .nf
  109. // Log Brotli error code\&.
  110. switch (brotliDecoderErrorCode) {
  111. #define CASE_(PREFIX, NAME, CODE) \
  112. case BROTLI_DECODER ## PREFIX ## NAME: \
  113. LOG(INFO) << "error code:" << #NAME; \
  114. break;
  115. #define NEWLINE_
  116. BROTLI_DECODER_ERROR_CODES_LIST(CASE_, NEWLINE_)
  117. #undef CASE_
  118. #undef NEWLINE_
  119. default: LOG(FATAL) << "unknown brotli error code";
  120. }
  121. .fi
  122. .PP
  123. .SS "#define BROTLI_LAST_ERROR_CODE BROTLI_DECODER_ERROR_UNREACHABLE"
  124. .PP
  125. The value of the last error code, negative integer\&. All other error code values are in the range from \fBBROTLI_LAST_ERROR_CODE\fP to \fC-1\fP\&. There are also 4 other possible non-error codes \fC0\fP \&.\&. \fC3\fP in \fBBrotliDecoderErrorCode\fP enumeration\&.
  126. .SH "Typedef Documentation"
  127. .PP
  128. .SS "typedef void(* brotli_decoder_metadata_chunk_func) (void *opaque, const uint8_t *data, size_t size)"
  129. .PP
  130. Callback to fire on metadata block chunk becomes available\&. This function can be invoked multiple times per metadata block; block should be considered finished when sum of \fCsize\fP matches the announced metadata block size\&. Chunks contents pointed by \fCdata\fP are transient and shouln not be accessed after leaving the callback\&.
  131. .PP
  132. \fBParameters:\fP
  133. .RS 4
  134. \fIopaque\fP callback handle
  135. .br
  136. \fIdata\fP pointer to metadata contents
  137. .br
  138. \fIsize\fP size of metadata block chunk, at least \fC1\fP
  139. .RE
  140. .PP
  141. .SS "typedef void(* brotli_decoder_metadata_start_func) (void *opaque, size_t size)"
  142. .PP
  143. Callback to fire on metadata block start\&. After this callback is fired, if \fCsize\fP is not \fC0\fP, it is followed by \fBbrotli_decoder_metadata_chunk_func\fP as more metadata block contents become accessible\&.
  144. .PP
  145. \fBParameters:\fP
  146. .RS 4
  147. \fIopaque\fP callback handle
  148. .br
  149. \fIsize\fP size of metadata block
  150. .RE
  151. .PP
  152. .SS "typedef enum \fBBrotliDecoderParameter\fP \fBBrotliDecoderParameter\fP"
  153. .PP
  154. Options to be used with \fBBrotliDecoderSetParameter\fP\&.
  155. .SS "typedef struct BrotliDecoderStateStruct \fBBrotliDecoderState\fP"
  156. .PP
  157. Opaque structure that holds decoder state\&. Allocated and initialized with \fBBrotliDecoderCreateInstance\fP\&. Cleaned up and deallocated with \fBBrotliDecoderDestroyInstance\fP\&.
  158. .SH "Enumeration Type Documentation"
  159. .PP
  160. .SS "enum \fBBrotliDecoderErrorCode\fP"
  161. .PP
  162. Error code for detailed logging / production debugging\&. See \fBBrotliDecoderGetErrorCode\fP and \fBBROTLI_LAST_ERROR_CODE\fP\&.
  163. .SS "enum \fBBrotliDecoderParameter\fP"
  164. .PP
  165. Options to be used with \fBBrotliDecoderSetParameter\fP\&.
  166. .PP
  167. \fBEnumerator\fP
  168. .in +1c
  169. .TP
  170. \fB\fIBROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION \fP\fP
  171. Disable 'canny' ring buffer allocation strategy\&. Ring buffer is allocated according to window size, despite the real size of the content\&.
  172. .TP
  173. \fB\fIBROTLI_DECODER_PARAM_LARGE_WINDOW \fP\fP
  174. Flag that determines if 'Large Window Brotli' is used\&.
  175. .SS "enum \fBBrotliDecoderResult\fP"
  176. .PP
  177. Result type for \fBBrotliDecoderDecompress\fP and \fBBrotliDecoderDecompressStream\fP functions\&.
  178. .PP
  179. \fBEnumerator\fP
  180. .in +1c
  181. .TP
  182. \fB\fIBROTLI_DECODER_RESULT_ERROR \fP\fP
  183. Decoding error, e\&.g\&. corrupted input or memory allocation problem\&.
  184. .TP
  185. \fB\fIBROTLI_DECODER_RESULT_SUCCESS \fP\fP
  186. Decoding successfully completed\&.
  187. .TP
  188. \fB\fIBROTLI_DECODER_RESULT_NEEDS_MORE_INPUT \fP\fP
  189. Partially done; should be called again with more input\&.
  190. .TP
  191. \fB\fIBROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT \fP\fP
  192. Partially done; should be called again with more output\&.
  193. .SH "Function Documentation"
  194. .PP
  195. .SS "\fBBROTLI_BOOL\fP BrotliDecoderAttachDictionary (\fBBrotliDecoderState\fP * state, BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[data_size])"
  196. .PP
  197. Adds LZ77 prefix dictionary, adds or replaces built-in static dictionary and transforms\&. Attached dictionary ownership is not transferred\&. Data provided to this method should be kept accessible until decoding is finished and decoder instance is destroyed\&.
  198. .PP
  199. \fBNote:\fP
  200. .RS 4
  201. Dictionaries can NOT be attached after actual decoding is started\&.
  202. .RE
  203. .PP
  204. \fBParameters:\fP
  205. .RS 4
  206. \fIstate\fP decoder instance
  207. .br
  208. \fItype\fP dictionary data format
  209. .br
  210. \fIdata_size\fP length of memory region pointed by \fCdata\fP
  211. .br
  212. \fIdata\fP dictionary data in format corresponding to \fCtype\fP
  213. .RE
  214. .PP
  215. \fBReturns:\fP
  216. .RS 4
  217. \fBBROTLI_FALSE\fP if dictionary is corrupted, or dictionary count limit is reached
  218. .PP
  219. \fBBROTLI_TRUE\fP if dictionary is accepted / attached
  220. .RE
  221. .PP
  222. .SS "\fBBrotliDecoderState\fP* BrotliDecoderCreateInstance (\fBbrotli_alloc_func\fP alloc_func, \fBbrotli_free_func\fP free_func, void * opaque)"
  223. .PP
  224. Creates an instance of \fBBrotliDecoderState\fP and initializes it\&. The instance can be used once for decoding and should then be destroyed with \fBBrotliDecoderDestroyInstance\fP, it cannot be reused for a new decoding session\&.
  225. .PP
  226. \fCalloc_func\fP and \fCfree_func\fP \fBMUST\fP be both zero or both non-zero\&. In the case they are both zero, default memory allocators are used\&. \fCopaque\fP is passed to \fCalloc_func\fP and \fCfree_func\fP when they are called\&. \fCfree_func\fP has to return without doing anything when asked to free a NULL pointer\&.
  227. .PP
  228. \fBParameters:\fP
  229. .RS 4
  230. \fIalloc_func\fP custom memory allocation function
  231. .br
  232. \fIfree_func\fP custom memory free function
  233. .br
  234. \fIopaque\fP custom memory manager handle
  235. .RE
  236. .PP
  237. \fBReturns:\fP
  238. .RS 4
  239. \fC0\fP if instance can not be allocated or initialized
  240. .PP
  241. pointer to initialized \fBBrotliDecoderState\fP otherwise
  242. .RE
  243. .PP
  244. .SS "\fBBrotliDecoderResult\fP BrotliDecoderDecompress (size_t encoded_size, const uint8_t encoded_buffer[encoded_size], size_t * decoded_size, uint8_t decoded_buffer[*decoded_size])"
  245. .PP
  246. Performs one-shot memory-to-memory decompression\&. Decompresses the data in \fCencoded_buffer\fP into \fCdecoded_buffer\fP, and sets \fC*decoded_size\fP to the decompressed length\&.
  247. .PP
  248. \fBParameters:\fP
  249. .RS 4
  250. \fIencoded_size\fP size of \fCencoded_buffer\fP
  251. .br
  252. \fIencoded_buffer\fP compressed data buffer with at least \fCencoded_size\fP addressable bytes
  253. .br
  254. \fIdecoded_size\fP \fBin:\fP size of \fCdecoded_buffer\fP;
  255. .br
  256. \fBout:\fP length of decompressed data written to \fCdecoded_buffer\fP
  257. .br
  258. \fIdecoded_buffer\fP decompressed data destination buffer
  259. .RE
  260. .PP
  261. \fBReturns:\fP
  262. .RS 4
  263. \fBBROTLI_DECODER_RESULT_ERROR\fP if input is corrupted, memory allocation failed, or \fCdecoded_buffer\fP is not large enough;
  264. .PP
  265. \fBBROTLI_DECODER_RESULT_SUCCESS\fP otherwise
  266. .RE
  267. .PP
  268. .SS "\fBBrotliDecoderResult\fP BrotliDecoderDecompressStream (\fBBrotliDecoderState\fP * state, size_t * available_in, const uint8_t ** next_in, size_t * available_out, uint8_t ** next_out, size_t * total_out)"
  269. .PP
  270. Decompresses the input stream to the output stream\&. The values \fC*available_in\fP and \fC*available_out\fP must specify the number of bytes addressable at \fC*next_in\fP and \fC*next_out\fP respectively\&. When \fC*available_out\fP is \fC0\fP, \fCnext_out\fP is allowed to be \fCNULL\fP\&.
  271. .PP
  272. After each call, \fC*available_in\fP will be decremented by the amount of input bytes consumed, and the \fC*next_in\fP pointer will be incremented by that amount\&. Similarly, \fC*available_out\fP will be decremented by the amount of output bytes written, and the \fC*next_out\fP pointer will be incremented by that amount\&.
  273. .PP
  274. \fCtotal_out\fP, if it is not a null-pointer, will be set to the number of bytes decompressed since the last \fCstate\fP initialization\&.
  275. .PP
  276. \fBNote:\fP
  277. .RS 4
  278. Input is never overconsumed, so \fCnext_in\fP and \fCavailable_in\fP could be passed to the next consumer after decoding is complete\&.
  279. .RE
  280. .PP
  281. \fBParameters:\fP
  282. .RS 4
  283. \fIstate\fP decoder instance
  284. .br
  285. \fIavailable_in\fP \fBin:\fP amount of available input;
  286. .br
  287. \fBout:\fP amount of unused input
  288. .br
  289. \fInext_in\fP pointer to the next compressed byte
  290. .br
  291. \fIavailable_out\fP \fBin:\fP length of output buffer;
  292. .br
  293. \fBout:\fP remaining size of output buffer
  294. .br
  295. \fInext_out\fP output buffer cursor; can be \fCNULL\fP if \fCavailable_out\fP is \fC0\fP
  296. .br
  297. \fItotal_out\fP number of bytes decompressed so far; can be \fCNULL\fP
  298. .RE
  299. .PP
  300. \fBReturns:\fP
  301. .RS 4
  302. \fBBROTLI_DECODER_RESULT_ERROR\fP if input is corrupted, memory allocation failed, arguments were invalid, etc\&.; use \fBBrotliDecoderGetErrorCode\fP to get detailed error code
  303. .PP
  304. \fBBROTLI_DECODER_RESULT_NEEDS_MORE_INPUT\fP decoding is blocked until more input data is provided
  305. .PP
  306. \fBBROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT\fP decoding is blocked until more output space is provided
  307. .PP
  308. \fBBROTLI_DECODER_RESULT_SUCCESS\fP decoding is finished, no more input might be consumed and no more output will be produced
  309. .RE
  310. .PP
  311. .SS "void BrotliDecoderDestroyInstance (\fBBrotliDecoderState\fP * state)"
  312. .PP
  313. Deinitializes and frees \fBBrotliDecoderState\fP instance\&.
  314. .PP
  315. \fBParameters:\fP
  316. .RS 4
  317. \fIstate\fP decoder instance to be cleaned up and deallocated
  318. .RE
  319. .PP
  320. .SS "\fBBrotliDecoderErrorCode\fP BrotliDecoderGetErrorCode (const \fBBrotliDecoderState\fP * state)"
  321. .PP
  322. Acquires a detailed error code\&. Should be used only after \fBBrotliDecoderDecompressStream\fP returns \fBBROTLI_DECODER_RESULT_ERROR\fP\&.
  323. .PP
  324. See also \fBBrotliDecoderErrorString\fP
  325. .PP
  326. \fBParameters:\fP
  327. .RS 4
  328. \fIstate\fP decoder instance
  329. .RE
  330. .PP
  331. \fBReturns:\fP
  332. .RS 4
  333. last saved error code
  334. .RE
  335. .PP
  336. .SS "\fBBROTLI_BOOL\fP BrotliDecoderHasMoreOutput (const \fBBrotliDecoderState\fP * state)"
  337. .PP
  338. Checks if decoder has more output\&.
  339. .PP
  340. \fBParameters:\fP
  341. .RS 4
  342. \fIstate\fP decoder instance
  343. .RE
  344. .PP
  345. \fBReturns:\fP
  346. .RS 4
  347. \fBBROTLI_TRUE\fP, if decoder has some unconsumed output
  348. .PP
  349. \fBBROTLI_FALSE\fP otherwise
  350. .RE
  351. .PP
  352. .SS "\fBBROTLI_BOOL\fP BrotliDecoderIsFinished (const \fBBrotliDecoderState\fP * state)"
  353. .PP
  354. Checks if decoder instance reached the final state\&.
  355. .PP
  356. \fBParameters:\fP
  357. .RS 4
  358. \fIstate\fP decoder instance
  359. .RE
  360. .PP
  361. \fBReturns:\fP
  362. .RS 4
  363. \fBBROTLI_TRUE\fP if decoder is in a state where it reached the end of the input and produced all of the output
  364. .PP
  365. \fBBROTLI_FALSE\fP otherwise
  366. .RE
  367. .PP
  368. .SS "\fBBROTLI_BOOL\fP BrotliDecoderIsUsed (const \fBBrotliDecoderState\fP * state)"
  369. .PP
  370. Checks if instance has already consumed input\&. Instance that returns \fBBROTLI_FALSE\fP is considered 'fresh' and could be reused\&.
  371. .PP
  372. \fBParameters:\fP
  373. .RS 4
  374. \fIstate\fP decoder instance
  375. .RE
  376. .PP
  377. \fBReturns:\fP
  378. .RS 4
  379. \fBBROTLI_TRUE\fP if decoder has already used some input bytes
  380. .PP
  381. \fBBROTLI_FALSE\fP otherwise
  382. .RE
  383. .PP
  384. .SS "void BrotliDecoderSetMetadataCallbacks (\fBBrotliDecoderState\fP * state, \fBbrotli_decoder_metadata_start_func\fP start_func, \fBbrotli_decoder_metadata_chunk_func\fP chunk_func, void * opaque)"
  385. .PP
  386. Sets callback for receiving metadata blocks\&.
  387. .PP
  388. \fBParameters:\fP
  389. .RS 4
  390. \fIstate\fP decoder instance
  391. .br
  392. \fIstart_func\fP callback on metadata block start
  393. .br
  394. \fIchunk_func\fP callback on metadata block chunk
  395. .br
  396. \fIopaque\fP callback handle
  397. .RE
  398. .PP
  399. .SS "\fBBROTLI_BOOL\fP BrotliDecoderSetParameter (\fBBrotliDecoderState\fP * state, \fBBrotliDecoderParameter\fP param, uint32_t value)"
  400. .PP
  401. Sets the specified parameter to the given decoder instance\&.
  402. .PP
  403. \fBParameters:\fP
  404. .RS 4
  405. \fIstate\fP decoder instance
  406. .br
  407. \fIparam\fP parameter to set
  408. .br
  409. \fIvalue\fP new parameter value
  410. .RE
  411. .PP
  412. \fBReturns:\fP
  413. .RS 4
  414. \fBBROTLI_FALSE\fP if parameter is unrecognized, or value is invalid
  415. .PP
  416. \fBBROTLI_TRUE\fP if value is accepted
  417. .RE
  418. .PP
  419. .SS "const uint8_t* BrotliDecoderTakeOutput (\fBBrotliDecoderState\fP * state, size_t * size)"
  420. .PP
  421. Acquires pointer to internal output buffer\&. This method is used to make language bindings easier and more efficient:
  422. .IP "1." 4
  423. push data to \fBBrotliDecoderDecompressStream\fP, until \fBBROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT\fP is reported
  424. .IP "2." 4
  425. use \fBBrotliDecoderTakeOutput\fP to peek bytes and copy to language-specific entity
  426. .PP
  427. .PP
  428. Also this could be useful if there is an output stream that is able to consume all the provided data (e\&.g\&. when data is saved to file system)\&.
  429. .PP
  430. \fBAttention:\fP
  431. .RS 4
  432. After every call to \fBBrotliDecoderTakeOutput\fP \fC*size\fP bytes of output are considered consumed for all consecutive calls to the instance methods; returned pointer becomes invalidated as well\&.
  433. .RE
  434. .PP
  435. \fBNote:\fP
  436. .RS 4
  437. Decoder output is not guaranteed to be contiguous\&. This means that after the size-unrestricted call to \fBBrotliDecoderTakeOutput\fP, immediate next call to \fBBrotliDecoderTakeOutput\fP may return more data\&.
  438. .RE
  439. .PP
  440. \fBParameters:\fP
  441. .RS 4
  442. \fIstate\fP decoder instance
  443. .br
  444. \fIsize\fP \fBin:\fP number of bytes caller is ready to take, \fC0\fP if any amount could be handled;
  445. .br
  446. \fBout:\fP amount of data pointed by returned pointer and considered consumed;
  447. .br
  448. out value is never greater than in value, unless it is \fC0\fP
  449. .RE
  450. .PP
  451. \fBReturns:\fP
  452. .RS 4
  453. pointer to output data
  454. .RE
  455. .PP
  456. .SS "uint32_t BrotliDecoderVersion (void)"
  457. .PP
  458. Gets a decoder library version\&. Look at BROTLI_MAKE_HEX_VERSION for more information\&.
  459. .SH "Author"
  460. .PP
  461. Generated automatically by Doxygen for Brotli from the source code\&.