nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Jan 24, 2010 10:40 am Post subject: |
|
|
If you are referring to the different bindings, each type of binding has a specific set of arguments that the called C function is expected to accept. All in all, very much alike the normal bind command.
Perhaps an example taken from the channels module, the .+chan dcc chat command:
| Code: | /* The actual C function that will be mapped to the tcl namespace
* Compared to the tcl "bind dcc", having "handle idx text" as arguments
*/
static void cmd_pls_chan(struct userrec *u, int idx, char *par)
{
char *chname;
struct chanset_t *chan;
...
}
/* Now to map the function into a dcc partyline command
* DCC CHAT COMMANDS
*
* Function call should be:
* int cmd_whatever(idx,"parameters");
*
* NOTE: As with msg commands, the function is responsible for any logging.
*/
static cmd_t C_dcc_irc[] = {
...
{"+chan", "n", (Function) cmd_pls_chan, NULL},
...
{NULL, NULL, NULL, NULL}
}; |
The C_dcc_irc array is then used with add_builtins and del_builtins, which is then responsible for creating the tcl command and mapping it to your function, and register the proper binding.
There are many kinds of "builtins", and each one has it's own setup of expected argument list, so you'll have to check/dig through the code to see what's needed for your kind of command/binding/builtin _________________ NML_375, idling at #eggdrop@IrcNET |
|