Atrinik Server  4.0
Macros
Object multiflag macros

Macros

#define SET_MULTI_FLAG(xyz, p)
 
#define CLEAR_MULTI_FLAG(xyz, p)
 
#define SET_OR_CLEAR_MULTI_FLAG(_head, _flag)
 
#define SET_OR_CLEAR_MULTI_FLAG_IF_CLONE(_head, _flag)
 

Detailed Description

This is rarely used but needed for some flags, which are used for intern handling like INVISIBLE or WALK_OFF. Because some core functions like object_remove() use this, it will be better we set this ONE time outside instead of every time in object_remove(): we skip the call for the head in this way.

Macro Definition Documentation

#define CLEAR_MULTI_FLAG (   xyz,
 
)
Value:
do { \
for (object *_tos_ = xyz; _tos_; _tos_ = _tos_->more) { \
CLEAR_FLAG(_tos_, p); \
} \
} while (0)
#define CLEAR_FLAG(xyz, p)
Definition: define.h:751

Definition at line 804 of file define.h.

#define SET_MULTI_FLAG (   xyz,
 
)
Value:
do { \
for (object *_tos_ = xyz; _tos_; _tos_ = _tos_->more) { \
SET_FLAG(_tos_, p); \
} \
} while (0)
#define SET_FLAG(xyz, p)
Definition: define.h:741

Definition at line 797 of file define.h.

#define SET_OR_CLEAR_MULTI_FLAG (   _head,
  _flag 
)
Value:
do { \
if (QUERY_FLAG(_head, _flag)) { \
SET_MULTI_FLAG((_head)->more, _flag); \
} else { \
CLEAR_MULTI_FLAG((_head)->more, _flag); \
} \
} while (0)
#define QUERY_FLAG(xyz, p)
Definition: define.h:761

Definition at line 811 of file define.h.

#define SET_OR_CLEAR_MULTI_FLAG_IF_CLONE (   _head,
  _flag 
)
Value:
do { \
bool _has_head_ = QUERY_FLAG(_head, _flag); \
bool _has_clone_ = QUERY_FLAG(&(_head)->arch->clone, _flag); \
if (_has_head_ && !_has_clone_) { \
SET_MULTI_FLAG((_head), _flag); \
} else if (!_has_head_ && _has_clone_) { \
CLEAR_MULTI_FLAG((_head), _flag); \
} \
} while (0)
#define QUERY_FLAG(xyz, p)
Definition: define.h:761

Definition at line 820 of file define.h.