#include "copyright.h"
#include "config.h"
#include "db.h"
#include "externs.h"
#include "htab.h"
#include "alloc.h"
#include "mudconf.h"
Include dependency graph for nametab.c:
Go to the source code of this file.
Functions | |
int | search_nametab (dbref player, NAMETAB *ntab, char *flagname) |
NAMETAB * | find_nametab_ent (dbref player, NAMETAB *ntab, char *flagname) |
void | display_nametab (dbref player, NAMETAB *ntab, char *prefix, int list_if_none) |
void | interp_nametab (dbref player, NAMETAB *ntab, int flagword, char *prefix, char *true_text, char *false_text) |
void | listset_nametab (dbref player, NAMETAB *ntab, int flagword, char *prefix, int list_if_none) |
void | cf_log_notfound (dbref, char *, const char *, char *) |
int | cf_ntab_access (int *vp, char *str, long extra, dbref player, char *cmd) |
void cf_log_notfound | ( | dbref | , | |
char * | , | |||
const char * | , | |||
char * | ||||
) |
Definition at line 430 of file conf.c.
References alloc_lbuf, free_lbuf, statedata::initializing, log_error(), LOG_STARTUP, mudstate, and notify.
00432 { 00433 char *buff; 00434 00435 if(mudstate.initializing) { 00436 log_error(LOG_STARTUP, "CNF", "NFND", "%s: %s %s not found.", cmd, 00437 thingname, thing); 00438 } else { 00439 buff = alloc_lbuf("cf_log_notfound"); 00440 sprintf(buff, "%s %s not found", thingname, thing); 00441 notify(player, buff); 00442 free_lbuf(buff); 00443 } 00444 }
int cf_ntab_access | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 158 of file nametab.c.
References cf_modify_bits(), name_table::minlen, minmatch(), name_table::name, and name_table::perm.
Referenced by cf_access().
00159 { 00160 NAMETAB *np; 00161 char *ap; 00162 00163 for(ap = str; *ap && !isspace(*ap); ap++); 00164 if(*ap) 00165 *ap++ = '\0'; 00166 while (*ap && isspace(*ap)) 00167 ap++; 00168 for(np = (NAMETAB *) vp; np->name; np++) { 00169 if(minmatch(str, np->name, np->minlen)) { 00170 return cf_modify_bits(&(np->perm), ap, extra, player, cmd); 00171 } 00172 } 00173 cf_log_notfound(player, cmd, "Entry", str); 00174 return -1; 00175 }
Definition at line 58 of file nametab.c.
References alloc_lbuf, check_access(), God, name_table::name, and name_table::perm.
Referenced by do_list(), do_list_file(), and list_cmdswitches().
00060 { 00061 char *buf, *bp, *cp; 00062 NAMETAB *nt; 00063 int got_one; 00064 00065 buf = alloc_lbuf("display_nametab"); 00066 bp = buf; 00067 got_one = 0; 00068 for(cp = prefix; *cp; cp++) 00069 *bp++ = *cp; 00070 for(nt = ntab; nt->name; nt++) { 00071 if(God(player) || check_access(player, nt->perm)) { 00072 *bp++ = ' '; 00073 for(cp = nt->name; *cp; cp++) 00074 *bp++ = *cp; 00075 got_one = 1; 00076 } 00077 } 00078 *bp = '\0'; 00079 if(got_one || list_if_none) 00080 notify(player, buf); 00081 free_lbuf(buf); 00082 }
Definition at line 39 of file nametab.c.
References check_access(), name_table::minlen, minmatch(), name_table::name, and name_table::perm.
Referenced by cf_cmd_alias(), and do_set().
00040 { 00041 NAMETAB *nt; 00042 00043 for(nt = ntab; nt->name; nt++) { 00044 if(minmatch(flagname, nt->name, nt->minlen)) { 00045 if(check_access(player, nt->perm)) { 00046 return nt; 00047 } 00048 } 00049 } 00050 return NULL; 00051 }
void interp_nametab | ( | dbref | player, | |
NAMETAB * | ntab, | |||
int | flagword, | |||
char * | prefix, | |||
char * | true_text, | |||
char * | false_text | |||
) |
Definition at line 89 of file nametab.c.
References alloc_lbuf, check_access(), name_table::flag, God, name_table::name, name, and name_table::perm.
Referenced by do_list().
00091 { 00092 char *buf, *bp, *cp; 00093 NAMETAB *nt; 00094 00095 buf = alloc_lbuf("interp_nametab"); 00096 bp = buf; 00097 for(cp = prefix; *cp; cp++) 00098 *bp++ = *cp; 00099 nt = ntab; 00100 while (nt->name) { 00101 if(God(player) || check_access(player, nt->perm)) { 00102 *bp++ = ' '; 00103 for(cp = nt->name; *cp; cp++) 00104 *bp++ = *cp; 00105 *bp++ = '.'; 00106 *bp++ = '.'; 00107 *bp++ = '.'; 00108 if((flagword & nt->flag) != 0) 00109 cp = true_text; 00110 else 00111 cp = false_text; 00112 while (*cp) 00113 *bp++ = *cp++; 00114 if((++nt)->name) 00115 *bp++ = ';'; 00116 } 00117 } 00118 *bp = '\0'; 00119 notify(player, buf); 00120 free_lbuf(buf); 00121 }
void listset_nametab | ( | dbref | player, | |
NAMETAB * | ntab, | |||
int | flagword, | |||
char * | prefix, | |||
int | list_if_none | |||
) |
Definition at line 128 of file nametab.c.
References alloc_lbuf, check_access(), name_table::flag, God, name_table::name, and name_table::perm.
Referenced by list_attraccess(), list_cf_access(), list_cmdaccess(), and list_vattrs().
00130 { 00131 char *buf, *bp, *cp; 00132 NAMETAB *nt; 00133 int got_one; 00134 00135 buf = bp = alloc_lbuf("listset_nametab"); 00136 for(cp = prefix; *cp; cp++) 00137 *bp++ = *cp; 00138 nt = ntab; 00139 got_one = 0; 00140 while (nt->name) { 00141 if(((flagword & nt->flag) != 0) && (God(player) || 00142 check_access(player, nt->perm))) { 00143 *bp++ = ' '; 00144 for(cp = nt->name; *cp; cp++) 00145 *bp++ = *cp; 00146 got_one = 1; 00147 } 00148 nt++; 00149 } 00150 *bp = '\0'; 00151 if(got_one || list_if_none) 00152 notify(player, buf); 00153 free_lbuf(buf); 00154 }
Definition at line 19 of file nametab.c.
References check_access(), name_table::flag, name_table::minlen, minmatch(), name_table::name, and name_table::perm.
Referenced by cf_bool(), cf_modify_bits(), cf_option(), cf_or_in_bits(), cf_set_bits(), do_attribute(), do_global(), do_list(), do_list_file(), do_set(), fun_set(), fun_setlock(), get_obj_and_lock(), and process_cmdent().
00020 { 00021 NAMETAB *nt; 00022 00023 for(nt = ntab; nt->name; nt++) { 00024 if(minmatch(flagname, nt->name, nt->minlen)) { 00025 if(check_access(player, nt->perm)) { 00026 return nt->flag; 00027 } else 00028 return -2; 00029 } 00030 } 00031 return -1; 00032 }