use nix build & meson & zlog
This commit is contained in:
parent
0123623742
commit
346768a144
60 changed files with 13739 additions and 0 deletions
30
src/include/hook.h
Normal file
30
src/include/hook.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue