Lines Matching refs:dec
1274 lshpack_dec_init (struct lshpack_dec *dec) in lshpack_dec_init() argument
1276 memset(dec, 0, sizeof(*dec)); in lshpack_dec_init()
1277 dec->hpd_max_capacity = INITIAL_DYNAMIC_TABLE_SIZE; in lshpack_dec_init()
1278 dec->hpd_cur_max_capacity = INITIAL_DYNAMIC_TABLE_SIZE; in lshpack_dec_init()
1279 lshpack_arr_init(&dec->hpd_dyn_table); in lshpack_dec_init()
1284 lshpack_dec_cleanup (struct lshpack_dec *dec) in lshpack_dec_cleanup() argument
1288 while (lshpack_arr_count(&dec->hpd_dyn_table) > 0) in lshpack_dec_cleanup()
1290 val = lshpack_arr_pop(&dec->hpd_dyn_table); in lshpack_dec_cleanup()
1293 lshpack_arr_cleanup(&dec->hpd_dyn_table); in lshpack_dec_cleanup()
1355 hdec_drop_oldest_entry (struct lshpack_dec *dec) in hdec_drop_oldest_entry() argument
1358 entry = (void *) lshpack_arr_shift(&dec->hpd_dyn_table); in hdec_drop_oldest_entry()
1359 dec->hpd_cur_capacity -= DYNAMIC_ENTRY_OVERHEAD + entry->dte_name_len in hdec_drop_oldest_entry()
1361 ++dec->hpd_state; in hdec_drop_oldest_entry()
1367 hdec_remove_overflow_entries (struct lshpack_dec *dec) in hdec_remove_overflow_entries() argument
1369 while (dec->hpd_cur_capacity > dec->hpd_cur_max_capacity) in hdec_remove_overflow_entries()
1370 hdec_drop_oldest_entry(dec); in hdec_remove_overflow_entries()
1375 hdec_update_max_capacity (struct lshpack_dec *dec, uint32_t new_capacity) in hdec_update_max_capacity() argument
1377 dec->hpd_cur_max_capacity = new_capacity; in hdec_update_max_capacity()
1378 hdec_remove_overflow_entries(dec); in hdec_update_max_capacity()
1383 lshpack_dec_set_max_capacity (struct lshpack_dec *dec, unsigned max_capacity) in lshpack_dec_set_max_capacity() argument
1385 dec->hpd_max_capacity = max_capacity; in lshpack_dec_set_max_capacity()
1386 hdec_update_max_capacity(dec, max_capacity); in lshpack_dec_set_max_capacity()
1505 hdec_get_table_entry (struct lshpack_dec *dec, uint32_t index) in hdec_get_table_entry() argument
1510 if (index == 0 || index > lshpack_arr_count(&dec->hpd_dyn_table)) in hdec_get_table_entry()
1513 index = lshpack_arr_count(&dec->hpd_dyn_table) - index; in hdec_get_table_entry()
1514 val = lshpack_arr_get(&dec->hpd_dyn_table, index); in hdec_get_table_entry()
1523 lshpack_dec_push_entry (struct lshpack_dec *dec, in lshpack_dec_push_entry() argument
1538 if (0 != lshpack_arr_push(&dec->hpd_dyn_table, (uintptr_t) entry)) in lshpack_dec_push_entry()
1543 ++dec->hpd_state; in lshpack_dec_push_entry()
1544 dec->hpd_cur_capacity += DYNAMIC_ENTRY_OVERHEAD + name_len + val_len; in lshpack_dec_push_entry()
1556 hdec_remove_overflow_entries(dec); in lshpack_dec_push_entry()
1610 lshpack_dec_decode (struct lshpack_dec *dec, in lshpack_dec_decode() argument
1631 if (new_capacity > dec->hpd_max_capacity) in lshpack_dec_decode()
1633 hdec_update_max_capacity(dec, new_capacity); in lshpack_dec_decode()
1735 entry = hdec_get_table_entry(dec, index); in lshpack_dec_decode()
1839 0 != lshpack_dec_push_entry(dec, output)) in lshpack_dec_decode()