PatchworkOS  a7b3d61
A non-POSIX operating system.
Loading...
Searching...
No Matches
State

State. More...

Collaboration diagram for State:

Detailed Description

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_taml_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.
 

Function Documentation

◆ aml_state_init()

uint64_t aml_state_init ( aml_state_t state,
aml_object_t **  args 
)

Initialize an AML state.

Parameters
statePointer to the state to initialize.
argsArray of pointers to the objects to pass as arguments, or NULL. Must be null-terminated.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 8 of file state.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_state_deinit()

void aml_state_deinit ( aml_state_t state)

Deinitialize an AML state.

Parameters
statePointer to the state to deinitialize.

Definition at line 68 of file state.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_state_result_get()

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.

See also
aml_method_invoke() for more details.
Parameters
statePointer to the state.
Returns
On success, a copy of the result object. On failure, NULL and errno is set.

Definition at line 87 of file state.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_state_result_set()

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.

See also
aml_method_invoke() for more details.
Parameters
statePointer to the state.
resultPointer to the result object, or NULL to clear the result.

Definition at line 120 of file state.c.

Here is the caller graph for this function: