server/src/util/bsdstring.h

27 lines
995 B
C
Raw Normal View History

2010-08-08 10:06:34 +02:00
#ifndef UTIL_BSDSTRING_H
#define UTIL_BSDSTRING_H
#include <stddef.h>
int wrptr(char **ptr, size_t * size, int bytes);
#ifndef HAVE_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t siz);
2010-08-08 10:06:34 +02:00
#endif
char * strlcpy_w(char *dst, const char *src, size_t *siz, const char *err, const char *file, int line);
2010-08-08 10:06:34 +02:00
#ifndef HAVE_STRLCAT
size_t strlcat(char *dst, const char *src, size_t siz);
#endif
2010-08-08 10:06:34 +02:00
#ifndef HAVE_SLPRINTF
size_t slprintf(char * dst, size_t size, const char * format, ...);
2010-08-08 10:06:34 +02:00
#endif
#define WARN_STATIC_BUFFER_EX(foo) log_warning("%s: static buffer too small in %s:%d\n", (foo), __FILE__, __LINE__)
#define WARN_STATIC_BUFFER() log_warning("static buffer too small in %s:%d\n", __FILE__, __LINE__)
2015-07-08 18:27:27 +02:00
#define INFO_STATIC_BUFFER() log_info("static buffer too small in %s:%d\n", __FILE__, __LINE__)
#define STRLCPY(dst, src, siz) strlcpy_w((dst), (src), &(siz), 0, __FILE__, __LINE__)
#define STRLCPY_EX(dst, src, siz, err) strlcpy_w((dst), (src), (siz), (err), __FILE__, __LINE__)
2010-08-08 10:06:34 +02:00
#endif