Crossfire Server, Branches 1.12  R18729
Code fastening defines

Macros

#define FAST_STRCAT(buf__, buf2__)   { memcpy(buf__, buf2__, strlen(buf2__)); buf__ += strlen(buf2__); }
 
#define FAST_STRNCAT(buf__, buf2__, size__)   { memcpy(buf__, buf2__, size__); buf__ += size__; }
 
#define FINISH_FASTCAT(buf__)   buf__[0] = '\0';
 
#define PREPARE_FASTCAT(buf__)   buf__+strlen(buf__)
 

Detailed Description

FAST_STRCAT & FAST_STRNCAT will add buf2__ at position pointed by buf__ and increment buf__ position so it will point to the end of buf__. the '\0' caracter will not be put at end of buf__. use preparefastcat and finishfastcat on buf__ to prepare and clean up the string. (Lots faster than doing each time...) If you use them and have choice between FAST_STRCAT and FAST_STRNCAT, keep in mind FAST_STRNCAT is faster since length of second argument is known in advance.

Macro Definition Documentation

#define FAST_STRCAT (   buf__,
  buf2__ 
)    { memcpy(buf__, buf2__, strlen(buf2__)); buf__ += strlen(buf2__); }

Definition at line 1115 of file define.h.

#define FAST_STRNCAT (   buf__,
  buf2__,
  size__ 
)    { memcpy(buf__, buf2__, size__); buf__ += size__; }

Definition at line 1114 of file define.h.

#define FINISH_FASTCAT (   buf__)    buf__[0] = '\0';

Definition at line 1116 of file define.h.

#define PREPARE_FASTCAT (   buf__)    buf__+strlen(buf__)

Definition at line 1113 of file define.h.