From: Florian Forster Date: Fri, 22 Dec 2023 13:41:44 +0000 (+0100) Subject: utf8: Add a header file. X-Git-Tag: 6.0.0-rc0~22^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=850bc1c9ce6110fc03189ab3f35dfd4d954d6d3d;p=thirdparty%2Fcollectd.git utf8: Add a header file. --- diff --git a/Makefile.am b/Makefile.am index 6d13d1ced..ad6947980 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/src/utils/utf8/utf8.c b/src/utils/utf8/utf8.c index fb6ead439..25d2c1eb7 100644 --- a/src/utils/utf8/utf8.c +++ b/src/utils/utf8/utf8.c @@ -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 index 000000000..a392f3082 --- /dev/null +++ b/src/utils/utf8/utf8.h @@ -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