Another problem: when compiling the file with .c extension the module loads fine but compiled with .cpp it sais:
base: Error loading module: base.so: undefined symbol: base_start__Fv
lobz wrote:Another problem: when compiling the file with .c extension the module loads fine but compiled with .cpp it sais:
base: Error loading module: base.so: undefined symbol: base_start__Fv
The module's name is "base"
I solved thisone. I put the base_start function's declaration in extern "C" {}
Well, i've been looking deep in module.h, and I did realy found some usefull funcions.
However i havent found how do I get a user entry (struct userrec *) by a string containig the nick, or how to get the handle by the nick like in TCL (nick2hand).
i've found function get_user_by_nick(char *nick); in userrec.c but this one is not working, i always get a segment violation.
why do i need this? Well im working with a H_raw, i need to check the flags of the user and i only now his nick (in a string). Am I thinking well? Is there another way to do this?
Are you sure get_user_by_nick is crashing? It returns NULL if the nick doesn't match any user. Use putlog() to figure out exactly where it is crashing. You can even add putlogs into userrec.c. This will help a lot in debugging.