From 5e4da6f81afbcd96b7b9900c8d3f69e3f03c3b80 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Fri, 8 Nov 2024 20:02:24 +0900 Subject: [PATCH] in_tail: Use proxyed function and constants for using simdutf stuffs Signed-off-by: Hiroshi Hatake --- plugins/in_tail/tail_config.c | 10 +++++----- plugins/in_tail/tail_file.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/in_tail/tail_config.c b/plugins/in_tail/tail_config.c index e5095b254ad..e1b8205a480 100644 --- a/plugins/in_tail/tail_config.c +++ b/plugins/in_tail/tail_config.c @@ -37,7 +37,7 @@ #endif #ifdef FLB_HAVE_UNICODE_ENCODER -#include +#include #endif static int multiline_load_parsers(struct flb_tail_config *ctx) @@ -112,7 +112,7 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *ins, ctx->db_sync = 1; /* sqlite sync 'normal' */ #endif #ifdef FLB_HAVE_UNICODE_ENCODER - ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UNSPECIFIED; + ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UNSPECIFIED; #endif /* Load the config map */ @@ -201,17 +201,17 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *ins, tmp = flb_input_get_property("unicode.encoding", ins); if (tmp) { if (strcasecmp(tmp, "auto") == 0) { - ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UNICODE_AUTO; + ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_AUTO; adjust_buffer_for_2bytes_alignments(ctx); } else if (strcasecmp(tmp, "utf-16le") == 0 || strcasecmp(tmp, "utf16-le") == 0) { - ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UTF16_LE; + ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UTF16_LE; adjust_buffer_for_2bytes_alignments(ctx); } else if (strcasecmp(tmp, "utf-16be") == 0 || strcasecmp(tmp, "utf16-be") == 0) { - ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UTF16_BE; + ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UTF16_BE; adjust_buffer_for_2bytes_alignments(ctx); } else { diff --git a/plugins/in_tail/tail_file.c b/plugins/in_tail/tail_file.c index 134731029ba..a265d3d8707 100644 --- a/plugins/in_tail/tail_file.c +++ b/plugins/in_tail/tail_file.c @@ -49,7 +49,7 @@ #endif #ifdef FLB_HAVE_UNICODE_ENCODER -#include +#include #endif #include @@ -460,16 +460,16 @@ static int process_content(struct flb_tail_file *file, size_t *bytes) file->last_processed_bytes = 0; #ifdef FLB_HAVE_UNICODE_ENCODER - if (ctx->preferred_input_encoding != FLB_SIMDUTF_ENCODING_TYPE_UNSPECIFIED) { + if (ctx->preferred_input_encoding != FLB_UNICODE_ENCODING_UNSPECIFIED) { original_len = end - data; decoded = NULL; - ret = flb_simdutf_connector_convert_from_unicode(ctx->preferred_input_encoding, - data, end - data, &decoded, &decoded_len); + ret = flb_unicode_convert(ctx->preferred_input_encoding, + data, end - data, &decoded, &decoded_len); if (ret == FLB_SIMDUTF_CONNECTOR_CONVERT_OK) { data = decoded; end = data + decoded_len; } - else if (ret == FLB_SIMDUTF_CONNECTOR_CONVERT_NOP) { + else if (ret == FLB_UNICODE_CONVERT_NOP) { flb_plg_debug(ctx->ins, "nothing to convert encoding '%.*s'", end - data, data); } else {