From bc5663168d8fd42704d6a55af5a8c9992c75f6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 22 Sep 2015 16:32:41 +0200 Subject: text: add text_{v,}printf function Convenient way to insert formated data into a Text. --- text.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'text.h') diff --git a/text.h b/text.h index 48b630f..8bbb32f 100644 --- a/text.h +++ b/text.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -36,6 +37,8 @@ typedef struct { Text *text_load(const char *filename); /* file information at time of load or last save */ struct stat text_stat(Text*); +bool text_printf(Text*, size_t pos, const char *format, ...); +bool text_vprintf(Text*, size_t pos, const char *format, va_list ap); /* insert `len' bytes starting from `data' at `pos' which has to be * in the interval [0, text_size(txt)] */ bool text_insert(Text*, size_t pos, const char *data, size_t len); -- cgit v1.2.3