| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #include <stdint.h>
- #include <stddef.h>
- #include <stdbool.h>
- #include "models.h"
- #include "status.h"
- #include "process.h"
- #ifndef ZIVUOS_USE_STATIC
- #include <malloc.h>
- #endif
- #ifndef ZIVUOS_USE_STATIC
- zv_process_t * zv_process_create() {
- zv_process_t *self = (zv_process_t *) malloc(sizeof(zv_process_t));
- if (self == NULL) {
- return NULL;
- }
- self->is_dynamic = true;
- self->status = ZV_STATUS_CREATING;
- self->next = NULL;
- return self;
- }
- zv_process_t * zv_process_remove(zv_process_t *self) {
- zv_process_t *next = self->next;
- if (self->is_dynamic) {
- free(self);
- }
- return next;
- }
- #else
- zv_process_t * zv_process_create() {
- return NULL;
- }
- zv_process_t * zv_process_remove(zv_process_t *self) {
- return self->next;
- }
- #endif
|