summaryrefslogtreecommitdiffstats
path: root/include/c/str/cpy/stp/stp/ustr2stp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/c/str/cpy/stp/stp/ustr2stp.h')
-rw-r--r--include/c/str/cpy/stp/stp/ustr2stp.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/c/str/cpy/stp/stp/ustr2stp.h b/include/c/str/cpy/stp/stp/ustr2stp.h
new file mode 100644
index 0000000..9c8b21f
--- /dev/null
+++ b/include/c/str/cpy/stp/stp/ustr2stp.h
@@ -0,0 +1,33 @@
+// Copyright 2022 Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception
+
+
+#ifndef INCLUDE_C_STR_CPY_STP_STP_USTR2STP_H_
+#define INCLUDE_C_STR_CPY_STP_STP_USTR2STP_H_
+
+
+#include <stddef.h>
+
+#include <c/str/cpy/stp/_compiler.h> // IWYU pragma: keep
+#include <c/str/cpy/stp/ustp/ustpcpy.h>
+
+
+#pragma clang assume_nonnull begin
+inline char *c_ustr2stp(char *restrict dst, const char *restrict src,
+ size_t len);
+
+
+inline char *
+c_ustr2stp(char *restrict dst, const char *restrict src, size_t len)
+{
+ char *p;
+
+ p = c_ustpcpy(dst, src, len);
+ *p = '\0';
+
+ return p;
+}
+#pragma clang assume_nonnull end
+
+
+#endif // Header guard