This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

add_builtins() funcname

Discussion of Eggdrop's code and module programming in C.
Post Reply
K
Kappa007
Voice
Posts: 38
Joined: Tue Jul 26, 2005 9:53 pm

add_builtins() funcname

Post by Kappa007 »

Eggdrop defines following structure:

Code: Select all

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: Select all

    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
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
K
Kappa007
Voice
Posts: 38
Joined: Tue Jul 26, 2005 9:53 pm

Post by Kappa007 »

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: Select all

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()).
Post Reply