1 #ifndef DFLTCC_COMMON_H 2 #define DFLTCC_COMMON_H 3 4 #include "zutil.h" 5 6 void Z_INTERNAL *PREFIX(dfltcc_alloc_window)(PREFIX3(streamp) strm, uInt items, uInt size); 7 void Z_INTERNAL PREFIX(dfltcc_free_window)(PREFIX3(streamp) strm, void *w); 8 9 #define ZFREE_STATE ZFREE 10 11 #define ZALLOC_WINDOW PREFIX(dfltcc_alloc_window) 12 13 #define ZFREE_WINDOW PREFIX(dfltcc_free_window) 14 15 #define TRY_FREE_WINDOW PREFIX(dfltcc_free_window) 16 17 #define DFLTCC_BLOCK_HEADER_BITS 3 18 #define DFLTCC_HLITS_COUNT_BITS 5 19 #define DFLTCC_HDISTS_COUNT_BITS 5 20 #define DFLTCC_HCLENS_COUNT_BITS 4 21 #define DFLTCC_MAX_HCLENS 19 22 #define DFLTCC_HCLEN_BITS 3 23 #define DFLTCC_MAX_HLITS 286 24 #define DFLTCC_MAX_HDISTS 30 25 #define DFLTCC_MAX_HLIT_HDIST_BITS 7 26 #define DFLTCC_MAX_SYMBOL_BITS 16 27 #define DFLTCC_MAX_EOBS_BITS 15 28 #define DFLTCC_MAX_PADDING_BITS 7 29 30 #define DEFLATE_BOUND_COMPLEN(source_len) \ 31 ((DFLTCC_BLOCK_HEADER_BITS + \ 32 DFLTCC_HLITS_COUNT_BITS + \ 33 DFLTCC_HDISTS_COUNT_BITS + \ 34 DFLTCC_HCLENS_COUNT_BITS + \ 35 DFLTCC_MAX_HCLENS * DFLTCC_HCLEN_BITS + \ 36 (DFLTCC_MAX_HLITS + DFLTCC_MAX_HDISTS) * DFLTCC_MAX_HLIT_HDIST_BITS + \ 37 (source_len) * DFLTCC_MAX_SYMBOL_BITS + \ 38 DFLTCC_MAX_EOBS_BITS + \ 39 DFLTCC_MAX_PADDING_BITS) >> 3) 40 41 #endif 42