use nix build & meson & zlog

This commit is contained in:
Rongsong Shen 2025-11-03 18:19:59 +08:00
parent 0123623742
commit 346768a144
60 changed files with 13739 additions and 0 deletions

30
src/include/hook.h Normal file
View file

@ -0,0 +1,30 @@
#if !defined(__HOOK_H__)
#define __HOOK_H__ 1
#include <stdarg.h>
#include <stddef.h>
#include "xlist.h"
#define HOOK_BEFORE_EVENT (0)
#define HOOK_AFTER_EVENT (1)
typedef int (*hook_fn_t)(int, int, int, void*, va_list);
typedef struct {
hook_fn_t fn;
void* data;
} hook_item_t;
typedef struct {
int maxtypes;
xlist_t* hooks;
} hooksys_t;
extern int xce_hook_init(hooksys_t*, int);
extern int xce_add_hook(hooksys_t*, int,
hook_fn_t, void*);
extern int xce_run_hooks(hooksys_t*, int, int, int, ...);
extern void xce_hook_fini(hooksys_t*);
#endif