diff options
Diffstat (limited to 'source/lib')
-rw-r--r-- | source/lib/debug.c | 8 | ||||
-rw-r--r-- | source/lib/dmallocmsg.c | 14 | ||||
-rw-r--r-- | source/lib/messages.c | 17 | ||||
-rw-r--r-- | source/lib/tallocmsg.c | 5 |
4 files changed, 28 insertions, 16 deletions
diff --git a/source/lib/debug.c b/source/lib/debug.c index 00f6b0e72ff..5f141661106 100644 --- a/source/lib/debug.c +++ b/source/lib/debug.c @@ -472,7 +472,7 @@ BOOL debug_parse_levels(const char *params_str) ****************************************************************************/ static void debug_message(int msg_type, struct process_id src, - void *buf, size_t len) + void *buf, size_t len, void *private_data) { const char *params_str = (const char *)buf; @@ -509,7 +509,7 @@ void debug_message_send(pid_t pid, const char *params_str) ****************************************************************************/ static void debuglevel_message(int msg_type, struct process_id src, - void *buf, size_t len) + void *buf, size_t len, void *private_data) { char *message = debug_list_class_names_and_levels(); @@ -539,8 +539,8 @@ void debug_init(void) initialised = True; - message_register(MSG_DEBUG, debug_message); - message_register(MSG_REQ_DEBUGLEVEL, debuglevel_message); + message_register(MSG_DEBUG, debug_message, NULL); + message_register(MSG_REQ_DEBUGLEVEL, debuglevel_message, NULL); for(p = default_classname_table; *p; p++) { debug_add_class(*p); diff --git a/source/lib/dmallocmsg.c b/source/lib/dmallocmsg.c index 1b2308ecba6..fed7bf59c52 100644 --- a/source/lib/dmallocmsg.c +++ b/source/lib/dmallocmsg.c @@ -35,8 +35,10 @@ static unsigned long our_dm_mark = 0; * Respond to a POOL_USAGE message by sending back string form of memory * usage stats. **/ -static void msg_req_dmalloc_mark(int UNUSED(msg_type), struct process_id UNUSED(src_pid), - void *UNUSED(buf), size_t UNUSED(len)) +static void msg_req_dmalloc_mark(int UNUSED(msg_type), + struct process_id UNUSED(src_pid), + void *UNUSED(buf), size_t UNUSED(len), + void *private_data) { #ifdef ENABLE_DMALLOC our_dm_mark = dmalloc_mark(); @@ -50,7 +52,8 @@ static void msg_req_dmalloc_mark(int UNUSED(msg_type), struct process_id UNUSED( static void msg_req_dmalloc_log_changed(int UNUSED(msg_type), struct process_id UNUSED(src_pid), - void *UNUSED(buf), size_t UNUSED(len)) + void *UNUSED(buf), size_t UNUSED(len), + void *private_data) { #ifdef ENABLE_DMALLOC dmalloc_log_changed(our_dm_mark, True, True, True); @@ -66,7 +69,8 @@ static void msg_req_dmalloc_log_changed(int UNUSED(msg_type), **/ void register_dmalloc_msgs(void) { - message_register(MSG_REQ_DMALLOC_MARK, msg_req_dmalloc_mark); - message_register(MSG_REQ_DMALLOC_LOG_CHANGED, msg_req_dmalloc_log_changed); + message_register(MSG_REQ_DMALLOC_MARK, msg_req_dmalloc_mark, NULL); + message_register(MSG_REQ_DMALLOC_LOG_CHANGED, + msg_req_dmalloc_log_changed, NULL); DEBUG(2, ("Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED\n")); } diff --git a/source/lib/messages.c b/source/lib/messages.c index de17a03afc1..d2313734752 100644 --- a/source/lib/messages.c +++ b/source/lib/messages.c @@ -66,7 +66,9 @@ struct message_rec { static struct dispatch_fns { struct dispatch_fns *next, *prev; int msg_type; - void (*fn)(int msg_type, struct process_id pid, void *buf, size_t len); + void (*fn)(int msg_type, struct process_id pid, void *buf, size_t len, + void *private_data); + void *private_data; } *dispatch_fns; /**************************************************************************** @@ -102,7 +104,7 @@ static void sig_usr1(void) ****************************************************************************/ static void ping_message(int msg_type, struct process_id src, - void *buf, size_t len) + void *buf, size_t len, void *private_data) { const char *msg = buf ? (const char *)buf : "none"; @@ -133,7 +135,7 @@ BOOL message_init(void) CatchSignal(SIGUSR1, SIGNAL_CAST sig_usr1); - message_register(MSG_PING, ping_message); + message_register(MSG_PING, ping_message, NULL); /* Register some debugging related messages */ @@ -493,7 +495,9 @@ void message_dispatch(void) for (dfn = dispatch_fns; dfn; dfn = dfn->next) { if (dfn->msg_type == msg_type) { DEBUG(10,("message_dispatch: processing message of type %d.\n", msg_type)); - dfn->fn(msg_type, src, len ? (void *)buf : NULL, len); + dfn->fn(msg_type, src, + len ? (void *)buf : NULL, len, + dfn->private_data); n_handled++; break; } @@ -516,7 +520,9 @@ void message_dispatch(void) void message_register(int msg_type, void (*fn)(int msg_type, struct process_id pid, - void *buf, size_t len)) + void *buf, size_t len, + void *private_data), + void *private_data) { struct dispatch_fns *dfn; @@ -535,6 +541,7 @@ void message_register(int msg_type, dfn->msg_type = msg_type; dfn->fn = fn; + dfn->private_data = private_data; DLIST_ADD(dispatch_fns, dfn); } diff --git a/source/lib/tallocmsg.c b/source/lib/tallocmsg.c index e4e9bac94d6..0f493538f3c 100644 --- a/source/lib/tallocmsg.c +++ b/source/lib/tallocmsg.c @@ -66,7 +66,8 @@ static void msg_pool_usage_helper(const void *ptr, int depth, int max_depth, int * usage stats. **/ void msg_pool_usage(int msg_type, struct process_id src_pid, - void *UNUSED(buf), size_t UNUSED(len)) + void *UNUSED(buf), size_t UNUSED(len), + void *private_data) { struct msg_pool_usage_state state; @@ -100,6 +101,6 @@ void msg_pool_usage(int msg_type, struct process_id src_pid, **/ void register_msg_pool_usage(void) { - message_register(MSG_REQ_POOL_USAGE, msg_pool_usage); + message_register(MSG_REQ_POOL_USAGE, msg_pool_usage, NULL); DEBUG(2, ("Registered MSG_REQ_POOL_USAGE\n")); } |