]> git.lizzy.rs Git - linenoise.git/blobdiff - stringbuf.c
Use CMake
[linenoise.git] / stringbuf.c
index acac04c9d3d95974192fec0a36ad6115829cedd8..2f31c5fba5bc0d1e97daf768824d1342e1205db2 100644 (file)
@@ -1,13 +1,24 @@
+/**
+ * resizable string buffer
+ *
+ * (c) 2017-2020 Steve Bennett <steveb@workware.net.au>
+ *
+ * See utf8.c for licence details.
+ */
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <assert.h>
 
+#ifndef STRINGBUF_H
 #include "stringbuf.h"
+#endif
 #ifdef USE_UTF8
+#ifndef UTF8_UTIL_H
 #include "utf8.h"
 #endif
+#endif
 
 #define SB_INCREMENT 200
 
@@ -45,7 +56,6 @@ void sb_append(stringbuf *sb, const char *str)
 
 void sb_append_len(stringbuf *sb, const char *str, int len)
 {
-       int utf8_strlen(const char *str, int bytelen);
        if (sb->remaining < len + 1) {
                sb_realloc(sb, sb->last + len + 1 + SB_INCREMENT);
        }