Crossfire Server, Trunk
toolkit_common.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FAIL(...)   _ck_assert_failed(__FILE__, __LINE__, "Failed" , ## __VA_ARGS__)
 
#define FAIL_IF(expr, ...)
 
#define FAIL_UNLESS(expr, ...)
 

Functions

objectcctk_create_game_object (const char *archname)
 
void cctk_init_std_archetypes (void)
 
void cctk_set_object_strings (object *op, const char *string)
 
void cctk_setdatadir (const char *datadir)
 
void cctk_setlog (const char *logfile)
 

Macro Definition Documentation

◆ FAIL

#define FAIL (   ...)    _ck_assert_failed(__FILE__, __LINE__, "Failed" , ## __VA_ARGS__)

Definition at line 9 of file toolkit_common.h.

◆ FAIL_IF

#define FAIL_IF (   expr,
  ... 
)
Value:
(expr) ? \
_ck_assert_failed(__FILE__, __LINE__, "Failure '"#expr"' occurred" , ## __VA_ARGS__) \
: _mark_point(__FILE__, __LINE__)

Definition at line 16 of file toolkit_common.h.

◆ FAIL_UNLESS

#define FAIL_UNLESS (   expr,
  ... 
)
Value:
(expr) ? \
_mark_point(__FILE__, __LINE__) : \
_ck_assert_failed(__FILE__, __LINE__, "Assertion '"#expr"' failed" , ## __VA_ARGS__)

Definition at line 11 of file toolkit_common.h.

Function Documentation

◆ cctk_create_game_object()

object* cctk_create_game_object ( const char *  archname)

Initialize a simple object. Make it appear as an actual ingame object by setting appropriate flags (so it is part of game, not just a storage) Requires arch and object initialized in status flag

Parameters
archnamethe archetype name to use (NULL= default one)
Returns
created object, including its more parts, or NULL if archetype doesn't exist.

Definition at line 105 of file toolkit_common.cpp.

References archininventory::arch, CCTK_ASSERT, CLEAR_FLAG, find_archetype(), FLAG_FREED, altar_valkyrie::obj, object_create_arch(), STATUS_ARCH, and STATUS_OBJECTS.

Referenced by START_TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cctk_init_std_archetypes()

void cctk_init_std_archetypes ( void  )

Loads up to archetype initialisation using standard crossfire files in source tree. This function requires that cctk_setlog and cctk_setdatadir have both been run already.

Definition at line 83 of file toolkit_common.cpp.

References ASSETS_ALL, assets_collect(), assets_init(), CCTK_ASSERT, Settings::datadir, init_block(), init_globals(), init_hash_table(), init_objects(), init_stats(), SET_TKFLAG, settings, STATUS_ANIM, STATUS_ARCH, STATUS_BLOCK, STATUS_BMAP, STATUS_DATADIR, STATUS_GLOBALS, STATUS_HASHTABLE, STATUS_LOGDIR, STATUS_OBJECTS, and STATUS_VARS.

Referenced by setup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cctk_set_object_strings()

void cctk_set_object_strings ( object op,
const char *  string 
)

Set all strings in given object to given parameter string, used for checking cleaning of objects, mainly

Parameters
opThe object to initialize
stringThe string to set in all object's char *fields

Definition at line 127 of file toolkit_common.cpp.

References add_string(), and give::op.

Referenced by START_TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cctk_setdatadir()

void cctk_setdatadir ( const char *  datadir)

Definition at line 69 of file toolkit_common.cpp.

References Settings::confdir, Settings::datadir, SET_TKFLAG, settings, STATUS_CONFDIR, and STATUS_DATADIR.

Referenced by main(), and setup().

+ Here is the caller graph for this function:

◆ cctk_setlog()

void cctk_setlog ( const char *  logfile)

set the logdir to use

Definition at line 64 of file toolkit_common.cpp.

References logfile, Settings::logfilename, SET_TKFLAG, settings, and STATUS_LOGDIR.

Referenced by setup().

+ Here is the caller graph for this function: