mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 06:51:08 +01:00
hook: allow hook_data to have non-const arguments, add hook_cdata for arguments that must be treated const
This commit is contained in:
parent
cf549495d8
commit
48a2b7c182
2 changed files with 9 additions and 2 deletions
|
@ -42,12 +42,19 @@ void add_hook(const char *name, hookfn fn);
|
||||||
void remove_hook(const char *name, hookfn fn);
|
void remove_hook(const char *name, hookfn fn);
|
||||||
void call_hook(int id, void *arg);
|
void call_hook(int id, void *arg);
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
struct Client *client;
|
||||||
|
void *arg1;
|
||||||
|
void *arg2;
|
||||||
|
} hook_data;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
struct Client *client;
|
struct Client *client;
|
||||||
const void *arg1;
|
const void *arg1;
|
||||||
const void *arg2;
|
const void *arg2;
|
||||||
} hook_data;
|
} hook_cdata;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,7 +82,7 @@ mo_links(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
|
||||||
const char *mask = "";
|
const char *mask = "";
|
||||||
struct Client *target_p;
|
struct Client *target_p;
|
||||||
char clean_mask[2 * HOSTLEN + 4];
|
char clean_mask[2 * HOSTLEN + 4];
|
||||||
hook_data hd;
|
hook_cdata hd;
|
||||||
|
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue