feat(exdata & mq header): define default free_cb

This commit is contained in:
yangwei
2024-08-08 15:35:00 +08:00
committed by luwenpeng
parent 90ca08568e
commit 2d408b3503
2 changed files with 15 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "utils.h"
#include "stellar.h"
#ifdef __cplusplus
@@ -8,6 +9,13 @@ extern "C"
#endif
typedef void stellar_exdata_free(int idx, void *ex_ptr, void *arg);
inline static void stellar_exdata_free_default(int idx __unused, void *ex_ptr, void *arg __unused)
{
if(ex_ptr)FREE(ex_ptr);
}
int stellar_exdata_new_index(struct stellar *st, const char *name, stellar_exdata_free *free_func,void *arg);
//packet exdata api