Crossfire Server, Branch 1.12  R12190
Defines
Code fastening defines

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__. More...

Defines

#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.


Define Documentation

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

Definition at line 1041 of file define.h.

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

Definition at line 1040 of file define.h.

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

Definition at line 1042 of file define.h.

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

Definition at line 1039 of file define.h.