0
0
Fork 0
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:
William Pitcock 2016-02-20 17:44:13 -06:00
parent cf549495d8
commit 48a2b7c182
2 changed files with 9 additions and 2 deletions

View file

@ -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
{ {

View file

@ -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;