|
PatchworkOS
a7b3d61
A non-POSIX operating system.
|
State. More...
State.
Data Structures | |
| struct | aml_state_t |
| AML State. More... | |
Functions | |
| uint64_t | aml_state_init (aml_state_t *state, aml_object_t **args) |
| Initialize an AML state. | |
| void | aml_state_deinit (aml_state_t *state) |
| Deinitialize an AML state. | |
| aml_object_t * | aml_state_result_get (aml_state_t *state) |
| Get the result object of the state. | |
| void | aml_state_result_set (aml_state_t *state, aml_object_t *result) |
| Set the result object of the state. | |
| uint64_t aml_state_init | ( | aml_state_t * | state, |
| aml_object_t ** | args | ||
| ) |
Initialize an AML state.
| state | Pointer to the state to initialize. |
| args | Array of pointers to the objects to pass as arguments, or NULL. Must be null-terminated. |
0. On failure, ERR and errno is set. Definition at line 8 of file state.c.
| void aml_state_deinit | ( | aml_state_t * | state | ) |
| aml_object_t * aml_state_result_get | ( | aml_state_t * | state | ) |
Get the result object of the state.
If no result is available, a Integer object with value 0 is returned.
| state | Pointer to the state. |
NULL and errno is set. Definition at line 87 of file state.c.
| void aml_state_result_set | ( | aml_state_t * | state, |
| aml_object_t * | result | ||
| ) |
Set the result object of the state.
Note that methods are supposed to return copies of objects, not references to existing objects. However, due to the behaviour of implicit returns, always returning the last evaluated object, means there is no way for the object to be modified between this function being called and the method returning. So in this case it is acceptable to store a reference to the object and only make a copy when the method actually returns.
| state | Pointer to the state. |
| result | Pointer to the result object, or NULL to clear the result. |
Definition at line 120 of file state.c.