It would be nice if there would be alternative commands to create commands and messages that take an extra parameter that is then passed as a parameter to the callback function.
Example:
void AnopeInit(void) {
void *para = "some parameter";
msg = createMessageParameter("PRIVMSG", my_privmsg, para);
moduleAddMessage(msg, MOD_TAIL);
}
int my_privmsg(char *source, int ac, char **msg, void *para) {
/* para is "some parameter" */
}
That woud allow creating multi purpose callbacks that behave differently depending on their parameter but generally are the same code. A flag can be used to remember which function was used to create the message and then anope can call the old or new callback depending on the flag.