--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../aros.css' --->
| OF_CloseKey() | OF_FindNodeByCompatible() | OF_FindProperty() | OF_GetChild() |
| OF_GetProperty() | OF_GetPropLen() | OF_GetPropName() | OF_GetPropValue() |
| OF_OpenKey() |
void OF_CloseKey(
void * Key );
Release a node handle obtained from openfirmware.resource.
Key - Node handle to close. The current implementation ignores it.
None.
This is currently a no-op: no memory is freed and no reference count is changed. The tree remains owned by the boot environment. Closing a handle does not invalidate borrowed child or property pointers. This function performs no allocation or wait.
void * OF_FindNodeByCompatible(
void * Start,
char * Compatible );
Find the first node whose "compatible" property contains an exact, case-sensitive match for the requested string. Search the start node first, then recursively search each child subtree in list order. The whole NUL-separated compatible list is examined.
Start - Node handle at which to start, or NULL for the tree root.
Compatible - NUL-terminated binding string. NULL is accepted and
returns no match.
The first matching borrowed node handle, or NULL for no match, a missing root or a NULL Compatible argument.
Returned pointers refer to the boot-supplied tree; no copy is made and ownership is not transferred. Do not modify or free this data. The tree must remain valid while its handles or values are used. This function performs no allocation or wait. Start is included in the search; it is not an iteration cursor. There is no status-property filtering: a matching disabled node can be returned. Property strings must be well-formed and terminated within their stored values. The search uses recursive stack space proportional to tree depth.
void * OF_FindProperty(
void * Key,
char * name );
Find a named property among the immediate properties of a node.
Key - Non-NULL node handle.
name - NUL-terminated property name, matched exactly and
case-sensitively. NULL matches no property.
A borrowed property handle, or NULL if no name matches.
Returned pointers refer to the boot-supplied tree; no copy is made and ownership is not transferred. Do not modify or free this data. The tree must remain valid while its handles or values are used. This function performs no allocation or wait.
void * OF_GetChild(
void * Key,
void * Prev );
Enumerate the immediate children of a node in list order. Pass NULL as Prev to start, then pass the previous result to advance.
Key - Non-NULL node handle.
Prev - NULL, or the last child node handle returned for this same Key.
It must still belong to that node's list.
A borrowed child node handle, or NULL for an empty list or after its last element.
Returned pointers refer to the boot-supplied tree; no copy is made and ownership is not transferred. Do not modify or free this data. The tree must remain valid while its handles or values are used. This function performs no allocation or wait. There is no handle-type or parent-membership validation. A non-NULL Prev is followed directly; Key is not used to check its parent.
void * OF_GetProperty(
void * Key,
void * Prev );
Enumerate the immediate properties of a node in list order. Pass NULL as Prev to start, then pass the previous result to advance.
Key - Non-NULL node handle.
Prev - NULL, or the last property handle returned for this same Key.
It must still belong to that node's list.
A borrowed property handle, or NULL for an empty list or after its last element.
Returned pointers refer to the boot-supplied tree; no copy is made and ownership is not transferred. Do not modify or free this data. The tree must remain valid while its handles or values are used. This function performs no allocation or wait. There is no handle-type or parent-membership validation. A non-NULL Prev is followed directly; Key is not used to check its parent.
uint32_t OF_GetPropLen(
void * Key );
Return the recorded byte length of a property value.
Key - Property handle, not a node handle; NULL is accepted.
The property's stored byte length, or zero for NULL. Zero may also be a valid property length and does not by itself prove absence.
No data is copied or validated. The length describes raw property bytes, not a count of integer cells or characters. The property handle must remain valid. This function performs no allocation or wait.
char * OF_GetPropName(
void * Key );
Return the name attached to a property.
Key - Property handle, not a node handle; NULL is accepted.
The borrowed name pointer for a property. For NULL, the literal string "(null)" is returned rather than a NULL pointer.
Returned pointers refer to the boot-supplied tree; no copy is made and ownership is not transferred. Do not modify or free this data. The tree must remain valid while its handles or values are used. This function performs no allocation or wait.
void * OF_GetPropValue(
void * Key );
Return direct access to the bytes of a property value.
Key - Property handle, not a node handle; NULL is accepted.
The stored value pointer, or NULL when Key is NULL. The pointer is not a copy and does not imply that any particular length or type is available.
Returned pointers refer to the boot-supplied tree; no copy is made and ownership is not transferred. Do not modify or free this data. The tree must remain valid while its handles or values are used. This function performs no allocation or wait. Use OF_GetPropLen() before accessing bytes. Values may be binary, zero-length, strings or lists of strings; no NUL termination is added. Numeric byte order and cell layout are those of the supplied device tree: this function does not convert them to host types.
void * OF_OpenKey(
char * Key );
Find a node by an absolute path in the boot-supplied device tree. Each component is matched exactly and case-sensitively against a child node name. Unit-address suffixes are part of the name. The path "/" returns the root; a trailing slash names the same node.
Key - Non-NULL NUL-terminated absolute path. Use components of
at most 63 bytes and a single slash between components.
A borrowed node handle, or NULL for a relative path or a component that cannot be found.
Returned pointers refer to the boot-supplied tree; no copy is made and ownership is not transferred. Do not modify or free this data. The tree must remain valid while its handles or values are used. This function performs no allocation or wait. The string is not modified. No alias expansion, wildcard matching, unit-address abbreviation or dot/dot-dot resolution is performed. OF_CloseKey() currently has no effect on the returned handle.
An empty component terminates traversal, so repeated slashes can return an ancestor without examining the rest of the path. Components longer than 63 bytes are not handled as complete names and are not reliably rejected. Use the input form described above.