X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/e7eb3a2744aa45179daea235800753d3d1955338..c0f84b88cab9518d29900e02a9fb67776820e902:/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; };