00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef lint
00021 static const char rcsid[] = "$Id: eggdrop.c,v 1.27 2006-11-14 14:51:23 sven Exp $";
00022 #endif
00023
00024 #include <eggdrop/eggdrop.h>
00025
00026
00027 static bind_table_t *BT_event = NULL;
00028
00029
00030 static const char **eggparams = NULL;
00031 static int neggparams = 0;
00032
00033 int eggdrop_init(void)
00034 {
00035 BT_event = bind_table_add(BTN_EVENT, 1, "s", MATCH_MASK, BIND_STACKABLE);
00036
00037 config_init();
00038 timer_init();
00039 egg_net_init();
00040 logging_init();
00041 user_init();
00042 script_init();
00043 partyline_init();
00044 botnet_init();
00045 module_init();
00046 help_init();
00047
00048
00049 return 1;
00050 }
00051
00052 int eggdrop_shutdown(void)
00053 {
00054 module_shutdown();
00055 botnet_shutdown();
00056 partyline_shutdown();
00057 script_shutdown();
00058 user_shutdown();
00059 logging_shutdown();
00060 egg_net_shutdown();
00061 timer_shutdown();
00062 config_shutdown();
00063 bind_table_del(BT_event);
00064
00065 return 1;
00066 }
00067
00068 int eggdrop_event(const char *event)
00069 {
00070 return bind_check(BT_event, NULL, event, event);
00071 }
00072
00073
00074 int eggdrop_set_params(const char **params, int nparams)
00075 {
00076 eggparams = params;
00077 neggparams = nparams;
00078 return(0);
00079 }
00080
00081
00082 const char *eggdrop_get_param(const char *key)
00083 {
00084 int i, nparams;
00085
00086 nparams = neggparams - 1;
00087 for (i = 0; i < nparams; i += 2) {
00088 if (!strcasecmp(eggparams[i], key)) return(eggparams[i+1]);
00089 }
00090 return(NULL);
00091 }