modules/script/scriptbind.c File Reference

#include <eggdrop/eggdrop.h>
#include "egg_script_internal.h"

Go to the source code of this file.

Functions

static int script_bind (char *table_name, char *flags, char *mask, script_callback_t *callback)
static int script_unbind (char *table_name, char *mask, char *name)
static int script_rebind (char *table_name, char *flags, char *mask, char *command, char *newflags, char *newmask)

Variables

static const char rcsid [] = "$Id: scriptbind.c,v 1.18 2006-10-03 04:02:13 sven Exp $"
script_command_t script_bind_cmds []


Function Documentation

static int script_bind ( char *  table_name,
char *  flags,
char *  mask,
script_callback_t callback 
) [static]

Definition at line 32 of file scriptbind.c.

References _, bind_entry_add(), bind_table_lookup(), BIND_WANTS_CD, script_callback_b::callback, LOG_MISC, script_callback_b::name, NULL, script_callback_b::owner, putlog(), script_callback_b::syntax, and bind_table_b::syntax.

00033 {
00034   bind_table_t *table;
00035 
00036   table = bind_table_lookup(table_name);
00037   if (!table) {
00038     putlog (LOG_MISC, "*", _("Script '%s' accessed non-existing bind table '%s'."),
00039         NULL, table_name);
00040     return(1);
00041   }
00042 
00043   if (table->syntax) callback->syntax = strdup(table->syntax);
00044   else callback->syntax = NULL;
00045 
00046   return bind_entry_add(table, flags, mask, callback->name, BIND_WANTS_CD, callback->callback, callback, callback->owner);
00047 }

static int script_rebind ( char *  table_name,
char *  flags,
char *  mask,
char *  command,
char *  newflags,
char *  newmask 
) [static]

Definition at line 61 of file scriptbind.c.

References bind_entry_modify(), and bind_table_lookup().

00062 {
00063   bind_table_t *table;
00064 
00065   table = bind_table_lookup(table_name);
00066   if (!table) return(-1);
00067   return bind_entry_modify(table, mask, command, newflags, newmask);
00068 }

static int script_unbind ( char *  table_name,
char *  mask,
char *  name 
) [static]

Definition at line 49 of file scriptbind.c.

References bind_entry_del(), bind_table_lookup(), and NULL.

00050 {
00051   bind_table_t *table;
00052   int retval;
00053 
00054   table = bind_table_lookup(table_name);
00055   if (!table) return(1);
00056 
00057   retval = bind_entry_del(table, mask, name, NULL);
00058   return(retval);
00059 }


Variable Documentation

const char rcsid[] = "$Id: scriptbind.c,v 1.18 2006-10-03 04:02:13 sven Exp $" [static]

Definition at line 21 of file scriptbind.c.

Initial value:

 {
  {"", "bind", script_bind, NULL, 4, "sssc", "table flags mask command", SCRIPT_INTEGER, 0},  
  {"", "unbind", script_unbind, NULL, 3, "sss", "table mask command", SCRIPT_INTEGER, 0},   
  {"", "rebind", script_rebind, NULL, 6, "ssssss", "table flags mask command newflags newmask", SCRIPT_INTEGER, 0},
  {0}
}

Definition at line 70 of file scriptbind.c.


Generated on Sun Nov 30 18:43:36 2008 for eggdrop1.9 by  doxygen 1.5.6