Show
Ignore:
Timestamp:
06/12/2007 03:21:47 PM (19 months ago)
Author:
shawnw
Message:

1.8.3p3

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 1.8.3/trunk/hdrs/attrib.h

    r846 r919  
    1616 */ 
    1717struct 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 */ 
    2323}; 
    2424 
     
    4242  AE_OKAY = 0, /**< Success */ 
    4343  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 */ 
    4545  AE_BADNAME = -3, /**< invalid name */ 
    4646  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 */ 
    4848  AE_NOTFOUND = -6 /** No such attribute */ 
    4949} atr_err; 
     
    5353extern ATTR *atr_sub_branch(ATTR *branch); 
    5454extern 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); 
    5757extern 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); 
    5959extern atr_err atr_clr(dbref thing, char const *atr, dbref player); 
    6060extern atr_err wipe_atr(dbref thing, char const *atr, dbref player); 
     
    6363typedef int (*aig_func) (dbref, dbref, dbref, const char *, ATTR *, void *); 
    6464extern 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); 
    6666extern 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); 
    6868extern int atr_pattern_count(dbref player, dbref thing, const char *name, 
    69                  int doparent, int mortal); 
     69                             int doparent, int mortal); 
    7070extern ATTR *atr_complete_match(dbref player, char const *atr, dbref privs); 
    7171extern void atr_free_all(dbref thing); 
     
    7373extern char const *convert_atr(int oldatr); 
    7474extern 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); 
    7777extern int one_comm_match(dbref thing, dbref player, const char *atr, 
    78               const char *str); 
     78                          const char *str); 
    7979extern 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); 
    8181extern void do_atrlock(dbref player, char const *arg1, char const *arg2); 
    8282extern 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(int mask); 
     83int string_to_atrflag(dbref player, const char *p, privbits * bits); 
     84int string_to_atrflagsets(dbref player, const char *p, privbits * setbits, 
     85                          privbits * clrbits); 
     86extern const char *atrflag_to_string(privbits mask); 
    8787extern void init_atr_name_tree(void); 
    8888 
    8989extern int can_read_attr_internal(dbref player, dbref obj, ATTR *attr); 
    9090extern int can_write_attr_internal(dbref player, dbref obj, ATTR *attr, 
    91                    int safe); 
     91                                   int safe); 
    9292extern unsigned const char *atr_get_compressed_data(ATTR *atr); 
    9393extern char *atr_value(ATTR *atr); 
     
    9797 
    9898/* 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 really 
     99#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       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         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 
    126126                       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 */ 
    132132 
    133 #define AF_MAXVALUE          0x100000000     /**< Largest attribute flag value. */ 
     133#define AF_MAXVALUE          0x100000000U     /**< Largest attribute flag value. */ 
    134134 
    135135    extern ATTR attr[]; 
    136             /**< external predefined attributes. */ 
     136                    /**< external predefined attributes. */ 
    137137 
    138138#define AL_ATTR(alist)          (alist) 
     
    154154#define OPAE_NULL       -3 
    155155 
    156 #endif              /* __ATTRIB_H */ 
     156#endif                          /* __ATTRIB_H */