Atrinik Server 2.5
Defines | Enumerations | Functions | Variables
include/define.h File Reference

Go to the source code of this file.

Defines

#define FABS(x)   ((x) < 0 ? -(x) : (x))
#define abs(x)   ((x) < 0 ? -(x) : (x))
#define MIN(x, y)   ((x) < (y) ? (x) : (y))
#define MAX(x, y)   ((x) > (y) ? (x) : (y))
#define SGN(x)   ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0))
#define NAME_MAX   255
#define MAX_STAT   30
#define MIN_STAT   1
#define MAX_BUF   256
#define VERY_BIG_BUF   1024
#define HUGE_BUF   4096
#define MAX_NAME   16
#define BIG_NAME   32
#define MAX_EXT_TITLE   98
#define MAX_ANIMATIONS   256
#define IDENTIFY_NORMAL   0
#define IDENTIFY_ALL   1
#define IDENTIFY_MARKED   2
#define SPLIST_MODE_ADD   0
#define SPLIST_MODE_REMOVE   1
#define SPLIST_MODE_UPDATE   2
#define CHOSEN_SKILL_NO   (99999)
#define PORTAL_DESTINATION_NAME   "Town portal destination"
#define PORTAL_ACTIVE_NAME   "Existing town portal"
#define BLOCKED_LOS_VISIBLE   0x00
#define BLOCKED_LOS_IGNORE   0x01
#define BLOCKED_LOS_BLOCKSVIEW   0x02
#define BLOCKED_LOS_BLOCKED   0x04
#define BLOCKED_LOS_OUT_OF_MAP   0x08
#define PLAYER   1
#define BULLET   2
#define ROD   3
#define TREASURE   4
#define POTION   5
#define FOOD   6
#define POISON   7
#define BOOK   8
#define CLOCK   9
#define MATERIAL   10
#define DUPLICATOR   11
#define LIGHTNING   12
#define ARROW   13
#define BOW   14
#define WEAPON   15
#define ARMOUR   16
#define PEDESTAL   17
#define ALTAR   18
#define CONFUSION   19
#define DOOR   20
#define KEY   21
#define MAP   22
#define MMISSILE   25
#define TIMED_GATE   26
#define TRIGGER   27
#define MAGIC_MIRROR   28
#define MAGIC_EAR   29
#define TRIGGER_BUTTON   30
#define TRIGGER_ALTAR   31
#define TRIGGER_PEDESTAL   32
#define SHIELD   33
#define HELMET   34
#define HORN   35
#define MONEY   36
#define CLASS   37
#define GRAVESTONE   38
#define AMULET   39
#define PLAYERMOVER   40
#define TELEPORTER   41
#define CREATOR   42
#define SKILL   43
#define EXPERIENCE   44
#define BOMB   47
#define THROWN_OBJ   48
#define BLINDNESS   49
#define GOD   50
#define DETECTOR   51
#define SKILL_ITEM   52
#define DEAD_OBJECT   53
#define DRINK   54
#define MARKER   55
#define HOLY_ALTAR   56
#define PEARL   59
#define GEM   60
#define FIREWALL   62
#define CHECK_INV   64
#define MOOD_FLOOR   65
#define EXIT   66
#define SHOP_FLOOR   68
#define SHOP_MAT   69
#define RING   70
#define FLOOR   71
#define FLESH   72
#define INORGANIC   73
#define LIGHT_APPLY   74
#define LIGHTER   75
#define WALL   77
#define LIGHT_SOURCE   78
#define MISC_OBJECT   79
#define MONSTER   80
#define SPAWN_POINT   81
#define LIGHT_REFILL   82
#define SPAWN_POINT_MOB   83
#define SPAWN_POINT_INFO   84
#define SPELLBOOK   85
#define ORGANIC   86
#define CLOAK   87
#define CONE   88
#define SPINNER   90
#define GATE   91
#define BUTTON   92
#define HANDLE   93
#define PIT   94
#define TRAPDOOR   95
#define WORD_OF_RECALL   96
#define SIGN   98
#define BOOTS   99
#define GLOVES   100
#define BASE_INFO   101
#define RANDOM_DROP   102
#define CONVERTER   103
#define BRACERS   104
#define POISONING   105
#define SAVEBED   106
#define WAND   109
#define ABILITY   110
#define SCROLL   111
#define DIRECTOR   112
#define GIRDLE   113
#define FORCE   114
#define POTION_EFFECT   115
#define JEWEL   116
#define NUGGET   117
#define EVENT_OBJECT   118
#define WAYPOINT_OBJECT   119
#define QUEST_CONTAINER   120
#define CLOSE_CON   121
#define CONTAINER   122
#define ARMOUR_IMPROVER   123
#define WEAPON_IMPROVER   124
#define WEALTH   125
#define BEACON   126
#define MAP_EVENT_OBJ   127
#define SKILLSCROLL   130
#define DEEP_SWAMP   138
#define IDENTIFY_ALTAR   139
#define COMPASS   151
#define MAP_INFO   152
#define SWARM_SPELL   153
#define RUNE   154
#define CLIENT_MAP_INFO   155
#define POWER_CRYSTAL   156
#define CORPSE   157
#define DISEASE   158
#define SYMPTOM   159
#define VOID_CONTAINER   255
#define ST1_MISSILE_BOW   1
#define ST1_MISSILE_CBOW   2
#define ST1_MISSILE_SSTONE   3
#define ST1_MISSILE_THROW   128
#define ST1_MISSILE_IMPACT   (ST1_MISSILE_THROW | 0)
#define ST1_MISSILE_SLASH   (ST1_MISSILE_THROW | 1)
#define ST1_MISSILE_PIERCE   (ST1_MISSILE_THROW | 2)
#define ST1_MISSILE_CLEAVE   (ST1_MISSILE_THROW | 3)
#define ST1_MISSILE_BOULDER   (ST1_MISSILE_THROW | 4)
#define WEAP_1H_IMPACT   0
#define WEAP_1H_SLASH   1
#define WEAP_1H_PIERCE   2
#define WEAP_1H_CLEAVE   3
#define WEAP_2H_IMPACT   4
#define WEAP_2H_SLASH   5
#define WEAP_2H_PIERCE   6
#define WEAP_2H_CLEAVE   7
#define WEAP_POLE_IMPACT   8
#define WEAP_POLE_SLASH   9
#define WEAP_POLE_PIERCE   10
#define WEAP_POLE_CLEAVE   11
#define RANGE_WEAP_BOW   0
#define RANGE_WEAP_XBOWS   1
#define RANGE_WEAP_SLINGS   2
#define RANGE_WEAP_FIREARMS   3
#define ST1_SKILL_NORMAL   0
#define ST1_SKILL_USE   1
#define ST1_SKILL_INDIRECT   2
#define ST1_SPELLBOOK_CLERIC   1
#define ST1_SPELLBOOK_MAGE   2
#define ST1_CONTAINER_NORMAL   0
#define ST1_CONTAINER_CORPSE   1
#define ST1_CONTAINER_DEAD_PL   2
#define ST1_CONTAINER_NORMAL_player   64
#define ST1_CONTAINER_CORPSE_player   65
#define ST1_CONTAINER_NORMAL_party   128
#define ST1_CONTAINER_CORPSE_party   129
#define ST1_EXIT_SOUND_NO   0
#define ST1_EXIT_SOUND   1
#define ST1_DOOR_NORMAL   0
#define ST1_DOOR_CURTAIN   1
#define ST_BD_REMOVE   1
#define ST_BD_BUILD   2
#define ST_MAT_FLOOR   1
#define ST_MAT_WALL   2
#define ST_MAT_ITEM   3
#define ST_MAT_WIN   4
#define CLIENT_MAP_LABEL   1
#define CLIENT_MAP_TOOLTIP   2
#define CLIENT_MAP_HIDE   3
#define SIZEOFFREE1   8
#define SIZEOFFREE2   24
#define SIZEOFFREE   49
#define NROFREALSPELLS   52
#define NRSPELLPATHS   20
#define TERRAIN_NOTHING   0
#define TERRAIN_AIRBREATH   1
#define TERRAIN_WATERWALK   2
#define TERRAIN_WATERBREATH   4
#define TERRAIN_FIREWALK   8
#define TERRAIN_FIREBREATH   16
#define TERRAIN_CLOUDWALK   32
#define TERRAIN_ALL   0xffff
#define SET_FLAG(xyz, p)   ((xyz)->flags[p / 32] |= (1U << (p % 32)))
#define CLEAR_FLAG(xyz, p)   ((xyz)->flags[p / 32] &= ~(1U << (p % 32)))
#define QUERY_FLAG(xyz, p)   ((xyz)->flags[p / 32] & (1U << (p % 32)))
#define SET_MULTI_FLAG(xyz, p)
#define CLEAR_MULTI_FLAG(xyz, p)
#define IS_WEAPON(op)   (op->type == ARROW || op->type == BOW || op->type == WEAPON)
#define IS_ARMOR(op)   (op->type == ARMOUR || op->type == SHIELD || op->type == HELMET || op->type == CLOAK || op->type == BOOTS || op->type == GLOVES || op->type == BRACERS || op->type == GIRDLE)
#define IS_LIVE(op)   ((op)->type == PLAYER || QUERY_FLAG((op), FLAG_MONSTER) || QUERY_FLAG((op), FLAG_ALIVE))
#define IS_ARROW(op)   (op->type == ARROW || op->type == MMISSILE || op->type == BULLET)
#define IS_ATTACK_SPELL(op)   ((op)->type == MMISSILE || (op)->type == BULLET || (op)->type == CONE || (op)->type == LIGHTNING)
#define FLAG_SLEEP   0
#define FLAG_CONFUSED   1
#define FLAG_PARALYZED   2
#define FLAG_SCARED   3
#define FLAG_BLIND   4
#define FLAG_IS_INVISIBLE   5
#define FLAG_IS_ETHEREAL   6
#define FLAG_IS_GOOD   7
#define FLAG_NO_PICK   8
#define FLAG_WALK_ON   9
#define FLAG_NO_PASS   10
#define FLAG_ANIMATE   11
#define FLAG_SLOW_MOVE   12
#define FLAG_FLYING   13
#define FLAG_MONSTER   14
#define FLAG_FRIENDLY   15
#define FLAG_REMOVED   16
#define FLAG_BEEN_APPLIED   17
#define FLAG_AUTO_APPLY   18
#define FLAG_IS_READY   19
#define FLAG_IS_NEUTRAL   20
#define FLAG_SEE_INVISIBLE   21
#define FLAG_CAN_ROLL   22
#define FLAG_CONNECT_RESET   23
#define FLAG_IS_TURNABLE   24
#define FLAG_WALK_OFF   25
#define FLAG_FLY_ON   26
#define FLAG_FLY_OFF   27
#define FLAG_IS_USED_UP   28
#define FLAG_IDENTIFIED   29
#define FLAG_REFLECTING   30
#define FLAG_CHANGING   31
#define FLAG_SPLITTING   32
#define FLAG_HITBACK   33
#define FLAG_STARTEQUIP   34
#define FLAG_BLOCKSVIEW   35
#define FLAG_UNDEAD   36
#define FLAG_CAN_STACK   37
#define FLAG_UNAGGRESSIVE   38
#define FLAG_REFL_MISSILE   39
#define FLAG_REFL_SPELL   40
#define FLAG_NO_MAGIC   41
#define FLAG_NO_FIX_PLAYER   42
#define FLAG_IS_EVIL   43
#define FLAG_RUN_AWAY   45
#define FLAG_PASS_THRU   46
#define FLAG_CAN_PASS_THRU   47
#define FLAG_OUTDOOR   48
#define FLAG_UNIQUE   49
#define FLAG_NO_DROP   50
#define FLAG_INDESTRUCTIBLE   51
#define FLAG_CAST_SPELL   52
#define FLAG_USE_BOW   55
#define FLAG_USE_ARMOUR   56
#define FLAG_USE_WEAPON   57
#define FLAG_CONNECT_NO_PUSH   58
#define FLAG_CONNECT_NO_RELEASE   59
#define FLAG_READY_BOW   60
#define FLAG_XRAYS   61
#define FLAG_NO_APPLY   62
#define FLAG_IS_FLOOR   63
#define FLAG_LIFESAVE   64
#define FLAG_IS_MAGICAL   65
#define FLAG_ALIVE   66
#define FLAG_STAND_STILL   67
#define FLAG_RANDOM_MOVE   68
#define FLAG_ONLY_ATTACK   69
#define FLAG_WIZ   70
#define FLAG_STEALTH   71
#define FLAG_WIZPASS   72
#define FLAG_IS_LINKED   73
#define FLAG_CURSED   74
#define FLAG_DAMNED   75
#define FLAG_IS_BUILDABLE   76
#define FLAG_NO_PVP   77
#define FLAG_IS_THROWN   80
#define FLAG_IS_MALE   83
#define FLAG_IS_FEMALE   84
#define FLAG_APPLIED   85
#define FLAG_INV_LOCKED   86
#define FLAG_READY_WEAPON   90
#define FLAG_NO_SKILL_IDENT   91
#define FLAG_WAS_WIZ   92
#define FLAG_SEE_IN_DARK   93
#define FLAG_IS_CAULDRON   94
#define FLAG_DUST   95
#define FLAG_ONE_HIT   97
#define FLAG_DRAW_DOUBLE_ALWAYS   98
#define FLAG_BERSERK   99
#define FLAG_NO_ATTACK   100
#define FLAG_INVULNERABLE   101
#define FLAG_QUEST_ITEM   102
#define FLAG_IS_TRAPPED   103
#define FLAG_SYS_OBJECT   110
#define FLAG_USE_FIX_POS   111
#define FLAG_UNPAID   112
#define FLAG_HIDDEN   113
#define FLAG_MAKE_INVISIBLE   114
#define FLAG_MAKE_ETHEREAL   115
#define FLAG_IS_PLAYER   116
#define FLAG_IS_NAMED   117
#define FLAG_SPAWN_MOB   118
#define FLAG_NO_TELEPORT   119
#define FLAG_CORPSE   120
#define FLAG_CORPSE_FORCED   121
#define FLAG_PLAYER_ONLY   122
#define FLAG_NO_CLERIC   123
#define FLAG_ONE_DROP   124
#define FLAG_PERM_CURSED   125
#define FLAG_PERM_DAMNED   126
#define FLAG_DOOR_CLOSED   127
#define FLAG_IS_MISSILE   129
#define FLAG_DRAW_DIRECTION   130
#define FLAG_DRAW_DOUBLE   131
#define FLAG_IS_ASSASSINATION   132
#define FLAG_OBJECT_WAS_MOVED   133
#define FLAG_NO_SAVE   134
#define NUM_FLAGS   135
#define NUM_FLAGS_32   5
#define IS_SYS_INVISIBLE(__ob_)   QUERY_FLAG(__ob_, FLAG_SYS_OBJECT)
#define IS_INVISIBLE(__ob_, __player_)   (QUERY_FLAG(__ob_, FLAG_SYS_OBJECT) || (QUERY_FLAG(__ob_, FLAG_IS_INVISIBLE) && !QUERY_FLAG(__player_, FLAG_SEE_INVISIBLE)))
#define SLOW_PENALTY(xyz)   ((xyz)->stats.exp)
#define EXIT_PATH(xyz)   ((xyz)->slaying)
#define EXIT_X(xyz)   ((xyz)->stats.hp)
#define EXIT_Y(xyz)   ((xyz)->stats.sp)
#define COST_BUY   0
#define COST_SELL   1
#define COST_TRUE   2
#define DIRX(xyz)   freearr_x[(xyz)->direction]
#define DIRY(xyz)   freearr_y[(xyz)->direction]
#define ARMOUR_SPEED(xyz)   (xyz)->last_sp
#define ARMOUR_SPELLS(xyz)   (xyz)->last_heal
#define DISTATT   1
#define RUNATT   2
#define HITRUN   3
#define WAITATT   4
#define RUSH   5
#define ALLRUN   6
#define DISTHIT   7
#define WAIT2   8
#define UNUSED_MOVE   16
#define CIRCLE1   32
#define CIRCLE2   48
#define PACEH   64
#define PACEH2   80
#define RANDO   96
#define RANDO2   112
#define PACEV   128
#define PACEV2   144
#define WPOINT   176
#define LO4   15
#define HI4   240
#define ST_PLAYING   0
#define ST_ROLL_STAT   1
#define ST_CHANGE_CLASS   2
#define ST_GET_NAME   3
#define ST_GET_PASSWORD   4
#define ST_CONFIRM_PASSWORD   5
#define BLANK_FACE_NAME   "blank.111"
#define NEXT_ITEM_FACE_NAME   "next_item.101"
#define PREVIOUS_ITEM_FACE_NAME   "prev_item.101"
#define SockList_AddChar(_sl_, _c_)   (_sl_)->buf[(_sl_)->len++] = (_c_)
#define SockList_AddShort(_sl_, _data_)
#define SockList_AddInt(_sl_, _data_)
#define SockList_AddInt64(_sl_, _data_)
#define SockList_AddData(_sl_, _data_, _len_)
#define SockList_AddLen8Data(_sl_, _data_, _len_)
#define SockList_AddStringUnterm(_sl_, _data_)
#define GetInt_String(_data_)   (((_data_)[0] << 24) + ((_data_)[1] << 16) + ((_data_)[2] << 8) + (_data_)[3])
#define GetShort_String(_data_)   (((_data_)[0] << 8) + (_data_)[1])
#define DESCRIBE_PATH(retbuf, variable, name)
#define DESCRIBE_PATH_SAFE(retbuf, variable, name, len, maxlen)
#define MIN_ACTIVE_SPEED   0.00001f
#define BRESENHAM_INIT(dx, dy, fraction, stepx, stepy, dx2, dy2)
#define BRESENHAM_STEP(x, y, fraction, stepx, stepy, dx2, dy2)
#define DUMP_VALUE_MONSTERS   1
#define DUMP_VALUE_ABILITIES   2
#define DUMP_VALUE_ARTIFACTS   3
#define DUMP_VALUE_SPELLS   4
#define DUMP_VALUE_SKILLS   5
#define DUMP_VALUE_RACES   6
#define DUMP_VALUE_ALCHEMY   7
#define DUMP_VALUE_GODS   8
#define DUMP_VALUE_ALCHEMY_COSTS   9
#define DUMP_VALUE_ARCHETYPES   10
#define DUMP_VALUE_MONSTER_TREASURE   11
#define DUMP_VALUE_LEVEL_COLORS   12
#define QUEST_CONTAINER_ARCHETYPE   "quest_container"
#define QUEST_STATUS_STARTED   0
#define QUEST_STATUS_COMPLETED   1
#define QUEST_TYPE_ITEM   0
#define QUEST_TYPE_KILL   1
#define QUEST_TYPE_KILL_ITEM   2
#define QUEST_TYPE_SPECIAL   3
#define QUEST_TYPE_MULTI   4
#define arraysize(arrayname)   (sizeof(arrayname) / sizeof(*(arrayname)))

Enumerations

enum  apply_flag {
  AP_NULL = 0, AP_APPLY = 1, AP_UNAPPLY = 2, AP_BASIC_FLAGS = 15,
  AP_NO_MERGE = 16, AP_IGNORE_CURSE = 32, AP_NO_EVENT = 64
}

Functions

static void safe_strcat (char *dest, const char *orig, size_t *curlen, size_t maxlen)

Variables

const char * object_flag_names [NUM_FLAGS+1]

Detailed Description

This file deals with things like flags, object types, and a lot more.

Todo:
This file is really too large. With all the .h files around, this file should be better split between them - things that deal with objects should be in objects.h, things dealing with players in player.h, etc. As it is, everything just seems to be dumped in here.

Definition in file define.h.


Define Documentation

#define arraysize (   arrayname)    (sizeof(arrayname) / sizeof(*(arrayname)))

Returns the element size of an array.

Parameters:
arraynameThe array's name.
Returns:
The number of elements.

Definition at line 1749 of file define.h.

#define CHOSEN_SKILL_NO   (99999)

Marks no skill used.

Definition at line 115 of file define.h.

#define DESCRIBE_PATH (   retbuf,
  variable,
  name 
)
Value:
if (variable)                                                    \
    {                                                                \
        int i, j = 0;                                                \
        strcat(retbuf, "(" name ": ");                               \
                                                                     \
        for (i = 0; i < NRSPELLPATHS; i++)                           \
        {                                                            \
            if (variable & (1 << i))                                 \
            {                                                        \
                if (j)                                               \
                    strcat(retbuf, ", ");                            \
                else                                                 \
                    j = 1;                                           \
                                                                     \
                strcat(retbuf, spellpathnames[i]);                   \
            }                                                        \
        }                                                            \
                                                                     \
        strcat(retbuf, ")");                                         \
    }

Definition at line 1528 of file define.h.

#define DESCRIBE_PATH_SAFE (   retbuf,
  variable,
  name,
  len,
  maxlen 
)
Value:
if (variable)                                                    \
    {                                                                \
        int i, j = 0;                                                \
        safe_strcat(retbuf, "(" name ": ", len, maxlen);             \
                                                                     \
        for (i = 0; i < NRSPELLPATHS; i++)                           \
        {                                                            \
            if (variable & (1 << i))                                 \
            {                                                        \
                if (j)                                               \
                    safe_strcat(retbuf, ", ", len, maxlen);          \
                else                                                 \
                    j = 1;                                           \
                                                                     \
                safe_strcat(retbuf, spellpathnames[i], len, maxlen); \
            }                                                        \
        }                                                            \
                                                                     \
        safe_strcat(retbuf, ")", len, maxlen);                       \
    }

Definition at line 1550 of file define.h.

#define IS_INVISIBLE (   __ob_,
  __player_ 
)    (QUERY_FLAG(__ob_, FLAG_SYS_OBJECT) || (QUERY_FLAG(__ob_, FLAG_IS_INVISIBLE) && !QUERY_FLAG(__player_, FLAG_SEE_INVISIBLE)))

Check if the object is invisible.

Definition at line 1303 of file define.h.

