35 #include <sys/types.h> 49 #define NEW(T) (T *)new(sizeof(T)) 64 #define NEWSTR(len) (char *)new( sizeof(char)*((size_t)((len)+1)) ) 85 extern void *
new(
size_t size);
89 extern void *
new_overs(
void *pSrc,
size_t sizeDup,
size_t sizeNew);
91 extern void *
new_memdup(
size_t size,
void *data);
102 #if !defined(__windows__) 106 extern char *
strcpy_s(
char *dest,
size_t n,
const char *src);
121 template <
size_t size>
122 inline int sprintf_s(
char (&str)[size],
const char *format, ...)
125 size_t n =
sizeof(str);
128 va_start(ap, format);
129 nPrinted = vsnprintf(str, n, format, ap);
139 extern int sprintf_s(
char *str,
size_t n,
const char *format, ...);
143 #endif // __cplusplus 145 #endif // ! __windows__ char * new_strndup(const char *s, size_t n)
Duplicate not more than n characters of string.
char * new_strdup(const char *s)
Duplicate a string.
void * new_memdup(size_t size, void *data)
Duplicate data.
#define C_DECLS_BEGIN
C declaration block begin in C.
int sprintf_s(char *str, size_t n, const char *format,...)
Format print to string up to n-1 characters. String is guaranteed to be null terminated.
void * new_overs(void *pSrc, size_t sizeDup, size_t sizeNew)
Allocate and duplicate.
RoadNarrows Robotics common configuration file.
#define INLINE_IN_H
inline C funtion in C header
#define C_DECLS_END
C declaration block end in C.
char * strcpy_s(char *dest, size_t n, const char *src)
Copy source string to destinations string. At most n bytes will be copied. The destination string is ...