posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
posix_string.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 The Zephyr Contributors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
18#ifndef ZEPHYR_INCLUDE_POSIX_POSIX_STRING_H_
19#define ZEPHYR_INCLUDE_POSIX_POSIX_STRING_H_
20
21#include <stddef.h> /* NULL, size_t */
22
23#include <zephyr/toolchain.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#if (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__)
38char *stpcpy(char *ZRESTRICT s1, const char *ZRESTRICT s2);
39#endif /* (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__) */
40
41#if (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__)
51char *stpncpy(char *ZRESTRICT s1, const char *ZRESTRICT s2, size_t n);
52#endif /* (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__) */
53
54#if (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 500) || defined(__DOXYGEN__)
62char *strdup(const char *s);
63#endif /* (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 500) || defined(__DOXYGEN__) */
64
65#if (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__)
75char *strndup(const char *s, size_t n);
76#endif /* (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__) */
77
78#if (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__)
88size_t strnlen(const char *s, size_t maxlen);
89#endif /* (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__) */
90
91#if (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__)
101char *strtok_r(char *str, const char *sep, char **state);
102
117char *strsignal(int signo);
118#endif /* (_POSIX_C_SOURCE >= 200809L) || (_XOPEN_SOURCE >= 700) || defined(__DOXYGEN__) */
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif /* ZEPHYR_INCLUDE_POSIX_POSIX_STRING_H_ */
char * strtok_r(char *str, const char *sep, char **state)
Tokenize a string into tokens (reentrant).
char * stpncpy(char *ZRESTRICT s1, const char *ZRESTRICT s2, size_t n)
Copy at most n bytes of a string and return a pointer to the terminating NUL byte.
char * strdup(const char *s)
Duplicate a string.
char * strndup(const char *s, size_t n)
Duplicate at most n bytes of a string.
char * stpcpy(char *ZRESTRICT s1, const char *ZRESTRICT s2)
Copy a string and return a pointer to the terminating NUL byte.
size_t strnlen(const char *s, size_t maxlen)
Determine the length of a fixed-size string.
char * strsignal(int signo)
Return a string describing a signal number.