#define IS_SYS_INVISIBLE (   __ob_)    QUERY_FLAG(__ob_, FLAG_SYS_OBJECT)

Check if object has FLAG_SYS_OBJECT set.

Definition at line 1300 of file define.h.

#define MAX_STAT   30

The maximum legal value of any stat.

Definition at line 70 of file define.h.

#define MIN_ACTIVE_SPEED   0.00001f

Cut off point of when an object is put on the active list or not

Definition at line 1590 of file define.h.

#define MIN_STAT   1

The minimum legal value of any stat.

Definition at line 72 of file define.h.

#define NROFREALSPELLS   52

Number of different spells

Definition at line 769 of file define.h.

#define NRSPELLPATHS   20

Number of spell paths.

Definition at line 771 of file define.h.

#define PORTAL_DESTINATION_NAME   "Town portal destination"

Town portal destination name

Definition at line 118 of file define.h.

#define QUEST_CONTAINER_ARCHETYPE   "quest_container"

Name of the quest container archetype.

Definition at line 1714 of file define.h.

#define SockList_AddData (   _sl_,
  _data_,
  _len_ 
)
Value:
memcpy((_sl_)->buf + (_sl_)->len, (_data_), (_len_)); \
    (_sl_)->len += (_len_)

Adds a data block.

