src/mod/woobie.mod/woobie.c File Reference

#include "src/mod/module.h"
#include <stdlib.h>
Include dependency graph for woobie.c:

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 Functionglobal = 0
static cmd_t mydcc []
static Function woobie_table []

Define Documentation

#define MAKING_WOOBIE

Definition at line 29 of file woobie.c.

#define MODULE_NAME   "woobie"

Definition at line 28 of file woobie.c.


Function Documentation

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 }

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

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 (  ) 

Variable Documentation

Function* global = 0 [static]

Definition at line 38 of file woobie.c.

cmd_t mydcc[] [static]
Initial value:
 {
  
  {"woobie",  "",    cmd_woobie,   0 },
  { 0 ,       0 ,   0 ,         0 }  
}

Definition at line 91 of file woobie.c.

Function woobie_table[] [static]
Initial value:

Definition at line 116 of file woobie.c.

Referenced by woobie_start().


Generated on 7 Sep 2016 for Eggdrop by  doxygen 1.6.1