81 if (!omapi_handle_table) {
82 omapi_handle_table =
dmalloc (
sizeof *omapi_handle_table,
MDL);
83 if (!omapi_handle_table)
84 return ISC_R_NOMEMORY;
85 memset (omapi_handle_table, 0,
sizeof *omapi_handle_table);
86 omapi_handle_table -> first = 0;
88 omapi_handle_table -> leafp = 1;
102 return ISC_R_NOMEMORY;
103 memset (
new, 0,
sizeof *
new);
105 new -> limit = (omapi_handle_table -> limit *
109 omapi_handle_table =
new;
114 omapi_handle_table, o);
121 if (status != ISC_R_NOSPACE)
124 status = omapi_handle_table_enclose (&omapi_handle_table);
129 omapi_handle_table, o);
138 static isc_result_t omapi_object_handle_in_table (
omapi_handle_t h,
146 if (table -> first > h || table -> limit <= h)
147 return ISC_R_NOSPACE;
151 if (table -> leafp) {
153 (&table -> children [h - table -> first].
object,
169 index = (h - table -> first) / scale;
170 inner = table -> children [index].
table;
177 return ISC_R_NOMEMORY;
178 memset (inner, 0,
sizeof *inner);
179 inner -> first = index * scale + table -> first;
180 inner -> limit = inner -> first + scale;
183 table -> children [index].
table = inner;
186 status = omapi_object_handle_in_table (h, inner, o);
187 if (status == ISC_R_NOSPACE) {
188 status = (omapi_handle_table_enclose
189 (&table -> children [index].table));
193 return omapi_object_handle_in_table
194 (h, table -> children [index].table, o);
203 int index, base, scale;
217 base = inner -> first - inner -> first % scale;
227 return ISC_R_NOMEMORY;
228 memset (
new, 0,
sizeof *
new);
230 new -> limit = base + scale;
233 new -> children [index].table = inner;
240 return(omapi_handle_lookup_in(o, h, omapi_handle_table,
FIND_HAND));
250 if (!table || table->
first > h || table->
limit <= h)
276 index = (h - table->
first) / scale;
278 return(omapi_handle_lookup_in(o, h, table->
children[index].
table, op));
290 handle->
u.
buffer.len ==
sizeof h) {
291 memcpy(&h, handle->
u.
buffer.value,
sizeof h);
300 return(omapi_handle_lookup_in(NULL, h, omapi_handle_table,
CLEAR_HAND));
isc_result_t omapi_object_reference(omapi_object_t **, omapi_object_t *, const char *, int)
struct omapi_typed_data_t::@3::@4 buffer
struct __omapi_handle_table * table
#define OMAPI_HANDLE_TABLE_SIZE
union omapi_typed_data_t::@3 u
isc_result_t omapi_handle_td_lookup(omapi_object_t **, omapi_typed_data_t *)
void * dmalloc(size_t, const char *, int)
isc_result_t omapi_object_handle(omapi_handle_t *, omapi_object_t *)
isc_result_t omapi_handle_lookup(omapi_object_t **, omapi_handle_t)
unsigned int omapi_handle_t
omapi_handle_table_t * omapi_handle_table
isc_result_t omapi_handle_clear(omapi_handle_t)
omapi_handle_t omapi_next_handle
union __omapi_handle_table::@6 children[OMAPI_HANDLE_TABLE_SIZE]