Parameters:
_sl_SockList instance to add to.
_data_The value to add.
_len_The length in byte.

Definition at line 1477 of file define.h.

#define SockList_AddInt (   _sl_,
  _data_ 
)
Value:
(_sl_)->buf[(_sl_)->len++] = ((_data_) >> 24) & 0xff; \
    (_sl_)->buf[(_sl_)->len++] = ((_data_) >> 16) & 0xff; \
    (_sl_)->buf[(_sl_)->len++] = ((_data_) >> 8) & 0xff;  \
    (_sl_)->buf[(_sl_)->len++] = (_data_) & 0xff

Adds a 32-bit value.

Parameters:
_sl_SockList instance to add to.
_data_The value to add.

Definition at line 1452 of file define.h.

#define SockList_AddInt64 (   _sl_,
  _data_ 
)
Value:
(_sl_)->buf[(_sl_)->len++] = (char) (((_data_) >> 56) & 0xff); \
    (_sl_)->buf[(_sl_)->len++] = (char) (((_data_) >> 48) & 0xff); \
    (_sl_)->buf[(_sl_)->len++] = (char) (((_data_) >> 40) & 0xff); \
    (_sl_)->buf[(_sl_)->len++] = (char) (((_data_) >> 32) & 0xff); \
    (_sl_)->buf[(_sl_)->len++] = (char) (((_data_) >> 24) & 0xff); \
    (_sl_)->buf[(_sl_)->len++] = (char) (((_data_) >> 16) & 0xff); \
    (_sl_)->buf[(_sl_)->len++] = (char) (((_data_) >> 8) & 0xff);  \
    (_sl_)->buf[(_sl_)->len++] = (char) ((_data_) & 0xff)

