This repository has been archived on 2024-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
MainTree/core/src-c/state.c

30 lines
645 B
C
Raw Normal View History

#include <state.h>
#include <librr/strutil.h>
#include <librr/memory.h>
#include <stdlib.h>
MtState mt_initialize(char *app_name)
{
usz_t len_app_name = rr_measure_string(app_name);
MtState state = malloc(sizeof(struct MtState));
state->app_name = malloc(len_app_name + 1);
rr_memcopy(state->app_name, app_name, len_app_name + 1);
state->tag_registry = mt_create_tag_registry(state);
return state;
}
void mt_cleanup(MtState state)
{
mt_delete_entity_registry(&state->entity_list);
free(state);
}
/* TODO: This function should start a new thread with a worker system.
void mt_start(MtState state)
{
}
*/