0001
0002
0003
0004 #include <linux/export.h>
0005 #include <linux/module.h>
0006 #include "dfltcc_util.h"
0007 #include "dfltcc.h"
0008
0009 char *oesc_msg(
0010 char *buf,
0011 int oesc
0012 )
0013 {
0014 if (oesc == 0x00)
0015 return NULL;
0016 else {
0017 #ifdef STATIC
0018 return NULL;
0019 #else
0020 sprintf(buf, "Operation-Ending-Supplemental Code is 0x%.2X", oesc);
0021 return buf;
0022 #endif
0023 }
0024 }
0025
0026 void dfltcc_reset(
0027 z_streamp strm,
0028 uInt size
0029 )
0030 {
0031 struct dfltcc_state *dfltcc_state =
0032 (struct dfltcc_state *)((char *)strm->state + size);
0033 struct dfltcc_qaf_param *param =
0034 (struct dfltcc_qaf_param *)&dfltcc_state->param;
0035
0036
0037 if (is_dfltcc_enabled()) {
0038 dfltcc(DFLTCC_QAF, param, NULL, NULL, NULL, NULL, NULL);
0039 memmove(&dfltcc_state->af, param, sizeof(dfltcc_state->af));
0040 } else
0041 memset(&dfltcc_state->af, 0, sizeof(dfltcc_state->af));
0042
0043
0044 memset(&dfltcc_state->param, 0, sizeof(dfltcc_state->param));
0045 dfltcc_state->param.nt = 1;
0046
0047
0048 if (zlib_dfltcc_support == ZLIB_DFLTCC_FULL_DEBUG)
0049 dfltcc_state->level_mask = DFLTCC_LEVEL_MASK_DEBUG;
0050 else
0051 dfltcc_state->level_mask = DFLTCC_LEVEL_MASK;
0052 dfltcc_state->block_size = DFLTCC_BLOCK_SIZE;
0053 dfltcc_state->block_threshold = DFLTCC_FIRST_FHT_BLOCK_SIZE;
0054 dfltcc_state->dht_threshold = DFLTCC_DHT_MIN_SAMPLE_SIZE;
0055 dfltcc_state->param.ribm = DFLTCC_RIBM;
0056 }
0057 EXPORT_SYMBOL(dfltcc_reset);
0058
0059 MODULE_LICENSE("GPL");