On Tue, Aug 27, 2002 at 04:10:52PM +0300, Timo Sirainen wrote:
> Maybe if all I did was move the signal definitions from signals.txt to
> sources. Something like
>
> signal_register("event ", "SERVER_REC", "string", "string", "string", NULL);
>
> And maybe to prevent typos breaking things:
>
> signal_arg_register("SERVER_REC");
> signal_register("event ", "SERVER_REC", ARG_STRING, ARG_STRING, ARG_STRING, NULL);
>
> and signal_register() would fail if it found any unregistered arguments.
>
> Scripts could also then create their own signals using
> Irssi::signal_register().
This sounds like a good plan to me.
In the mean time, what I'm doing is to work like C does. Signals that
python code receives pass along up to 6 PyCObjects, which are just
wrappers around void *'s. Then, the signal functions "casts" them using
functions from the irssi module to the correct type. I've only tested
this with the Server type (since that's all I've implemented so far) but
it seems to be working.
Hmmm, there's no reason that until signal_register is in the core, it
couldn't be a python function that assists in automatic type selection.