| 591 | |
| 592 | |
| 593 | int get_record_coordinates(ua_pres_t* pres, unsigned int *hash_code, |
| 594 | unsigned int *label_index) |
| 595 | { |
| 596 | ua_pres_t *presentity; |
| 597 | |
| 598 | *hash_code = core_hash( pres->pres_uri, NULL, HASH_SIZE); |
| 599 | |
| 600 | lock_get(&HashT->p_records[*hash_code].lock); |
| 601 | |
| 602 | presentity = search_htable(pres, *hash_code); |
| 603 | |
| 604 | if (presentity==NULL) { |
| 605 | lock_release(&HashT->p_records[*hash_code].lock); |
| 606 | return -1; |
| 607 | } |
| 608 | |
| 609 | *label_index = presentity->local_index; |
| 610 | |
| 611 | lock_release(&HashT->p_records[*hash_code].lock); |
| 612 | |
| 613 | return 0; |
| 614 | } |
| 615 | |
| 616 | |
| 617 | /* replaces the in-hash presentity with coordinates (hash_index,local_index) |
no test coverage detected