23 lines
456 B
C
23 lines
456 B
C
#include "context.h"
|
|
|
|
satori_ctx_ptr satori_ctx_alloc(void) {
|
|
satori_ctx_ptr ctx = malloc(sizeof(satori_ctx));
|
|
memset(ctx, 0, sizeof(satori_ctx));
|
|
return ctx;
|
|
}
|
|
|
|
void satori_ctx_free(satori_ctx_ptr ctx) {
|
|
if(ctx == NULL) return;
|
|
|
|
if(ctx->futami != NULL)
|
|
sat_futami_free(ctx->futami);
|
|
|
|
if(ctx->persist != NULL)
|
|
sat_persist_free(ctx->persist);
|
|
|
|
if(ctx->config != NULL)
|
|
sat_config_free(ctx->config);
|
|
|
|
free(ctx);
|
|
}
|