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.

understanding woobie...

Discussion of Eggdrop's code and module programming in C.
Post Reply
s
stilllearning
Voice
Posts: 8
Joined: Sun Jan 29, 2006 1:58 am

understanding woobie...

Post by stilllearning »

Been reviewing woobie module and learning some C...
Have a few questions though...

- Why is module_start declared as a char?

/* This function table is exported and may be used by other modules and
* the core.
*
* The first four have to be defined (you may define them as NULL), as
* they are checked by eggdrop core.
*/
static Function woobie_table[] = {
(Function) woobie_start,
(Function) woobie_close,
(Function) woobie_expmem,
(Function) woobie_report,
};
- How would i define them as NULL?
Make a function and just put return NULL; ?

- How can I make my module kill/stop eggdrop from loading if sanity checking I implement fails?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

those are function pointers, so you can simply replace them with NULLs

terminating eggdrop from a module wouldn't be a correct behaviour, but you can do that by calling exit()
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
s
stilllearning
Voice
Posts: 8
Joined: Sun Jan 29, 2006 1:58 am

Post by stilllearning »

demond wrote:those are function pointers, so you can simply replace them with NULLs
How would I write that? I mean the correct syntax
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you need to learn C before trying to modify C programs

refer to your C book, section "Function pointers"
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
Post Reply