@@ -163,48 +163,44 @@ cdef extern from "<isa-l/igzip_lib.h>":
163
163
164
164
cdef struct BitBuf2:
165
165
unsigned long long m_bits # !< bits in the bit buffer
166
- unsigned long m_bits_count; # !< number of valid bits in the bit buffer
166
+ unsigned int m_bits_count; # !< number of valid bits in the bit buffer
167
167
unsigned char * m_out_buff # !< current index of buffer to write to
168
168
unsigned char * m_out_end # !< end of buffer to write to
169
169
unsigned char * m_out_start # !< start of buffer to write to
170
170
171
171
cdef struct isal_zstate:
172
- unsigned long total_in_start # !< Not used, may be replaced with something else
173
- unsigned long block_next # !< Start of current deflate block in the input
174
- unsigned long block_end # !< End of current deflate block in the input
175
- unsigned long dist_mask # !< Distance mask used.
176
- unsigned long hash_mask
172
+ unsigned int total_in_start # !< Not used, may be replaced with something else
173
+ unsigned int block_next # !< Start of current deflate block in the input
174
+ unsigned int block_end # !< End of current deflate block in the input
175
+ unsigned int dist_mask # !< Distance mask used.
176
+ unsigned int hash_mask
177
177
isal_zstate_state state # !< Current state in processing the data stream
178
178
BitBuf2 bitbuf
179
- unsigned long crc # !< Current checksum without finalize step if any (adler)
179
+ unsigned int crc # !< Current checksum without finalize step if any (adler)
180
180
unsigned char has_wrap_hdr # !< keeps track of wrapper header
181
181
unsigned char has_eob_hdr # !< keeps track of eob on the last deflate block
182
182
unsigned char has_hist # !< flag to track if there is match history
183
- unsigned int has_level_buf_init # !< flag to track if user supplied memory has been initialized.
184
- unsigned long count # !< used for partial header/trailer writes
183
+ unsigned short has_level_buf_init # !< flag to track if user supplied memory has been initialized.
184
+ unsigned int count # !< used for partial header/trailer writes
185
185
unsigned char tmp_out_buff[16 ] # ! temporary array
186
- unsigned long tmp_out_start # !< temporary variable
187
- unsigned long tmp_out_end # !< temporary variable
188
- unsigned long b_bytes_valid # !< number of valid bytes in buffer
189
- unsigned long b_bytes_processed # !< number of bytes processed in buffer
190
- # Below values give compile errors because they are dynamic in size
191
- # unsigned char buffer[2 * IGZIP_HIST_SIZE + ISAL_LOOK_AHEAD] #!< Internal buffer
192
- # Stream should be setup such that the head is cache aligned
193
- # unsigned int head[IGZIP_LVL0_HASH_SIZE] #!< Hash array
186
+ unsigned int tmp_out_start # !< temporary variable
187
+ unsigned int tmp_out_end # !< temporary variable
188
+ unsigned int b_bytes_valid # !< number of valid bytes in buffer
189
+ unsigned int b_bytes_processed # !< number of bytes processed in buffer
194
190
195
191
cdef struct isal_hufftables:
196
192
pass
197
193
198
194
cdef struct isal_zstream:
199
195
unsigned char * next_in # !< Next input byte
200
- unsigned long avail_in # !< number of bytes available at next_in
201
- unsigned long total_in_start # !< total number of bytes read so far
196
+ unsigned int avail_in # !< number of bytes available at next_in
197
+ unsigned int total_in_start # !< total number of bytes read so far
202
198
unsigned char * next_out # !< Next output byte
203
- unsigned long avail_out # !< number of bytes available at next_out
204
- unsigned long total_out # !< total number of bytes written so far
199
+ unsigned int avail_out # !< number of bytes available at next_out
200
+ unsigned int total_out # !< total number of bytes written so far
205
201
isal_hufftables * hufftables # !< Huffman encoding used when compressing
206
- unsigned long level # !< Compression level to use
207
- unsigned long level_buf_size # !< Size of level_buf
202
+ unsigned int level # !< Compression level to use
203
+ unsigned int level_buf_size # !< Size of level_buf
208
204
unsigned char * level_buf # !< User allocated buffer required for different compression levels
209
205
unsigned short end_of_stream # !< non-zero if this is the last input buffer
210
206
unsigned short flush # !< Flush type can be NO_FLUSH, SYNC_FLUSH or FULL_FLUSH
@@ -220,19 +216,20 @@ cdef extern from "<isa-l/igzip_lib.h>":
220
216
221
217
cdef struct inflate_state:
222
218
unsigned char * next_out # !< Next output byte
223
- unsigned long avail_out # !< number of bytes available at next_out
224
- unsigned long total_out # !< total number of bytes written so far
219
+ unsigned int avail_out # !< number of bytes available at next_out
220
+ unsigned int total_out # !< total number of bytes written so far
225
221
unsigned char * next_in # !< Next input byte
226
- unsigned long avail_in # !< number of bytes available at next_in
227
- long read_in_length # !< Bits in read_in
222
+ unsigned int avail_in # !< number of bytes available at next_in
223
+ unsigned long long read_in # !< Bits buffered to handle unaligned streams
224
+ int read_in_length # !< Bits in read_in
228
225
inflate_huff_code_large lit_huff_code # !< Structure for decoding lit/len symbols
229
226
inflate_huff_code_small dist_huff_code # !< Structure for decoding dist symbols
230
227
isal_block_state block_state # !< Current decompression state
231
- unsigned long dict_length # !< Length of dictionary used
232
- unsigned long bfinal # !< Flag identifying final block
233
- unsigned long crc_flag # !< Flag identifying whether to track of crc
234
- unsigned long crc # !< Contains crc or adler32 of output if crc_flag is set
235
- unsigned long hist_bits # !< Log base 2 of maximum lookback distance
228
+ unsigned int dict_length # !< Length of dictionary used
229
+ unsigned int bfinal # !< Flag identifying final block
230
+ unsigned int crc_flag # !< Flag identifying whether to track of crc
231
+ unsigned int crc # !< Contains crc or adler32 of output if crc_flag is set
232
+ unsigned int hist_bits # !< Log base 2 of maximum lookback distance
236
233
# Other members are omitted because they are not in use yet.
237
234
238
235
# Compression functions
@@ -267,7 +264,7 @@ cdef extern from "<isa-l/igzip_lib.h>":
267
264
# */
268
265
cdef int isal_deflate_set_dict(isal_zstream * stream,
269
266
unsigned char * dict ,
270
- unsigned long dict_len )
267
+ unsigned int dict_len )
271
268
272
269
273
270
# /**
@@ -355,24 +352,6 @@ cdef extern from "<isa-l/igzip_lib.h>":
355
352
# */
356
353
cdef int isal_deflate_stateless(isal_zstream * stream)
357
354
358
- # Other functions
359
-
360
- # /**
361
- # * @brief Calculate Adler-32 checksum, runs appropriate version.
362
- # *
363
- # * This function determines what instruction sets are enabled and selects the
364
- # * appropriate version at runtime.
365
- # *
366
- # * @param init: initial Adler-32 value
367
- # * @param buf: buffer to calculate checksum on
368
- # * @param len: buffer length in bytes
369
- # *
370
- # * @returns 32-bit Adler-32 checksum
371
- # */
372
-
373
- unsigned long isal_adler32(unsigned long init,
374
- const unsigned char * buf,
375
- unsigned long long len )
376
355
377
356
# ##########################
378
357
# Inflate functions
@@ -406,7 +385,7 @@ cdef extern from "<isa-l/igzip_lib.h>":
406
385
# * @returns COMP_OK,
407
386
# * ISAL_INVALID_STATE (dictionary could not be set)
408
387
# */
409
- int isal_inflate_set_dict(inflate_state * state, unsigned char * dict , unsigned long dict_len)
388
+ int isal_inflate_set_dict(inflate_state * state, unsigned char * dict , unsigned int dict_len)
410
389
411
390
# /**
412
391
# * @brief Fast data (deflate) decompression for storage applications.
@@ -454,3 +433,22 @@ cdef extern from "<isa-l/igzip_lib.h>":
454
433
# * ISAL_INCORRECT_CHECKSUM.
455
434
# */
456
435
int isal_inflate(inflate_state * state)
436
+
437
+ # #########################
438
+ # Other functions
439
+ # #########################
440
+ # /**
441
+ # * @brief Calculate Adler-32 checksum, runs appropriate version.
442
+ # *
443
+ # * This function determines what instruction sets are enabled and selects the
444
+ # * appropriate version at runtime.
445
+ # *
446
+ # * @param init: initial Adler-32 value
447
+ # * @param buf: buffer to calculate checksum on
448
+ # * @param len: buffer length in bytes
449
+ # *
450
+ # * @returns 32-bit Adler-32 checksum
451
+ # */
452
+ unsigned int isal_adler32(unsigned int init,
453
+ const unsigned char * buf,
454
+ unsigned long long len )
0 commit comments