Common C macro definitions.
More...
#include <assert.h>
#include <stddef.h>
Go to the source code of this file.
|
| static size_t | TCOD_strscpy (char *dest, const char *src, size_t count) |
| | Copy src into a fixed-size buffer, return bytes copied excluding NULL and always NULL terminates dest.
|
| |
Common C macro definitions.
◆ TCOD_ABS
◆ TCOD_CLAMP
| #define TCOD_CLAMP |
( |
| a, |
|
|
| b, |
|
|
| x ) |
Value:((x) < (a) ? (a) : ((x) > (b) ? (b) : (x)))
◆ TCOD_LERP
| #define TCOD_LERP |
( |
| a, |
|
|
| b, |
|
|
| x ) |
Value:((a) + (x) * ((b) - (a)))
◆ TCOD_MAX
| #define TCOD_MAX |
( |
| a, |
|
|
| b ) |
Value:(((a) > (b)) ? (a) : (b))
◆ TCOD_MIN
| #define TCOD_MIN |
( |
| a, |
|
|
| b ) |
Value:(((a) < (b)) ? (a) : (b))
◆ TCOD_strscpy()
| static size_t TCOD_strscpy |
( |
char * | dest, |
|
|
const char * | src, |
|
|
size_t | count ) |
|
inlinestatic |
Copy src into a fixed-size buffer, return bytes copied excluding NULL and always NULL terminates dest.
Safer and easier to understand than strncpy while also being faster.