TinyMUSH 3.3
TinyMUSH Server
|
MUSH function handlers. More...
#include "config.h"
#include "constants.h"
#include "typedefs.h"
#include "macros.h"
#include "externs.h"
#include "prototypes.h"
#include <stdbool.h>
#include <ctype.h>
#include <string.h>
#include <dlfcn.h>
Functions | |
int | parse_ext_access (int *, EXTFUNCS **, char *, NAMETAB *, dbref, char *) |
Parse an extended access list with module callouts. More... | |
void | init_functab (void) |
Initialize the function hashtable. More... | |
void | do_function (dbref player, dbref cause __attribute__((unused)), int key, char *fname, char *target) |
Add a function. More... | |
void | list_functable (dbref player) |
List available functions. More... | |
void | helper_list_funcaccess (dbref player, FUN *fp) |
Helper function for list_funcaccess. More... | |
void | list_funcaccess (dbref player) |
List function access rights. More... | |
int | cf_func_access (int *vp __attribute__((unused)), char *str, long extra, dbref player, char *cmd) |
Set access on functions. More... | |
Variables | |
UFUN * | ufun_head |
OBJXFUNCS | xfunctions |
const Delim | SPACE_DELIM = {1, " "} |
FUN | flist [] |
List of existing MUSHCode functions in alphabetical order. More... | |
MUSH function handlers.
int cf_func_access | ( | int *vp | __attribute__(unused), |
char * | str, | ||
long | extra, | ||
dbref | player, | ||
char * | cmd | ||
) |
Set access on functions.
vp | Not used |
str | Name of function |
extra | Nametab |
player | DBref of player |
cmd | Command |
void do_function | ( | dbref | player, |
dbref cause | __attribute__(unused), | ||
int | key, | ||
char * | fname, | ||
char * | target | ||
) |
Add a function.
player | DBref of player |
cause | Not used |
key | Key |
fname | Function name |
target | Target |
Check for list first
Make it case-insensitive, and look it up.
No name given, list them all.
Make a local uppercase copy of the function name
Verify that the function doesn't exist in the builtin table
Make sure the target object exists
Make sure the attribute exists
Make sure attribute is readably by me
Privileged functions require you control the obj.
See if function already exists. If so, redefine it
void helper_list_funcaccess | ( | dbref | player, |
FUN * | fp | ||
) |
Helper function for list_funcaccess.
player | DBref of player |
fp | Function |
void init_functab | ( | void | ) |
Initialize the function hashtable.
void list_funcaccess | ( | dbref | player | ) |
List function access rights.
player | DBref of player |
void list_functable | ( | dbref | player | ) |
List available functions.
player |
int parse_ext_access | ( | int * | perms, |
EXTFUNCS ** | xperms, | ||
char * | str, | ||
NAMETAB * | ntab, | ||
dbref | player, | ||
char * | cmd | ||
) |
Parse an extended access list with module callouts.
perms | Permissions |
xperms | Extendes permissions |
str | String buffer |
ntab | Name Table |
player | DBref of player |
cmd | Command |
Walk through the tokens
Check for negation
Set or clear the appropriate bit
Is this a module callout?
Split it apart, see if we have anything.
Get the next token
FUN flist[] |
List of existing MUSHCode functions in alphabetical order.