- Timestamp:
- May 28, 2007 11:49:46 AM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c
r1278 r1307 126 126 127 127 struct res_key key; /**< Key to index this query. */ 128 char hbufid[PJ_HASH_ENTRY_SIZE]; /**< Hash buffer 1*/129 char hbufkey[PJ_HASH_ENTRY_SIZE]; /**< Hash buffer 2*/128 pj_hash_entry_buf hbufid; /**< Hash buffer 1 */ 129 pj_hash_entry_buf hbufkey; /**< Hash buffer 2 */ 130 130 pj_timer_entry timer_entry; /**< Timer to manage timeouts */ 131 131 unsigned options; /**< Query options. */ … … 145 145 struct res_key key; /**< Resource key. */ 146 146 char buf[RES_BUF_SZ];/**< Resource buffer. */ 147 char hbuf[PJ_HASH_ENTRY_SIZE]; /**< Hash buffer*/147 pj_hash_entry_buf hbuf; /**< Hash buffer */ 148 148 pj_time_val expiry_time; /**< Expiration time. */ 149 149 pj_dns_parsed_packet *pkt; /**< The response packet. */ -
pjproject/trunk/pjlib/include/pj/hash.h
r1054 r1307 48 48 * This indicates the size of of each hash entry. 49 49 */ 50 #define PJ_HASH_ENTRY_SIZE (3*sizeof(void*) + 2*sizeof(pj_uint32_t)) 50 #define PJ_HASH_ENTRY_BUF_SIZE (3*sizeof(void*) + 2*sizeof(pj_uint32_t)) 51 52 /** 53 * Type declaration for entry buffer, used by #pj_hash_set_np() 54 */ 55 typedef void *pj_hash_entry_buf[(PJ_HASH_ENTRY_BUF_SIZE+sizeof(void*)-1)/(sizeof(void*))]; 51 56 52 57 /** … … 149 154 * compute the key. This value can be obtained when calling 150 155 * #pj_hash_get(). 151 * @param entry_buf Pointer to buffer which will be used for the new entry, 152 * when one needs to be created. The buffer must be at least 153 * PJ_HASH_ENTRY_SIZE long, and the first PJ_HASH_ENTRY_SIZE 154 * bytes of the buffer will be used by the hash table. 155 * Application may use the remaining portion of the buffer 156 * for its own purpose. 156 * @param entry_buf Buffer which will be used for the new entry, when one needs 157 * to be created. 157 158 * @param value value to be associated, or NULL to delete the entry with 158 159 * the specified key. … … 160 161 PJ_DECL(void) pj_hash_set_np(pj_hash_table_t *ht, 161 162 const void *key, unsigned keylen, 162 pj_uint32_t hval, void *entry_buf, void *value); 163 pj_uint32_t hval, pj_hash_entry_buf entry_buf, 164 void *value); 163 165 164 166 /** -
pjproject/trunk/pjlib/src/pj/hash.c
r1235 r1307 101 101 unsigned table_size; 102 102 103 /* Check that PJ_HASH_ENTRY_ SIZE is correct. */104 PJ_ASSERT_RETURN(sizeof(pj_hash_entry) ==PJ_HASH_ENTRY_SIZE, NULL);103 /* Check that PJ_HASH_ENTRY_BUF_SIZE is correct. */ 104 PJ_ASSERT_RETURN(sizeof(pj_hash_entry)<=PJ_HASH_ENTRY_BUF_SIZE, NULL); 105 105 106 106 h = PJ_POOL_ALLOC_T(pool, pj_hash_table_t); … … 238 238 PJ_DEF(void) pj_hash_set_np( pj_hash_table_t *ht, 239 239 const void *key, unsigned keylen, 240 pj_uint32_t hval, void *entry_buf, void *value) 240 pj_uint32_t hval, pj_hash_entry_buf entry_buf, 241 void *value) 241 242 { 242 243 pj_hash_entry **p_entry; 243 244 244 p_entry = find_entry( NULL, ht, key, keylen, value, &hval, entry_buf ); 245 p_entry = find_entry( NULL, ht, key, keylen, value, &hval, 246 (void*)entry_buf ); 245 247 if (*p_entry) { 246 248 if (value == NULL) { -
pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
r1241 r1307 63 63 64 64 /* This is the buffer to store this entry in the hash table. */ 65 char ht_entry[PJ_HASH_ENTRY_SIZE];65 pj_hash_entry_buf ht_entry; 66 66 67 67 /* List of dialog in this dialog set. */
Note: See TracChangeset
for help on using the changeset viewer.