egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

add_builtins() funcname

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming
View previous topic :: View next topic  
Author Message
Kappa007
Voice


Joined: 26 Jul 2005
Posts: 38

PostPosted: Tue Nov 29, 2005 9:41 am    Post subject: add_builtins() funcname Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Wed Nov 30, 2005 12:11 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Kappa007
Voice


Joined: 26 Jul 2005
Posts: 38

PostPosted: Fri Jan 20, 2006 7:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber