21 #ifndef _LIBSTRL_STRL_H
22 #define _LIBSTRL_STRL_H
128 #include <sys/types.h>
138 #ifndef _LIBSTRL_WITH_UNIFDEF
152 #define _LIBSTRL_DECLARE_STRLCAT
156 #define _LIBSTRL_DECLARE_STRLCPY
169 #define _LIBSTRL_DECLARE_WCSLCAT
173 #define _LIBSTRL_DECLARE_WCSLCPY
185 #ifdef _LIBSTRL_DECLARE_ASPRINTF
211 int asprintf(
char **s,
const char *format, ...);
214 #ifdef _LIBSTRL_DECLARE_GETDELIM
266 ssize_t
getdelim(
char **lineptr,
size_t *n,
int delim, FILE *stream);
269 #ifdef _LIBSTRL_DECLARE_GETLINE
292 ssize_t
getline(
char **lineptr,
size_t *n, FILE *stream);
295 #ifdef _LIBSTRL_DECLARE_STRLCAT
323 size_t strlcat(
char *dst,
const char *src,
size_t len);
327 #ifdef _LIBSTRL_DECLARE_STRLCPY
362 size_t strlcpy(
char *dst,
const char *src,
size_t len);
366 #ifdef _LIBSTRL_DECLARE_STRNLEN
396 size_t strnlen(
const char *s,
size_t maxlen);
399 #ifdef _LIBSTRL_DECLARE_STRNDUP
426 char *
strndup(
const char *s,
size_t n);
429 #ifdef _LIBSTRL_DECLARE_WCSLCAT
459 size_t wcslcat(
wchar_t *dst,
const wchar_t *src,
size_t len);
463 #ifdef _LIBSTRL_DECLARE_WCSLCPY
491 size_t wcslcpy(
wchar_t *dst,
const wchar_t *src,
size_t len);
495 #ifdef _LIBSTRL_DECLARE_WCSNLEN
521 size_t wcsnlen(
const wchar_t *s,
size_t maxlen);
524 #ifdef _LIBSTRL_DECLARE_VASPRINTF
554 int vasprintf(
char **s,
const char *format, va_list ap);
int vasprintf(char **s, const char *format, va_list ap)
Allocate a buffer of appropriate size and format a string into it.
size_t strlcpy(char *dst, const char *src, size_t len)
Copy a string into another buffer with extra string length checks and gauranteeing NUL termination...
ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream)
Read from a stream until a delimiter is reached.
int asprintf(char **s, const char *format,...)
Allocate a buffer of appropriate size and format a string into it.
size_t strnlen(const char *s, size_t maxlen)
Count up to the first n characters in a string.
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t len)
Concatenate a wide string onto a buffer, setting the null terminator and avoiding writing beyond the ...
size_t wcsnlen(const wchar_t *s, size_t maxlen)
Count up to the first n wide characters in a string.
ssize_t getline(char **lineptr, size_t *n, FILE *stream)
Read one line from a stream into a buffer.
size_t strlcat(char *dst, const char *src, size_t len)
Concatenate a string onto another string without causing the destination string to overrun its buffer...
size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t len)
Copy a wide string into a buffer without overflowing it, placing an appropriate null terminator...
char * strndup(const char *s, size_t n)
Duplicate a string, but possibly truncate it.