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

Go to the source code of this file.


#define CALLOC(x, y)   calloc(x, y)
#define FALSE   false
#define FMT64   PRId64
#define FMT64U   PRIu64
#define MAX(x, y)   ((x) > (y) ? (x) : (y))
#define MIN(x, y)   ((x) < (y) ? (x) : (y))
#define object_decrease_nrof_by_one(xyz)   object_decrease_nrof(xyz, 1)
#define safe_strncpy   strlcpy
#define strcasestr_local   strcasestr
#define strdup_local   strdup
#define TRUE   true


void safe_strcat (char *dest, const char *orig, size_t *curlen, size_t maxlen)
size_t strlcpy (char *dst, const char *src, size_t size)

Detailed Description

Compatibility implementations of useful nonstandard types and functions.

Definition in file compat.h.

Macro Definition Documentation


#define CALLOC (   x,
)    calloc(x, y)


◆ FMT64

◆ FMT64U

#define FMT64U   PRIu64

Definition at line 13 of file compat.h.

Referenced by main(), pay_for_amount(), pay_for_item(), save_map(), and START_TEST().



◆ object_decrease_nrof_by_one

◆ safe_strncpy

◆ strcasestr_local

#define strcasestr_local   strcasestr

Definition at line 24 of file compat.h.

Referenced by hiscore_display(), write_mark(), and write_note().

◆ strdup_local


Function Documentation

◆ safe_strcat()

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't overwrite that string.

deststring to append to.
origstring to append.
[out]curlencurrent length of dest. Will be updated by this function.
maxlenmaximum length of dest buffer.

Definition at line 350 of file porting.c.

Referenced by display_motd(), query_base_name(), query_name(), query_short_name(), send_new_char_info(), send_news(), send_rules(), and spellbook_type_describe().

+ Here is the caller graph for this function:

◆ strlcpy()