TinyMUSH 3.3
TinyMUSH Server
Loading...
Searching...
No Matches
Functions | Variables
functions.c File Reference

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>
Include dependency graph for functions.c:

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

UFUNufun_head
 
OBJXFUNCS xfunctions
 
const Delim SPACE_DELIM = {1, " "}
 
FUN flist []
 List of existing MUSHCode functions in alphabetical order. More...
 

Detailed Description

MUSH function handlers.

Author
TinyMUSH development team (https://github.com/TinyMUSH)
Version
3.3
Date
2021-01-04

Function Documentation

◆ cf_func_access()

int cf_func_access ( int *vp   __attribute__(unused),
char *  str,
long  extra,
dbref  player,
char *  cmd 
)

Set access on functions.

Parameters
vpNot used
strName of function
extraNametab
playerDBref of player
cmdCommand
Returns
int Result

◆ do_function()

void do_function ( dbref  player,
dbref cause   __attribute__(unused),
int  key,
char *  fname,
char *  target 
)

Add a function.

Parameters
playerDBref of player
causeNot used
keyKey
fnameFunction name
targetTarget

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

◆ helper_list_funcaccess()

void helper_list_funcaccess ( dbref  player,
FUN fp 
)

Helper function for list_funcaccess.

Parameters
playerDBref of player
fpFunction

◆ init_functab()

void init_functab ( void  )

Initialize the function hashtable.

◆ list_funcaccess()

void list_funcaccess ( dbref  player)

List function access rights.

Parameters
playerDBref of player

◆ list_functable()

void list_functable ( dbref  player)

List available functions.

Parameters
player

◆ parse_ext_access()

int parse_ext_access ( int *  perms,
EXTFUNCS **  xperms,
char *  str,
NAMETAB ntab,
dbref  player,
char *  cmd 
)

Parse an extended access list with module callouts.

Parameters
permsPermissions
xpermsExtendes permissions
strString buffer
ntabName Table
playerDBref of player
cmdCommand
Returns
CF_Result

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

Variable Documentation

◆ flist

FUN flist[]

List of existing MUSHCode functions in alphabetical order.