Adds a 64-bit value.

Parameters:
_sl_SockList instance to add to.
_data_The value to add.

Definition at line 1462 of file define.h.

#define SockList_AddLen8Data (   _sl_,
  _data_,
  _len_ 
)
Value:
SockList_AddChar((_sl_), (_len_)); \
    SockList_AddData((_sl_), (_data_), (_len_))

Adds a data block prepended with an 8 bit length field.

Parameters:
_sl_The SockList instance to add to.
_data_The value to add.
_len_The length in byte; must not exceed 255.

Definition at line 1486 of file define.h.

#define SockList_AddShort (   _sl_,
  _data_ 
)
Value:
(_sl_)->buf[(_sl_)->len++] = ((_data_) >> 8) & 0xff; \
    (_sl_)->buf[(_sl_)->len++] = (_data_) & 0xff

Definition at line 1444 of file define.h.

#define SockList_AddStringUnterm (   _sl_,
  _data_ 
)
Value:
SockList_AddString((_sl_), (_data_)); \
    (_sl_)->len--;

Same as SockList_AddString(), but removes the trailing \0 added by SockList_AddString().

Definition at line 1493 of file define.h.


Enumeration Type Documentation

enum apply_flag

Flags for apply_special().

Definition at line 1576 of file define.h.


Function Documentation

static void safe_strcat ( char *  dest,
const char *  orig,
size_t *  curlen,
size_t  maxlen 
) [inline, static]

Simple function we use below to keep adding to the same string but also make sure we don't overwrite that string.

Parameters:
destString to append to.
origString to append.
curlenCurrent length of dest. Will be updated by this function.
maxlenMaximum length of dest buffer.

Definition at line 1511 of file define.h.