Lines Matching +full:software +full:- +full:dl
3 /*-
4 * SPDX-License-Identifier: BSD-2-Clause
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
70 if (strncmp(dhx->dhx_magic, magic, _CITRUS_DB_MAGIC_SIZE) != 0) in _citrus_db_open()
72 if (_memstream_seek(&ms, be32toh(dhx->dhx_entry_offset), SEEK_SET)) in _citrus_db_open()
75 if (be32toh(dhx->dhx_num_entries)*_CITRUS_DB_ENTRY_SIZE > in _citrus_db_open()
82 db->db_region = *r; in _citrus_db_open()
83 db->db_hashfunc = hashfunc; in _citrus_db_open()
84 db->db_hashfunc_closure = hashfunc_closure; in _citrus_db_open()
99 struct _citrus_region *data, struct _citrus_db_locator *dl) in _citrus_db_lookup() argument
108 _memstream_bind(&ms, &db->db_region); in _citrus_db_lookup()
111 num_entries = be32toh(dhx->dhx_num_entries); in _citrus_db_lookup()
115 if (dl != NULL && dl->dl_offset>0) { in _citrus_db_lookup()
116 hashval = dl->dl_hashval; in _citrus_db_lookup()
117 offset = dl->dl_offset; in _citrus_db_lookup()
118 if (offset >= _region_size(&db->db_region)) in _citrus_db_lookup()
121 hashval = db->db_hashfunc(key)%num_entries; in _citrus_db_lookup()
122 offset = be32toh(dhx->dhx_entry_offset) + in _citrus_db_lookup()
124 if (dl) in _citrus_db_lookup()
125 dl->dl_hashval = hashval; in _citrus_db_lookup()
137 offset = be32toh(dex->dex_next_offset); in _citrus_db_lookup()
140 if (dl) { in _citrus_db_lookup()
141 dl->dl_offset = offset; in _citrus_db_lookup()
143 dl->dl_offset = _region_size(&db->db_region); in _citrus_db_lookup()
147 if (be32toh(dex->dex_hash_value) != hashval) in _citrus_db_lookup()
151 if (be32toh(dex->dex_key_size) == _region_size(key)) { in _citrus_db_lookup()
153 if (_memstream_seek(&ms, be32toh(dex->dex_key_offset), in _citrus_db_lookup()
165 &ms, be32toh(dex->dex_data_offset), in _citrus_db_lookup()
170 be32toh(dex->dex_data_size)) == NULL) in _citrus_db_lookup()
182 struct _citrus_region *data, struct _citrus_db_locator *dl) in _citrus_db_lookup_by_string() argument
188 return (_citrus_db_lookup(db, &r, data, dl)); in _citrus_db_lookup_by_string()
193 uint8_t *rval, struct _citrus_db_locator *dl) in _citrus_db_lookup8_by_string() argument
198 ret = _citrus_db_lookup_by_string(db, key, &r, dl); in _citrus_db_lookup8_by_string()
213 uint16_t *rval, struct _citrus_db_locator *dl) in _citrus_db_lookup16_by_string() argument
219 ret = _citrus_db_lookup_by_string(db, key, &r, dl); in _citrus_db_lookup16_by_string()
236 uint32_t *rval, struct _citrus_db_locator *dl) in _citrus_db_lookup32_by_string() argument
242 ret = _citrus_db_lookup_by_string(db, key, &r, dl); in _citrus_db_lookup32_by_string()
259 const char **rdata, struct _citrus_db_locator *dl) in _citrus_db_lookup_string_by_string() argument
264 ret = _citrus_db_lookup_by_string(db, key, &r, dl); in _citrus_db_lookup_string_by_string()
271 if (*((const char*)_region_head(&r)+_region_size(&r)-1) != '\0') in _citrus_db_lookup_string_by_string()
286 _memstream_bind(&ms, &db->db_region); in _citrus_db_get_number_of_entries()
289 return ((int)be32toh(dhx->dhx_num_entries)); in _citrus_db_get_number_of_entries()
302 _memstream_bind(&ms, &db->db_region); in _citrus_db_get_entry()
305 num_entries = be32toh(dhx->dhx_num_entries); in _citrus_db_get_entry()
310 offset = be32toh(dhx->dhx_entry_offset) + idx * _CITRUS_DB_ENTRY_SIZE; in _citrus_db_get_entry()
318 if (_memstream_seek(&ms, be32toh(dex->dex_key_offset), SEEK_SET)) in _citrus_db_get_entry()
321 if (_memstream_getregion(&ms, key, be32toh(dex->dex_key_size))==NULL) in _citrus_db_get_entry()
324 if (_memstream_seek(&ms, be32toh(dex->dex_data_offset), SEEK_SET)) in _citrus_db_get_entry()
327 if (_memstream_getregion(&ms, data, be32toh(dex->dex_data_size))==NULL) in _citrus_db_get_entry()