Changeset 919 for 1.8.3/trunk/hdrs/attrib.h
- Timestamp:
- 06/12/2007 03:21:47 PM (19 months ago)
- Files:
-
- 1 modified
-
1.8.3/trunk/hdrs/attrib.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
1.8.3/trunk/hdrs/attrib.h
r846 r919 16 16 */ 17 17 struct attr { 18 char const *name; /**< Name of attribute */19 uint32_t flags; /**< Attribute flags */20 chunk_reference_t data; /**< The attribute's value, compressed */21 dbref creator; /**< The attribute's creator's dbref */22 ATTR *next; /**< Pointer to next attribute in list */18 char const *name; /**< Name of attribute */ 19 uint32_t flags; /**< Attribute flags */ 20 chunk_reference_t data; /**< The attribute's value, compressed */ 21 dbref creator; /**< The attribute's creator's dbref */ 22 ATTR *next; /**< Pointer to next attribute in list */ 23 23 }; 24 24 … … 42 42 AE_OKAY = 0, /**< Success */ 43 43 AE_ERROR = -1, /**< general failure */ 44 AE_SAFE = -2, /**< attempt to overwrite a safe attribute */44 AE_SAFE = -2, /**< attempt to overwrite a safe attribute */ 45 45 AE_BADNAME = -3, /**< invalid name */ 46 46 AE_TOOMANY = -4, /**< too many attribs */ 47 AE_TREE = -5, /**< unable to delete/create entire tree */47 AE_TREE = -5, /**< unable to delete/create entire tree */ 48 48 AE_NOTFOUND = -6 /** No such attribute */ 49 49 } atr_err; … … 53 53 extern ATTR *atr_sub_branch(ATTR *branch); 54 54 extern void atr_new_add(dbref thing, char const *RESTRICT atr, 55 char const *RESTRICT s, dbref player, uint32_t flags,56 uint8_t derefs);55 char const *RESTRICT s, dbref player, uint32_t flags, 56 uint8_t derefs); 57 57 extern atr_err atr_add(dbref thing, char const *RESTRICT atr, 58 char const *RESTRICT s, dbref player, uint32_t flags);58 char const *RESTRICT s, dbref player, uint32_t flags); 59 59 extern atr_err atr_clr(dbref thing, char const *atr, dbref player); 60 60 extern atr_err wipe_atr(dbref thing, char const *atr, dbref player); … … 63 63 typedef int (*aig_func) (dbref, dbref, dbref, const char *, ATTR *, void *); 64 64 extern int atr_iter_get(dbref player, dbref thing, char const *name, 65 int mortal, aig_func func, void *args);65 int mortal, aig_func func, void *args); 66 66 extern int atr_iter_get_parent(dbref player, dbref thing, char const *name, 67 int mortal, aig_func func, void *args);67 int mortal, aig_func func, void *args); 68 68 extern int atr_pattern_count(dbref player, dbref thing, const char *name, 69 int doparent, int mortal);69 int doparent, int mortal); 70 70 extern ATTR *atr_complete_match(dbref player, char const *atr, dbref privs); 71 71 extern void atr_free_all(dbref thing); … … 73 73 extern char const *convert_atr(int oldatr); 74 74 extern int atr_comm_match(dbref thing, dbref player, int type, int end, 75 char const *str, int just_match, char *atrname,76 char **abp, dbref *errobj);75 char const *str, int just_match, char *atrname, 76 char **abp, dbref *errobj); 77 77 extern int one_comm_match(dbref thing, dbref player, const char *atr, 78 const char *str);78 const char *str); 79 79 extern int do_set_atr(dbref thing, char const *RESTRICT atr, 80 char const *RESTRICT s, dbref player, uint32_t flags);80 char const *RESTRICT s, dbref player, uint32_t flags); 81 81 extern void do_atrlock(dbref player, char const *arg1, char const *arg2); 82 82 extern void do_atrchown(dbref player, char const *arg1, char const *arg2); 83 extern int string_to_atrflag(dbref player, const char *p);84 extern int string_to_atrflagsets(dbref player, const char *p, int *setbits,85 int *clrbits);86 extern const char *atrflag_to_string( intmask);83 int string_to_atrflag(dbref player, const char *p, privbits * bits); 84 int string_to_atrflagsets(dbref player, const char *p, privbits * setbits, 85 privbits * clrbits); 86 extern const char *atrflag_to_string(privbits mask); 87 87 extern void init_atr_name_tree(void); 88 88 89 89 extern int can_read_attr_internal(dbref player, dbref obj, ATTR *attr); 90 90 extern int can_write_attr_internal(dbref player, dbref obj, ATTR *attr, 91 int safe);91 int safe); 92 92 extern unsigned const char *atr_get_compressed_data(ATTR *atr); 93 93 extern char *atr_value(ATTR *atr); … … 97 97 98 98 /* possible attribute flags */ 99 #define AF_ODARK 0x1 /**< OBSOLETE! Leave here but don't use */100 #define AF_INTERNAL 0x2 /**< no one can see it or set it */101 #define AF_WIZARD 0x4 /**< Wizard only can change it */102 #define AF_NUKED 0x8 /**< OBSOLETE! Leave here but don't use */103 #define AF_LOCKED 0x10 /**< Only creator of attrib can change it. */104 #define AF_NOPROG 0x20 /**< won't be searched for $ commands. */105 #define AF_MDARK 0x40 /**< Only wizards can see it */106 #define AF_PRIVATE 0x80 /**< Children don't inherit it */107 #define AF_NOCOPY 0x100 /**< atr_cpy (for @clone) doesn't copy it */108 #define AF_VISUAL 0x200 /**< Everyone can see this attribute */109 #define AF_REGEXP 0x400 /**< Match $/^ patterns using regexps */110 #define AF_CASE 0x800 /**< Match $/^ patterns case-sensitive */111 #define AF_SAFE 0x1000 /**< This attribute may not be modified */112 #define AF_ROOT 0x2000 /**< Root of an attribute tree */113 #define AF_UNDEF1 0x4000 /**< Undefined; reserved for a future flag */114 #define AF_UNDEF2 0x8000 /**< Undefined; reserved for a future flag */115 #define AF_STATIC 0x10000 /**< OBSOLETE! Leave here but don't use */116 #define AF_COMMAND 0x20000 /**< INTERNAL: value starts with $ */117 #define AF_LISTEN 0x40000 /**< INTERNAL: value starts with ^ */118 #define AF_NODUMP 0x80000 /**< INTERNAL: attribute is not saved */119 #define AF_LISTED 0x100000 /**< INTERNAL: Used in @list attribs */120 #define AF_PREFIXMATCH 0x200000 /**< Subject to prefix-matching */121 #define AF_VEILED 0x400000 /**< On ex, show presence, not value */122 #define AF_DEBUG 0x800000 /**< Show debug when evaluated */123 #define AF_NEARBY 0x1000000 /**< Override AF_VISUAL if remote */124 #define AF_PUBLIC 0x2000000 /**< Override SAFER_UFUN */125 #define AF_ANON 0x4000000 /**< INTERNAL: Attribute doesn't really99 #define AF_ODARK 0x1U /**< OBSOLETE! Leave here but don't use */ 100 #define AF_INTERNAL 0x2U /**< no one can see it or set it */ 101 #define AF_WIZARD 0x4U /**< Wizard only can change it */ 102 #define AF_NUKED 0x8U /**< OBSOLETE! Leave here but don't use */ 103 #define AF_LOCKED 0x10U /**< Only creator of attrib can change it. */ 104 #define AF_NOPROG 0x20U /**< won't be searched for $ commands. */ 105 #define AF_MDARK 0x40U /**< Only wizards can see it */ 106 #define AF_PRIVATE 0x80U /**< Children don't inherit it */ 107 #define AF_NOCOPY 0x100U /**< atr_cpy (for @clone) doesn't copy it */ 108 #define AF_VISUAL 0x200U /**< Everyone can see this attribute */ 109 #define AF_REGEXP 0x400U /**< Match $/^ patterns using regexps */ 110 #define AF_CASE 0x800U /**< Match $/^ patterns case-sensitive */ 111 #define AF_SAFE 0x1000U /**< This attribute may not be modified */ 112 #define AF_ROOT 0x2000U /**< Root of an attribute tree */ 113 #define AF_UNDEF1 0x4000U /**< Undefined; reserved for a future flag */ 114 #define AF_UNDEF2 0x8000U /**< Undefined; reserved for a future flag */ 115 #define AF_STATIC 0x10000U /**< OBSOLETE! Leave here but don't use */ 116 #define AF_COMMAND 0x20000U /**< INTERNAL: value starts with $ */ 117 #define AF_LISTEN 0x40000U /**< INTERNAL: value starts with ^ */ 118 #define AF_NODUMP 0x80000U /**< INTERNAL: attribute is not saved */ 119 #define AF_LISTED 0x100000U /**< INTERNAL: Used in @list attribs */ 120 #define AF_PREFIXMATCH 0x200000U /**< Subject to prefix-matching */ 121 #define AF_VEILED 0x400000U /**< On ex, show presence, not value */ 122 #define AF_DEBUG 0x800000U /**< Show debug when evaluated */ 123 #define AF_NEARBY 0x1000000U /**< Override AF_VISUAL if remote */ 124 #define AF_PUBLIC 0x2000000U /**< Override SAFER_UFUN */ 125 #define AF_ANON 0x4000000U /**< INTERNAL: Attribute doesn't really 126 126 exist in the database */ 127 #define AF_NONAME 0x8000000 /**< No name in did_it */128 #define AF_NOSPACE 0x10000000 /**< No space in did_it */129 #define AF_MHEAR 0x20000000 /**< ^-listens can be triggered by %! */130 #define AF_AHEAR 0x40000000 /**< ^-listens can be triggered by anyone */131 #define AF_UNDEF3 0x80000000 /**< Undefined; reserved for a future flag */127 #define AF_NONAME 0x8000000U /**< No name in did_it */ 128 #define AF_NOSPACE 0x10000000U /**< No space in did_it */ 129 #define AF_MHEAR 0x20000000U /**< ^-listens can be triggered by %! */ 130 #define AF_AHEAR 0x40000000U /**< ^-listens can be triggered by anyone */ 131 #define AF_UNDEF3 0x80000000U /**< Undefined; reserved for a future flag */ 132 132 133 #define AF_MAXVALUE 0x100000000 /**< Largest attribute flag value. */133 #define AF_MAXVALUE 0x100000000U /**< Largest attribute flag value. */ 134 134 135 135 extern ATTR attr[]; 136 /**< external predefined attributes. */136 /**< external predefined attributes. */ 137 137 138 138 #define AL_ATTR(alist) (alist) … … 154 154 #define OPAE_NULL -3 155 155 156 #endif /* __ATTRIB_H */156 #endif /* __ATTRIB_H */
