| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
#include "copyrite.h" |
|---|
| 4 |
|
|---|
| 5 |
#ifndef __LOCK_H |
|---|
| 6 |
#define __LOCK_H |
|---|
| 7 |
|
|---|
| 8 |
#include "mushtype.h" |
|---|
| 9 |
#include "conf.h" |
|---|
| 10 |
#include "boolexp.h" |
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
struct lock_list { |
|---|
| 25 |
lock_type type; |
|---|
| 26 |
boolexp key; |
|---|
| 27 |
dbref creator; |
|---|
| 28 |
privbits flags; |
|---|
| 29 |
struct lock_list *next; |
|---|
| 30 |
}; |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
typedef struct lock_msg_info LOCKMSGINFO; |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
struct lock_msg_info { |
|---|
| 38 |
lock_type type; |
|---|
| 39 |
const char *succbase; |
|---|
| 40 |
const char *failbase; |
|---|
| 41 |
}; |
|---|
| 42 |
|
|---|
| 43 |
#define LF_VISUAL 0x1U |
|---|
| 44 |
#define LF_PRIVATE 0x2U |
|---|
| 45 |
#define LF_WIZARD 0x4U |
|---|
| 46 |
#define LF_LOCKED 0x8U |
|---|
| 47 |
#define LF_NOCLONE 0x10U |
|---|
| 48 |
#define LF_OX 0x20U |
|---|
| 49 |
#define LF_NOSUCCACTION 0x40U |
|---|
| 50 |
#define LF_NOFAILACTION 0x80U |
|---|
| 51 |
#define LF_OWNER 0x100U |
|---|
| 52 |
#define LF_DEFAULT 0x200U |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
boolexp getlock(dbref thing, lock_type type); |
|---|
| 56 |
boolexp getlock_noparent(dbref thing, lock_type type); |
|---|
| 57 |
lock_type match_lock(lock_type type); |
|---|
| 58 |
const lock_list *get_lockproto(lock_type type); |
|---|
| 59 |
int add_lock(dbref player, dbref thing, lock_type type, boolexp key, |
|---|
| 60 |
privbits flags); |
|---|
| 61 |
int add_lock_raw(dbref player, dbref thing, lock_type type, |
|---|
| 62 |
boolexp key, privbits flags); |
|---|
| 63 |
void free_locks(lock_list *ll); |
|---|
| 64 |
int eval_lock(dbref player, dbref thing, lock_type ltype); |
|---|
| 65 |
int eval_lock_with(dbref player, dbref thing, lock_type ltype, dbref env0, |
|---|
| 66 |
dbref env1); |
|---|
| 67 |
int fail_lock(dbref player, dbref thing, lock_type ltype, const char *def, |
|---|
| 68 |
dbref loc); |
|---|
| 69 |
void do_unlock(dbref player, const char *name, lock_type type); |
|---|
| 70 |
void do_lock(dbref player, const char *name, const char *keyname, |
|---|
| 71 |
lock_type type); |
|---|
| 72 |
void init_locks(void); |
|---|
| 73 |
void clone_locks(dbref player, dbref orig, dbref clone); |
|---|
| 74 |
void do_lset(dbref player, char *what, char *flags); |
|---|
| 75 |
void do_list_locks(dbref player, const char *arg, int lc, const char *label); |
|---|
| 76 |
void list_locks(char *buff, char **bp, const char *name); |
|---|
| 77 |
const char *lock_flags(lock_list *ll); |
|---|
| 78 |
const char *lock_flags_long(lock_list *ll); |
|---|
| 79 |
void list_lock_flags(char *buff, char **bp); |
|---|
| 80 |
void list_lock_flags_long(char *buff, char **bp); |
|---|
| 81 |
lock_list *getlockstruct(dbref thing, lock_type type); |
|---|
| 82 |
void check_zone_lock(dbref player, dbref zone, int noisy); |
|---|
| 83 |
void define_lock(lock_type name, privbits flags); |
|---|
| 84 |
#define L_FLAGS(lock) ((lock)->flags) |
|---|
| 85 |
#define L_CREATOR(lock) ((lock)->creator) |
|---|
| 86 |
#define L_TYPE(lock) ((lock)->type) |
|---|
| 87 |
#define L_KEY(lock) ((lock)->key) |
|---|
| 88 |
#define L_NEXT(lock) ((lock)->next) |
|---|
| 89 |
|
|---|
| 90 |
bool lock_visual(dbref, lock_type); |
|---|
| 91 |
#define Can_Read_Lock(p,x,l) \ |
|---|
| 92 |
(See_All(p) || controls(p,x) || ((Visual(x) || lock_visual(x, l)) && \ |
|---|
| 93 |
eval_lock(p,x,Examine_Lock))) |
|---|
| 94 |
|
|---|
| 95 |
extern lock_type Basic_Lock; |
|---|
| 96 |
extern lock_type Enter_Lock; |
|---|
| 97 |
extern lock_type Use_Lock; |
|---|
| 98 |
extern lock_type Zone_Lock; |
|---|
| 99 |
extern lock_type Page_Lock; |
|---|
| 100 |
extern lock_type Tport_Lock; |
|---|
| 101 |
extern lock_type Speech_Lock; |
|---|
| 102 |
extern lock_type Listen_Lock; |
|---|
| 103 |
extern lock_type Command_Lock; |
|---|
| 104 |
extern lock_type Parent_Lock; |
|---|
| 105 |
extern lock_type Link_Lock; |
|---|
| 106 |
extern lock_type Leave_Lock; |
|---|
| 107 |
extern lock_type Drop_Lock; |
|---|
| 108 |
extern lock_type Give_Lock; |
|---|
| 109 |
extern lock_type Mail_Lock; |
|---|
| 110 |
extern lock_type Follow_Lock; |
|---|
| 111 |
extern lock_type Examine_Lock; |
|---|
| 112 |
extern lock_type Chzone_Lock; |
|---|
| 113 |
extern lock_type Forward_Lock; |
|---|
| 114 |
extern lock_type Control_Lock; |
|---|
| 115 |
extern lock_type Dropto_Lock; |
|---|
| 116 |
extern lock_type Destroy_Lock; |
|---|
| 117 |
extern lock_type Interact_Lock; |
|---|
| 118 |
extern lock_type MailForward_Lock; |
|---|
| 119 |
extern lock_type Take_Lock; |
|---|
| 120 |
|
|---|
| 121 |
#endif |
|---|