Skip to content

cf_coroutine_push

Category: coroutine
GitHub: cute_coroutine.h


Pushes some bytes onto the coroutine's storage.

CF_Result cf_coroutine_push(CF_Coroutine co, const void* data, size_t size);
Parameters Description
co The coroutine.
data The data to push into the storage.
size The size of data in bytes.
return Returns info on any errors as CF_Result.

Remarks

Each coroutine has an internal storage of 1k (1024) bytes. The purpose is to allow a formal communication/parameter passing in/out of coroutines via FIFO ordering. These storage are totally optional, and here merely for convenience.

CF_Coroutine
CF_CoroutineFn
CF_CoroutineState
cf_make_coroutine
cf_destroy_coroutine
cf_coroutine_state_to_string
cf_coroutine_resume
cf_coroutine_yield
cf_coroutine_state
cf_coroutine_get_udata
cf_coroutine_currently_running
cf_coroutine_pop
cf_coroutine_bytes_pushed
cf_coroutine_space_remaining