diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/commands.c | 2 | ||||
-rw-r--r-- | src/core/pidwait.c | 2 | ||||
-rw-r--r-- | src/core/rawlog.c | 2 | ||||
-rw-r--r-- | src/core/signals.c | 8 | ||||
-rw-r--r-- | src/core/signals.h | 4 |
5 files changed, 11 insertions, 7 deletions
diff --git a/src/core/commands.c b/src/core/commands.c index 3e189913..b2151c1e 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -554,7 +554,7 @@ void commands_init(void) cmdget_funcs = NULL; current_command = NULL; - signal_default_command = module_get_uniq_id_str("signals", "default command"); + signal_default_command = signal_get_uniq_id("default command"); settings_add_str("misc", "cmdchars", "/"); signal_add("send command", (SIGNAL_FUNC) event_command); diff --git a/src/core/pidwait.c b/src/core/pidwait.c index 7f6d77e3..1c0ef775 100644 --- a/src/core/pidwait.c +++ b/src/core/pidwait.c @@ -63,7 +63,7 @@ void pidwait_init(void) pids = NULL; childcheck_tag = g_timeout_add(1000, (GSourceFunc) child_check, NULL); - signal_pidwait = module_get_uniq_id_str("signals", "pidwait"); + signal_pidwait = signal_get_uniq_id("pidwait"); } void pidwait_deinit(void) diff --git a/src/core/rawlog.c b/src/core/rawlog.c index 8193f26f..3f422fa1 100644 --- a/src/core/rawlog.c +++ b/src/core/rawlog.c @@ -154,7 +154,7 @@ static void read_settings(void) void rawlog_init(void) { - signal_rawlog = module_get_uniq_id_str("signals", "rawlog"); + signal_rawlog = signal_get_uniq_id("rawlog"); settings_add_int("history", "rawlog_lines", 200); read_settings(); diff --git a/src/core/signals.c b/src/core/signals.c index f29d9b59..84cbb79d 100644 --- a/src/core/signals.c +++ b/src/core/signals.c @@ -52,7 +52,7 @@ void signal_add_to(const char *module, int pos, const char *signal, SIGNAL_FUNC g_return_if_fail(func != NULL); g_return_if_fail(pos >= 0 && pos < SIGNAL_LISTS); - signal_id = module_get_uniq_id_str("signals", signal); + signal_id = signal_get_uniq_id(signal); rec = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id)); if (rec == NULL) { @@ -146,7 +146,7 @@ void signal_remove(const char *signal, SIGNAL_FUNC func) g_return_if_fail(signal != NULL); g_return_if_fail(func != NULL); - signal_id = module_get_uniq_id_str("signals", signal); + signal_id = signal_get_uniq_id(signal); rec = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id)); found = rec == NULL ? 0 : signal_remove_from_lists(rec, signal_id, func); @@ -251,7 +251,7 @@ int signal_emit(const char *signal, int params, ...) int signal_id, ret; /* get arguments */ - signal_id = module_get_uniq_id_str("signals", signal); + signal_id = signal_get_uniq_id(signal); va_start(va, params); ret = signal_emitv_id(signal_id, params, va); @@ -291,7 +291,7 @@ void signal_stop_by_name(const char *signal) SIGNAL_REC *rec; int signal_id; - signal_id = module_get_uniq_id_str("signals", signal); + signal_id = signal_get_uniq_id(signal); rec = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id)); if (rec == NULL) g_warning("signal_stop_by_name() : unknown signal \"%s\"", signal); diff --git a/src/core/signals.h b/src/core/signals.h index 613aa245..ad684ab5 100644 --- a/src/core/signals.h +++ b/src/core/signals.h @@ -6,6 +6,10 @@ typedef void (*SIGNAL_FUNC) (gconstpointer, gconstpointer, gconstpointer, gconst void signals_init(void); void signals_deinit(void); +/* use this macro to convert the signal name to ID */ +#define signal_get_uniq_id(signal) \ + module_get_uniq_id_str("signals", signal) + /* bind a signal */ void signal_add_to(const char *module, int pos, const char *signal, SIGNAL_FUNC func); #define signal_add(a, b) signal_add_to(MODULE_NAME, 1, a, b) |