Skip to content

Commit d4e1c21

Browse files
pablodelaramdcornu
authored andcommitted
lib: add missing structure documentation
Signed-off-by: Pablo de Lara <[email protected]>
1 parent 4997190 commit d4e1c21

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

include/igzip_lib.h

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,10 @@ struct isal_huff_histogram {
264264
uint16_t hash_table[IGZIP_LVL0_HASH_SIZE]; //!< Tmp space used as a hash table
265265
};
266266

267+
/** @brief Holds modified histogram */
267268
struct isal_mod_hist {
268-
uint32_t d_hist[30];
269-
uint32_t ll_hist[513];
269+
uint32_t d_hist[30]; //!< Distance
270+
uint32_t ll_hist[513]; //! Literal/length
270271
};
271272

272273
#define ISAL_DEF_MIN_LEVEL 0
@@ -325,17 +326,19 @@ struct BitBuf2 {
325326
uint8_t *m_out_start; //!< start of buffer to write to
326327
};
327328

329+
/** @brief Holds Zlib header information */
328330
struct isal_zlib_header {
329331
uint32_t info; //!< base-2 logarithm of the LZ77 window size minus 8
330332
uint32_t level; //!< Compression level (fastest, fast, default, maximum)
331333
uint32_t dict_id; //!< Dictionary id
332334
uint32_t dict_flag; //!< Whether to use a dictionary
333335
};
334336

337+
/** @brief Holds Gzip header information */
335338
struct isal_gzip_header {
336339
uint32_t text; //!< Optional Text hint
337340
uint32_t time; //!< Unix modification time in gzip header
338-
uint32_t xflags; //!< xflags in gzip header
341+
uint32_t xflags; //!< xflags in gzip header
339342
uint32_t os; //!< OS in gzip header
340343
uint8_t *extra; //!< Extra field in gzip header
341344
uint32_t extra_buf_len; //!< Length of extra buffer
@@ -421,11 +424,11 @@ struct isal_zstream {
421424
/******************************************************************************/
422425
/*
423426
* Inflate_huff_code data structures are used to store a Huffman code for fast
424-
* lookup. It works by performing a lookup in small_code_lookup that hopefully
427+
* lookup. It works by performing a lookup in short_code_lookup that hopefully
425428
* yields the correct symbol. Otherwise a lookup into long_code_lookup is
426429
* performed to find the correct symbol. The details of how this works follows:
427430
*
428-
* Let i be some index into small_code_lookup and let e be the associated
431+
* Let i be some index into short_code_lookup and let e be the associated
429432
* element. Bit 15 in e is a flag. If bit 15 is not set, then index i contains
430433
* a Huffman code for a symbol which has length at most DECODE_LOOKUP_SIZE. Bits
431434
* 0 through 8 are the symbol associated with that code and bits 9 through 12 of
@@ -437,11 +440,11 @@ struct isal_zstream {
437440
* index i. The offset into long_code_lookup is for an array associated with all
438441
* codes which start with the bits in i.
439442
*
440-
* The elements of long_code_lookup are in the same format as small_code_lookup,
443+
* The elements of long_code_lookup are in the same format as short_code_lookup,
441444
* except bit 15 is never set. Let i be a number made up of DECODE_LOOKUP_SIZE
442445
* bits. Then all Huffman codes which start with DECODE_LOOKUP_SIZE bits are
443446
* stored in an array starting at index h in long_code_lookup. This index h is
444-
* stored in bits 0 through 9 at index i in small_code_lookup. The index j is an
447+
* stored in bits 0 through 9 at index i in short_code_lookup. The index j is an
445448
* index of this array if the number of bits contained in j and i is the number
446449
* of bits in the longest huff_code starting with the bits of i. The symbol
447450
* stored at index j is the symbol whose huffcode can be found in (j <<
@@ -450,7 +453,7 @@ struct isal_zstream {
450453
*
451454
* The following are explanations for sizes of the tables:
452455
*
453-
* Since small_code_lookup is a lookup on DECODE_LOOKUP_SIZE bits, it must have
456+
* Since short_code_lookup is a lookup on DECODE_LOOKUP_SIZE bits, it must have
454457
* size 2^DECODE_LOOKUP_SIZE.
455458
*
456459
* To determine the amount of memory required for long_code_lookup, note that
@@ -488,16 +491,16 @@ struct isal_zstream {
488491
#define ISAL_HUFF_CODE_LARGE_LONG_ALIGNED (ISAL_L_SIZE + (-ISAL_L_SIZE & 0xf))
489492
#define ISAL_HUFF_CODE_SMALL_LONG_ALIGNED (ISAL_S_SIZE + (-ISAL_S_SIZE & 0xf))
490493

491-
/* Large lookup table for decoding huffman codes */
494+
/** @brief Large lookup table for decoding huffman codes */
492495
struct inflate_huff_code_large {
493-
uint32_t short_code_lookup[1 << (ISAL_DECODE_LONG_BITS)];
494-
uint16_t long_code_lookup[ISAL_HUFF_CODE_LARGE_LONG_ALIGNED];
496+
uint32_t short_code_lookup[1 << (ISAL_DECODE_LONG_BITS)]; //!< Short code lookup table
497+
uint16_t long_code_lookup[ISAL_HUFF_CODE_LARGE_LONG_ALIGNED]; //!< Long code lookup table
495498
};
496499

497-
/* Small lookup table for decoding huffman codes */
500+
/** @brief Small lookup table for decoding huffman codes */
498501
struct inflate_huff_code_small {
499-
uint16_t short_code_lookup[1 << (ISAL_DECODE_SHORT_BITS)];
500-
uint16_t long_code_lookup[ISAL_HUFF_CODE_SMALL_LONG_ALIGNED];
502+
uint16_t short_code_lookup[1 << (ISAL_DECODE_SHORT_BITS)]; //!<Short code lookup table
503+
uint16_t long_code_lookup[ISAL_HUFF_CODE_SMALL_LONG_ALIGNED]; //!< Long code lookup table
501504
};
502505

503506
/** @brief Holds decompression state information*/

0 commit comments

Comments
 (0)