diff options
author | Christopher Davis <loafier@gmail.com> | 2006-06-23 03:51:52 +0000 |
---|---|---|
committer | Christopher Davis <loafier@gmail.com> | 2006-06-23 03:51:52 +0000 |
commit | 4d33c04f15e60e21a537edd635c9ac130312a3cb (patch) | |
tree | 9530c793afd67ef5c8319c452d33011c7f7fe197 /pysignals.h | |
parent | c76f11d4ead827d8e87e265131a3dee534bc0792 (diff) | |
download | irssi-python-4d33c04f15e60e21a537edd635c9ac130312a3cb.tar.gz irssi-python-4d33c04f15e60e21a537edd635c9ac130312a3cb.tar.xz irssi-python-4d33c04f15e60e21a537edd635c9ac130312a3cb.zip |
Began work on signal handler/map system. It seems to be working;
however, events with varying <cmd> text aren't handled because
it does a straight lookup in the hashtable with the signal name
to locate the argument list. Will need to change the system to
accomodate the <cmd> events.
The basics for reference arg support is there but not well tested.
git-svn-id: http://svn.irssi.org/repos/irssi-python@4289 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'pysignals.h')
-rw-r--r-- | pysignals.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/pysignals.h b/pysignals.h index 823472e..f9ace24 100644 --- a/pysignals.h +++ b/pysignals.h @@ -2,13 +2,26 @@ #define _PYSIGNALS_H_ #include <Python.h> -typedef struct +/* forward */ +struct _PY_SIGNAL_SPEC_REC; + +typedef struct _PY_SIGNAL_REC { - char *name; + struct _PY_SIGNAL_SPEC_REC *signal; + char *command; /* NULL if this is signal */ PyObject *handler; -} PY_COMMAND_REC; +} PY_SIGNAL_REC; -void py_command_bind(const char *category, PY_COMMAND_REC *crec); -void py_command_unbind(PY_COMMAND_REC *crec); +PY_SIGNAL_REC *pysignals_command_bind(const char *cmd, PyObject *func, + const char *category, int priority); +PY_SIGNAL_REC *pysignals_signal_add(const char *signal, PyObject *func, + int priority); +void pysignals_command_unbind(PY_SIGNAL_REC *rec); +void pysignals_signal_remove(PY_SIGNAL_REC *rec); +void pysignals_remove_generic(PY_SIGNAL_REC *rec); +int pysignals_register(const char *name, const char *arglist); +int pysignals_unregister(const char *name); +void pysignals_init(void); +void pysignals_deinit(void); #endif |