From: Alejandro Colomar <alx.manpages@gmail.com>
To: libc-alpha@sourceware.org
Cc: Alejandro Colomar <alx@kernel.org>
Subject: Re: [PATCH v2 3/3] stdio: Add stpeprintf()
Date: Thu, 29 Dec 2022 00:27:27 +0100 [thread overview]
Message-ID: <e2e84448-2975-e7b4-bc70-371635369cd6@gmail.com> (raw)
In-Reply-To: <20221228231741.125945-4-alx@kernel.org>
[-- Attachment #1.1: Type: text/plain, Size: 2628 bytes --]
stpeprintf(3) Library Functions Manual stpeprintf(3)
NAME
stpeprintf, vstpeprintf - create a formatted string with truncation
LIBRARY
stp string library (libstp, pkgconf ‐‐cflags ‐‐libs libstp)
SYNOPSIS
#include <stp/stpe/stpeprintf.h>
char *_Nullable stpeprintf(char *_Nullable dst, char end[0],
const char *restrict fmt, ...);
char *_Nullable vstpeprintf(char *_Nullable dst, char end[0],
const char *restrict fmt, va_list ap);
DESCRIPTION
These functions are almost identical to snprintf(3) and vsnprintf(3).
The destination buffer is limited by a pointer to its end —one after
its last element— instead of a size.
These functions can be chained with calls to stpeprintf(3) and
vstpeprintf(3).
RETURN VALUE
NULL
• If this function failed (see ERRORS).
• If dst was NULL.
end
• If this call truncated.
• If dst was equal to end (a previous call to these functions
truncated).
dst + strlen(dst)
On success, these functions return a pointer to the terminating
null byte.
ERRORS
These functions may fail for any of the same reasons as vsnprintf(3).
ATTRIBUTES
For an explanation of the terms used in this section, see attrib‐
utes(7).
┌────────────────────────────────────────────┬───────────────┬─────────┐
│Interface │ Attribute │ Value │
├────────────────────────────────────────────┼───────────────┼─────────┤
│stpeprintf(3), vstpeprintf(3) │ Thread safety │ MT‐Safe │
└────────────────────────────────────────────┴───────────────┴─────────┘
STANDARDS
None.
EXAMPLES
See stpecpy(3).
SEE ALSO
stpecpy(3), string_copying(7)
libstp (unreleased) (date) stpeprintf(3)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-12-28 23:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 21:42 [PATCH 0/1] string: Add stpecpy(3) Alejandro Colomar
2022-12-22 21:42 ` [PATCH 1/1] " Alejandro Colomar
2022-12-23 7:02 ` Sam James
2022-12-23 12:26 ` Alejandro Colomar
2022-12-23 12:29 ` Alejandro Colomar
2022-12-23 17:21 ` Alejandro Colomar
2022-12-31 15:13 ` Sam James
2022-12-31 15:15 ` Alejandro Colomar
2022-12-28 23:17 ` [PATCH v2 0/3] Add stpe*() functions Alejandro Colomar
2022-12-29 0:01 ` Zack Weinberg
2022-12-29 10:13 ` Alejandro Colomar
2022-12-28 23:17 ` [PATCH v2 1/3] string: Add stpecpy() Alejandro Colomar
2022-12-28 23:27 ` Alejandro Colomar
2022-12-28 23:17 ` [PATCH v2 2/3] stdio: Add vstpeprintf() Alejandro Colomar
2022-12-28 23:17 ` [PATCH v2 3/3] stdio: Add stpeprintf() Alejandro Colomar
2022-12-28 23:27 ` Alejandro Colomar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e2e84448-2975-e7b4-bc70-371635369cd6@gmail.com \
--to=alx.manpages@gmail.com \
--cc=alx@kernel.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).