Lines Matching defs:handle

1 /*	$NetBSD: handle.c,v 1.3 2022/04/03 01:10:59 christos Exp $	*/
3 /* handle.c
32 __RCSID("$NetBSD: handle.c,v 1.3 2022/04/03 01:10:59 christos Exp $");
38 /* The handle table is a hierarchical tree designed for quick mapping
39 of handle identifiers to objects. Objects contain their own handle
43 table or an indirect table, the handle of the first object covered
50 next object handle to be assigned is covered by the outermost
52 next handle should go, and if necessary create additional nodes in
53 the tree to contain the new handle. The pointer to the object is
56 Theoretically, we could have some code here to free up handle
57 tables as they go out of use, but by and large handle tables won't
63 omapi_handle_t omapi_next_handle = 1; /* Next handle to be assigned. */
81 if (o -> handle) {
82 *h = o -> handle;
96 /* If this handle doesn't fit in the outer table, we need to
98 some reason we decide to do disjoint handle allocation,
100 to enclose the next handle ID. */
117 /* Try to cram this handle into the existing table. */
120 /* If it worked, return the next handle and increment it. */
162 o -> handle = h;
172 handle must be the subtable of this table whose index into this
173 table's array of children is the handle divided by the scale. */
219 table's scale. If handle IDs are being allocated
279 handle must be the subtable of this table whose index into this
280 table's array of children is the handle divided by the scale. */
288 omapi_typed_data_t *handle)
292 if (handle->type == omapi_datatype_int)
293 h = handle->u.integer;
294 else if (handle->type == omapi_datatype_data &&
295 handle->u.buffer.len == sizeof h) {
296 memcpy(&h, handle->u.buffer.value, sizeof h);