From 6cd51d52e177314a68c6c2f6c598798136ba1b52 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Fri, 3 Nov 2023 18:13:05 +0100 Subject: add steccpy --- libste.3 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'libste.3') diff --git a/libste.3 b/libste.3 index c739a07..994d12a 100644 --- a/libste.3 +++ b/libste.3 @@ -12,6 +12,8 @@ .Ft "char *" .Fn stecpy "char *dst" "char *end" "const char *src" .Ft "char *" +.Fn steccpy "char *dst" "char *end" "const char *src" "int c" +.Ft "char *" .Fn stecpe "char *dst" "char *end" "const char *src" "const char *srcend" .Ft "char *" .Fn stechr "const char *src" "const char *end" "int c" @@ -19,7 +21,7 @@ .Fn steprn "char *dst" "char *end" "const char *fmt" "..." .Sh DESCRIPTION .Nm libste -provides four useful functions for dealing with strings. +provides five useful functions for dealing with strings. .Pp .Nm stecpy copies the NUL-terminated string @@ -36,6 +38,24 @@ On truncation, .Fa end is returned. .Pp +.Nm steccpy +copies the NUL-terminated string +.Fa src +to +.Fa dst , +stopping when the character +.Fa c +is found. +It writes no characters beyond +.Fa end . +If any characters are copied, +.Fa dst +will be NUL-terminated +and the return value is a pointer to the NUL byte. +On truncation, +.Fa end +is returned. +.Pp .Nm stecpe copies the string between .Fa src -- cgit 1.4.1