1 | #ifndef UV_STRSCPY_H_ |
2 | #define UV_STRSCPY_H_ |
3 | |
4 | /* Include uv.h for its definitions of size_t and ssize_t. |
5 | * size_t can be obtained directly from <stddef.h> but ssize_t requires |
6 | * some hoop jumping on Windows that I didn't want to duplicate here. |
7 | */ |
8 | #include "uv.h" |
9 | |
10 | /* Copies up to |n-1| bytes from |d| to |s| and always zero-terminates |
11 | * the result, except when |n==0|. Returns the number of bytes copied |
12 | * or UV_E2BIG if |d| is too small. |
13 | * |
14 | * See https://www.kernel.org/doc/htmldocs/kernel-api/API-strscpy.html |
15 | */ |
16 | ssize_t uv__strscpy(char* d, const char* s, size_t n); |
17 | |
18 | #endif /* UV_STRSCPY_H_ */ |
19 | |