X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/e7eb3a2744aa45179daea235800753d3d1955338..8ab2aa9fd51a89e06d92a4f7c3792aaa4a08cc71:/lib/snprintf.c
diff --git a/lib/snprintf.c b/lib/snprintf.c
index 69bafc7..27ac595 100644
--- a/lib/snprintf.c
+++ b/lib/snprintf.c
@@ -15,6 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+/** @file lib/snprintf.c
+ * @brief UTF-8 capable *snprintf workalikes
+ */
#define NO_MEMORY_ALLOCATION
/* because used from log.c */
@@ -25,12 +28,24 @@
#include
#include "printf.h"
+#include "log.h"
#include "sink.h"
+/** @brief A @ref sink that stores to a fixed buffer
+ *
+ * If there is too much output, it is truncated.
+ */
struct fixedstr_sink {
+ /** @brief Base */
struct sink s;
+
+ /** @brief Output buffer */
char *buffer;
+
+ /** @brief Bytes written so far */
int nbytes;
+
+ /** @brief Size of buffer */
size_t size;
};