85 return ISC_R_NOMEMORY;
103 return ISC_R_NOMEMORY;
104 memset (
new, 0,
sizeof *
new);
117 if (status == ISC_R_SUCCESS) {
120 return ISC_R_SUCCESS;
122 if (status != ISC_R_NOSPACE)
126 if (status != ISC_R_SUCCESS)
131 if (status != ISC_R_SUCCESS)
136 return ISC_R_SUCCESS;
139 static isc_result_t omapi_object_handle_in_table (
omapi_handle_t h,
147 if (table -> first > h || table -> limit <= h)
148 return ISC_R_NOSPACE;
152 if (table -> leafp) {
154 (&table -> children [h - table -> first].
object,
156 if (status != ISC_R_SUCCESS)
159 return ISC_R_SUCCESS;
170 index = (h - table -> first) / scale;
171 inner = table -> children [index].
table;
178 return ISC_R_NOMEMORY;
179 memset (inner, 0,
sizeof *inner);
180 inner -> first = index * scale + table -> first;
181 inner -> limit = inner -> first + scale;
184 table -> children [index].
table = inner;
187 status = omapi_object_handle_in_table (h, inner, o);
188 if (status == ISC_R_NOSPACE) {
189 status = (omapi_handle_table_enclose
190 (&table -> children [index].table));
191 if (status != ISC_R_SUCCESS)
194 return omapi_object_handle_in_table
195 (h, table -> children [index].table, o);
204 int index, base, scale;
218 base = inner -> first - inner -> first % scale;
228 return ISC_R_NOMEMORY;
229 memset (
new, 0,
sizeof *
new);
231 new -> limit = base + scale;
234 new -> children [index].table = inner;
236 return ISC_R_SUCCESS;
251 if (!table || table->
first > h || table->
limit <= h)
252 return(ISC_R_NOTFOUND);
258 return(ISC_R_NOTFOUND);
261 return(ISC_R_SUCCESS);
277 index = (h - table->
first) / scale;
279 return(omapi_handle_lookup_in(o, h, table->
children[index].
table, op));
291 handle->
u.
buffer.len ==
sizeof h) {
292 memcpy(&h, handle->
u.
buffer.value,
sizeof h);
isc_result_t omapi_object_reference(omapi_object_t **, omapi_object_t *, const char *, int)
#define DHCP_R_INVALIDARG
struct omapi_typed_data_t::@3::@4 buffer
struct __omapi_handle_table * table
isc_result_t omapi_handle_lookup(omapi_object_t **o, omapi_handle_t h)
#define OMAPI_HANDLE_TABLE_SIZE
isc_result_t omapi_handle_td_lookup(omapi_object_t **obj, omapi_typed_data_t *handle)
union omapi_typed_data_t::@3 u
void * dmalloc(size_t, const char *, int)
isc_result_t omapi_object_handle(omapi_handle_t *h, omapi_object_t *o)
unsigned int omapi_handle_t
isc_result_t omapi_handle_clear(omapi_handle_t h)
omapi_handle_table_t * omapi_handle_table
omapi_handle_t omapi_next_handle
union __omapi_handle_table::@6 children[OMAPI_HANDLE_TABLE_SIZE]