30 lines
645 B
C
30 lines
645 B
C
|
#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)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
*/
|