feat(infra/exdata): exdata as independent component

This commit is contained in:
yangwei
2024-09-06 18:36:24 +08:00
parent 3de8bbdabc
commit a24214cbee
12 changed files with 270 additions and 177 deletions

View File

@@ -0,0 +1,35 @@
#pragma once
#include "uthash/utarray.h"
#include "exdata.h"
struct exdata_schema
{
UT_array *exdata_meta_array;
};
struct exdata_meta
{
char *name;
exdata_free *free_func;
void *free_arg;
int idx;
}__attribute__((aligned(sizeof(void*))));
enum exdata_state
{ INIT, ACTIVE, EXIT };
struct exdata
{
void *exdata;
enum exdata_state state;
};
struct exdata_handle
{
struct exdata_schema *schema;
struct exdata *exdata_array;
};