From d21adc7eff137c390910212753ff7e15e67606f3 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 22 Sep 2022 22:14:09 +0200 Subject: [PATCH] fd: Improve documentation of write_va_buffer(). This public function was a bit underdocumented, so explain in more detail what the function does, and how it differs from fprintf(3). --- fd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fd.c b/fd.c index 763f756c..5d23babf 100644 --- a/fd.c +++ b/fd.c @@ -149,12 +149,20 @@ int write_all(int fd, const char *buf, size_t len) } /** - * Write a buffer given by a format string. + * A fprintf-like function for raw file descriptors. + * + * This function creates a string buffer according to the given format and + * writes this buffer to a file descriptor. * * \param fd The file descriptor. * \param fmt A format string. * + * The difference to fprintf(3) is that the first argument is a file + * descriptor, not a FILE pointer. This function does not rely on stdio. + * * \return The return value of the underlying call to \ref write_all(). + * + * \sa fprintf(3), \ref xvasprintf(). */ __printf_2_3 int write_va_buffer(int fd, const char *fmt, ...) { -- 2.39.2