]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
utf8: Add a header file.
authorFlorian Forster <octo@collectd.org>
Fri, 22 Dec 2023 13:41:44 +0000 (14:41 +0100)
committerFlorian Forster <octo@collectd.org>
Thu, 28 Dec 2023 08:53:22 +0000 (09:53 +0100)
Makefile.am
src/utils/utf8/utf8.c
src/utils/utf8/utf8.h [new file with mode: 0644]

index 6d13d1ced0b28b71392fa6e788bf6729516a1b39..ad6947980295d7faebb0001cbf42f87968629a93 100644 (file)
@@ -636,7 +636,7 @@ liboconfig_la_SOURCES = \
 liboconfig_la_CPPFLAGS = -I$(srcdir)/src/liboconfig $(AM_CPPFLAGS)
 liboconfig_la_LDFLAGS = -avoid-version $(LEXLIB)
 
-libutf8_la_SOURCES = src/utils/utf8/utf8.c
+libutf8_la_SOURCES = src/utils/utf8/utf8.c src/utils/utf8/utf8.h
 
 if BUILD_WITH_LIBCURL
 if BUILD_WITH_LIBSSL
index fb6ead4395fcdb016e25bb8127d3c49f5e7065a6..25d2c1eb728de805f24ae940264c5dcd31491b89 100644 (file)
@@ -22,7 +22,7 @@
 
 // See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
 
-#include "collectd.h"
+#include "utils/utf8/utf8.h"
 
 #define UTF8_ACCEPT 0
 #define UTF8_REJECT 1
diff --git a/src/utils/utf8/utf8.h b/src/utils/utf8/utf8.h
new file mode 100644 (file)
index 0000000..a392f30
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2023      Florian "octo" Forster
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef UTILS_UTF8_H
+#define UTILS_UTF8_H 1
+
+#include "collectd.h"
+
+int IsUTF8(uint8_t *s);
+
+#endif