feat(plugin manager): integrated plugin manager, build success

This commit is contained in:
yangwei
2024-05-17 16:55:46 +08:00
committed by luwenpeng
parent db611561f6
commit e0ec3f2d52
17 changed files with 1201 additions and 62 deletions

36
include/stellar/utils.h Normal file
View File

@@ -0,0 +1,36 @@
#pragma once
#include <stdlib.h> //calloc
#include <stddef.h> //NULL
#define ALLOC(type, number) ((type *)calloc(sizeof(type), number))
#define CALLOC(type, number) ((type *)calloc(sizeof(type), number))
#define REALLOC(type, ptr, number) ((type *)realloc(ptr, (number) * sizeof(type)))
#define FREE(p) {free(p); p = NULL;}
#define TRUE 1
#define FALSE 0
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
#ifndef container_of
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
#endif
#ifndef __unused
#define __unused __attribute__((__unused__))
#endif