chiark / gitweb /
Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/disorder
[disorder] / lib / snprintf.c
index 69bafc777da79cca866fec2676991f6107a7f8a5..27ac595d81e1f7bc8f45f98d99ca620dd8c231c7 100644 (file)
@@ -15,6 +15,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+/** @file lib/snprintf.c
+ * @brief UTF-8 capable *snprintf workalikes
+ */
 
 #define NO_MEMORY_ALLOCATION
 /* because used from log.c */
 #include <stddef.h>
 
 #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;
 };