550 NSAPI_PUBLIC void pblock_kpinsert(const pb_key *key, pb_param *pp, pblock *pb) |
550 NSAPI_PUBLIC void pblock_kpinsert(const pb_key *key, pb_param *pp, pblock *pb) |
551 { |
551 { |
552 PListStruct_t *pl = PBTOPL(pb); |
552 PListStruct_t *pl = PBTOPL(pb); |
553 PLValueStruct_t *pv = PATOPV(pp); |
553 PLValueStruct_t *pv = PATOPV(pp); |
554 |
554 |
555 PR_ASSERT(pv->pv_mempool == pl->pl_mempool); |
555 //PR_ASSERT(pv->pv_mempool == pl->pl_mempool); // TODO |
556 |
556 |
557 /* Check to see if the name corresponds to a pb_key */ |
557 /* Check to see if the name corresponds to a pb_key */ |
558 unsigned int hashval; |
558 unsigned int hashval; |
559 if (!key) { |
559 if (!key) { |
560 hashval = PListHash(pv->pv_name); |
560 hashval = PListHash(pv->pv_name); |
586 int i = key ? _get_hash_index(pl, key) : (hashval % PLSIZENDX(pt->pt_sizendx)); |
586 int i = key ? _get_hash_index(pl, key) : (hashval % PLSIZENDX(pt->pt_sizendx)); |
587 pv->pv_next = pt->pt_hash[i]; |
587 pv->pv_next = pt->pt_hash[i]; |
588 pt->pt_hash[i] = pv; |
588 pt->pt_hash[i] = pv; |
589 pt->pt_nsyms++; |
589 pt->pt_nsyms++; |
590 |
590 |
591 PR_ASSERT(param_key(pp) == key); |
591 //PR_ASSERT(param_key(pp) == key); // TODO |
592 } |
592 } |
593 |
593 |
594 |
594 |
595 /* ---------------------------- pblock_pinsert ---------------------------- */ |
595 /* ---------------------------- pblock_pinsert ---------------------------- */ |
596 |
596 |
646 } |
646 } |
647 |
647 |
648 |
648 |
649 /* --------------------------- pblock_kllinsert --------------------------- */ |
649 /* --------------------------- pblock_kllinsert --------------------------- */ |
650 |
650 |
651 NSAPI_PUBLIC pb_param *pblock_kllinsert(const pb_key *key, PRInt64 value, pblock *pb) |
651 NSAPI_PUBLIC pb_param *pblock_kllinsert(const pb_key *key, int64_t value, pblock *pb) |
652 { |
652 { |
653 pb_param *pp = pblock_key_param_create(pb, key, NULL, UTIL_I64TOA_SIZE); |
653 pb_param *pp = pblock_key_param_create(pb, key, NULL, UTIL_I64TOA_SIZE); |
654 if (pp) { |
654 if (pp) { |
655 util_i64toa(value, pp->value); |
655 util_i64toa(value, pp->value); |
656 pblock_kpinsert(key, pp, pb); |
656 pblock_kpinsert(key, pp, pb); |