|
PatchworkOS
2ca1c69
A non-POSIX operating system.
|
Patch-up system for forward references. More...
Patch-up system for forward references.
Data Structures | |
| struct | aml_patch_up_entry_t |
| Entry in the global list of unresolved references. More... | |
Typedefs | |
| typedef uint64_t(* | aml_patch_up_resolve_callback_t) (aml_state_t *state, aml_object_t *match, aml_object_t *unresolved) |
| Callback type for resolving a forward reference. | |
Functions | |
| uint64_t | aml_patch_up_init (void) |
| Initialize the patch-up system. | |
| uint64_t | aml_patch_up_add_unresolved (aml_unresolved_t *unresolved) |
| Adds a unresolved reference to the global list. | |
| void | aml_patch_up_remove_unresolved (aml_unresolved_t *unresolved) |
| Removes an unresolved reference from the global list. | |
| uint64_t | aml_patch_up_resolve_all (void) |
| Attempts to resolve all unresolved references. | |
| uint64_t | aml_patch_up_unresolved_count (void) |
| Get the number of unresolved references in the global list. | |
| typedef uint64_t(* aml_patch_up_resolve_callback_t) (aml_state_t *state, aml_object_t *match, aml_object_t *unresolved) |
Callback type for resolving a forward reference.
Takes the now matched object and the previously unresolved object as parameters. The callback should patch the unresolved object in whatever way it wants, for example performing type conversion or similar.
Definition at line 25 of file patch_up.h.
| uint64_t aml_patch_up_init | ( | void | ) |
Initialize the patch-up system.
0. On failure, ERR and errno is set. Definition at line 15 of file patch_up.c.
| uint64_t aml_patch_up_add_unresolved | ( | aml_unresolved_t * | unresolved | ) |
Adds a unresolved reference to the global list.
Does not take a reference to unresolved, unresolved objects will remove themselves from the list when they are freed.
| unresolved | The unresolved object to add, must be of type AML_UNRESOLVED. |
0. On failure, ERR and errno is set. Definition at line 21 of file patch_up.c.
| void aml_patch_up_remove_unresolved | ( | aml_unresolved_t * | unresolved | ) |
Removes an unresolved reference from the global list.
| unresolved | The unresolved object to remove. |
Definition at line 41 of file patch_up.c.
| uint64_t aml_patch_up_resolve_all | ( | void | ) |
Attempts to resolve all unresolved references.
Note that a failure to resolve a object is not considered an error, the function will just continue to the next unresolved reference.
0. On failure, ERR and errno is set. Definition at line 60 of file patch_up.c.
| uint64_t aml_patch_up_unresolved_count | ( | void | ) |
Get the number of unresolved references in the global list.
Definition at line 105 of file patch_up.c.