#include "src/mod/module.h"
#include <stdlib.h>
Go to the source code of this file.
Defines | |
#define | MODULE_NAME "woobie" |
#define | MAKING_WOOBIE |
Functions | |
static int | woobie_expmem () |
static int | cmd_woobie (struct userrec *u, int idx, char *par) |
static void | woobie_report (int idx, int details) |
static char * | woobie_close () |
char * | woobie_start () |
char * | woobie_start (Function *global_funcs) |
Variables | |
static Function * | global = 0 |
static cmd_t | mydcc [] |
static Function | woobie_table [] |
static int cmd_woobie | ( | struct userrec * | u, | |
int | idx, | |||
char * | par | |||
) | [static] |
Definition at line 50 of file woobie.c.
References Context, dcc, dprintf, LOG_CMDS, and putlog.
00051 { 00052 /* Define a context. 00053 * 00054 * If the bot crashes after the context, it will be the last mentioned 00055 * in the resulting DEBUG file. This helps you debugging. 00056 */ 00057 Context; 00058 00059 /* Log the command as soon as you're sure all parameters are valid. */ 00060 putlog(LOG_CMDS, "*", "#%s# woobie", dcc[idx].nick); 00061 00062 dprintf(idx, "WOOBIE!\n"); 00063 return 0; 00064 }
static char* woobie_close | ( | ) | [static] |
Definition at line 97 of file woobie.c.
References Context, H_dcc, MODULE_NAME, module_undepend, NULL, and rem_builtins.
00098 { 00099 Context; 00100 rem_builtins(H_dcc, mydcc); 00101 module_undepend(MODULE_NAME); 00102 return NULL; 00103 }
static int woobie_expmem | ( | ) | [static] |
Definition at line 42 of file woobie.c.
References Context.
Referenced by woobie_report().
00043 { 00044 int size = 0; 00045 00046 Context; 00047 return size; 00048 }
static void woobie_report | ( | int | idx, | |
int | details | |||
) | [static] |
Definition at line 72 of file woobie.c.
References dprintf, and woobie_expmem().
00073 { 00074 if (details) { 00075 int size = woobie_expmem(); 00076 00077 dprintf(idx, " Using %d byte%s of memory\n", size, 00078 (size != 1) ? "s" : ""); 00079 } 00080 }
char* woobie_start | ( | Function * | global_funcs | ) |
Definition at line 123 of file woobie.c.
References add_builtins, Context, global, H_dcc, module_depend, MODULE_NAME, module_register, module_undepend, NULL, and woobie_table.
00124 { 00125 /* Assign the core function table. After this point you use all normal 00126 * functions defined in src/mod/modules.h 00127 */ 00128 global = global_funcs; 00129 00130 Context; 00131 /* Register the module. */ 00132 module_register(MODULE_NAME, woobie_table, 2, 0); 00133 /* ^--- minor module version 00134 * ^------ major module version 00135 * ^-------------------- module function table 00136 * ^--------------------------------- module name 00137 */ 00138 00139 if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) { 00140 module_undepend(MODULE_NAME); 00141 return "This module requires Eggdrop 1.6.0 or later."; 00142 } 00143 00144 /* Add command table to bind list H_dcc, responsible for dcc commands. 00145 * Currently we only add one command, `woobie'. 00146 */ 00147 add_builtins(H_dcc, mydcc); 00148 return NULL; 00149 }
char* woobie_start | ( | ) |
{ {"woobie", "", cmd_woobie, 0 }, { 0 , 0 , 0 , 0 } }
Function woobie_table[] [static] |
{ (Function) woobie_start, (Function) woobie_close, (Function) woobie_expmem, (Function) woobie_report, }
Definition at line 116 of file woobie.c.
Referenced by woobie_start().