summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-06-04 01:36:07 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-06-04 01:36:07 +0000
commit35fab0c9ef3ec129e2a753fd6a659124d0e168ae (patch)
treece7d3d142161f11c7d7069bf29d59dba84cde075 /src/core
parent841736a7d359dd7f9ba0238589965ea205102415 (diff)
downloadirssi-35fab0c9ef3ec129e2a753fd6a659124d0e168ae.zip
Lots of DCC related fixes.
Added command_bind_first() and command_bind_last() functions. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@285 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r--src/core/commands.c4
-rw-r--r--src/core/commands.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/core/commands.c b/src/core/commands.c
index 10cf9123..1a05e7a3 100644
--- a/src/core/commands.c
+++ b/src/core/commands.c
@@ -39,7 +39,7 @@ char *current_command;
static GSList *cmdget_funcs;
static int signal_default_command;
-void command_bind(const char *cmd, const char *category, SIGNAL_FUNC func)
+void command_bind_to(int pos, const char *cmd, const char *category, SIGNAL_FUNC func)
{
COMMAND_REC *rec;
char *str;
@@ -53,7 +53,7 @@ void command_bind(const char *cmd, const char *category, SIGNAL_FUNC func)
if (func != NULL) {
str = g_strconcat("command ", cmd, NULL);
- signal_add(str, func);
+ signal_add_to(MODULE_NAME, pos, str, func);
g_free(str);
}
diff --git a/src/core/commands.h b/src/core/commands.h
index 554a60e5..dcff89c2 100644
--- a/src/core/commands.h
+++ b/src/core/commands.h
@@ -25,7 +25,11 @@ enum {
extern GSList *commands;
extern char *current_command;
-void command_bind(const char *cmd, const char *category, SIGNAL_FUNC func);
+void command_bind_to(int pos, const char *cmd, const char *category, SIGNAL_FUNC func);
+#define command_bind(a, b, c) command_bind_to(1, a, b, c)
+#define command_bind_first(a, b, c) command_bind_to(0, a, b, c)
+#define command_bind_last(a, b, c) command_bind_to(2, a, b, c)
+
void command_unbind(const char *cmd, SIGNAL_FUNC func);
void command_runsub(const char *cmd, const char *data, void *p1, void *p2);