| View previous topic :: View next topic |
| Author |
Message |
Kappa007 Voice
Joined: 26 Jul 2005 Posts: 38
|
Posted: Tue Nov 29, 2005 9:41 am Post subject: add_builtins() funcname |
|
|
Eggdrop defines following structure:
| Code: |
typedef struct {
char *name;
char *flags;
Function func;
char *funcname;
} cmd_t;
|
"name" is the command name bound to the TCL interpreter.
"flags" are the flags required to trigger the callback "func".
But what purpose does "funcname" serve?
Can you see the string defined there anywhere?
After a grep over all files all I could find about it was in add_builtins/rem_builtins:
| Code: |
egg_snprintf(p, sizeof p, "*%s:%s", tl->name,
cc[i].funcname ? cc[i].funcname : cc[i].name);
|
Which just sets it to name if it's not set.
Regards,
Kappa |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Wed Nov 30, 2005 12:11 am Post subject: |
|
|
it has probably been added with the idea of aliasing, but later abandoned _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
Kappa007 Voice
Joined: 26 Jul 2005 Posts: 38
|
Posted: Fri Jan 20, 2006 7:17 pm Post subject: |
|
|
| demond wrote: | | it has probably been added with the idea of aliasing, but later abandoned |
Actually it's not abandoned at all.
After looking around in tclhash.c for some hours I found it at another place: It tags the function in the Tcl subsystem.
When checking ".binds" you find the string passed here
| Code: |
pub -|- !help 0 *pub:<funcname>
|
That is only if the string is not empty otherwise the "name" of the "cmt_t" struct is passed.
It also shows up in the "tcl_cmd_t" struct as "func_name" which looks like "*<table>:<funcname>".
That's pretty handy if one wants to modify the arguments of a particular command (in check_tcl_bind()). |
|
| Back to top |
|
 |
|