Crossfire Server, Trunk  R20513
Macros | Functions
check_item.c File Reference
#include <global.h>
#include <stdlib.h>
#include <check.h>
#include <loader.h>
#include <toolkit_common.h>
Include dependency graph for check_item.c:

Go to the source code of this file.

Macros

#define DESCRIBE_ABILITY_SAFE(retbuf, variable, name, len, maxlen)
 
#define DESCRIBE_PATH_SAFE(retbuf, variable, name, len, maxlen)
 

Functions

static END_TEST Suite * item_suite (void)
 
int main (void)
 
static void old_describe_monster (const object *op, char *retbuf, size_t size)
 
static void setup (void)
 
 START_TEST (test_describe_item)
 
 START_TEST (test_describe_monster_rewrite)
 
static void teardown (void)
 

Macro Definition Documentation

#define DESCRIBE_ABILITY_SAFE (   retbuf,
  variable,
  name,
  len,
  maxlen 
)
Value:
if (variable) { \
int i, j = 0; \
safe_strcat(retbuf, "(" name ": ", len, maxlen); \
for (i = 0; i < NROFATTACKS; i++) \
if (variable&(1<<i)) { \
if (j) \
safe_strcat(retbuf, ", ", len, maxlen); \
else \
j = 1; \
safe_strcat(retbuf, attacks[i], len, maxlen); \
} \
safe_strcat(retbuf, ")", len, maxlen); \
}
void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen)
Simple function we use below to keep adding to the same string but also make sure we don&#39;t overwrite ...
Definition: porting.c:346
#define NROFATTACKS
Definition: attack.h:17
const char *const attacks[NROFATTACKS]
Attack type names.
Definition: living.c:129

Definition at line 222 of file check_item.c.

Referenced by old_describe_monster().

#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); \
}
const char *const spellpathnames[NRSPELLPATHS]
Perhaps not the best place for this, but needs to be in some file in the common area so that standalo...
Definition: init.c:120
#define NRSPELLPATHS
Number of spell paths.
Definition: spells.h:40
void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen)
Simple function we use below to keep adding to the same string but also make sure we don&#39;t overwrite ...
Definition: porting.c:346

Definition at line 207 of file check_item.c.

Referenced by old_describe_monster().

Function Documentation

static END_TEST Suite* item_suite ( void  )
static

Definition at line 401 of file check_item.c.

References setup(), and teardown().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( void  )

Definition at line 415 of file check_item.c.

References item_suite().

Here is the call graph for this function:

static void old_describe_monster ( const object op,
char *  retbuf,
size_t  size 
)
static
static void setup ( void  )
static

Definition at line 39 of file check_item.c.

References cctk_init_std_archetypes(), cctk_setdatadir(), cctk_setlog(), init_formulae(), and init_gods().

Referenced by item_suite().

Here is the call graph for this function:

Here is the caller graph for this function:

START_TEST ( test_describe_item  )
START_TEST ( test_describe_monster_rewrite  )
static void teardown ( void  )
static

Definition at line 47 of file check_item.c.

Referenced by item_suite().

Here is the caller graph for this function: