Skip to content

Commit 03e0f86

Browse files
committed
in_tail: tests: Use proxyed function and constants for using simdutf stuffs
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 10e0f91 commit 03e0f86

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

plugins/in_tail/tail_config.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#endif
3838

3939
#ifdef FLB_HAVE_UNICODE_ENCODER
40-
#include <fluent-bit/simdutf/flb_simdutf_connector.h>
40+
#include <fluent-bit/flb_unicode.h>
4141
#endif
4242

4343
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,
112112
ctx->db_sync = 1; /* sqlite sync 'normal' */
113113
#endif
114114
#ifdef FLB_HAVE_UNICODE_ENCODER
115-
ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UNSPECIFIED;
115+
ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UNSPECIFIED;
116116
#endif
117117

118118
/* Load the config map */
@@ -201,17 +201,17 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *ins,
201201
tmp = flb_input_get_property("unicode.encoding", ins);
202202
if (tmp) {
203203
if (strcasecmp(tmp, "auto") == 0) {
204-
ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UNICODE_AUTO;
204+
ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_AUTO;
205205
adjust_buffer_for_2bytes_alignments(ctx);
206206
}
207207
else if (strcasecmp(tmp, "utf-16le") == 0 ||
208208
strcasecmp(tmp, "utf16-le") == 0) {
209-
ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UTF16_LE;
209+
ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UTF16_LE;
210210
adjust_buffer_for_2bytes_alignments(ctx);
211211
}
212212
else if (strcasecmp(tmp, "utf-16be") == 0 ||
213213
strcasecmp(tmp, "utf16-be") == 0) {
214-
ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UTF16_BE;
214+
ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UTF16_BE;
215215
adjust_buffer_for_2bytes_alignments(ctx);
216216
}
217217
else {

plugins/in_tail/tail_file.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#endif
5050

5151
#ifdef FLB_HAVE_UNICODE_ENCODER
52-
#include <fluent-bit/simdutf/flb_simdutf_connector.h>
52+
#include <fluent-bit/flb_unicode.h>
5353
#endif
5454

5555
#include <cfl/cfl.h>
@@ -460,16 +460,16 @@ static int process_content(struct flb_tail_file *file, size_t *bytes)
460460
file->last_processed_bytes = 0;
461461

462462
#ifdef FLB_HAVE_UNICODE_ENCODER
463-
if (ctx->preferred_input_encoding != FLB_SIMDUTF_ENCODING_TYPE_UNSPECIFIED) {
463+
if (ctx->preferred_input_encoding != FLB_UNICODE_ENCODING_UNSPECIFIED) {
464464
original_len = end - data;
465465
decoded = NULL;
466-
ret = flb_simdutf_connector_convert_from_unicode(ctx->preferred_input_encoding,
467-
data, end - data, &decoded, &decoded_len);
466+
ret = flb_unicode_convert(ctx->preferred_input_encoding,
467+
data, end - data, &decoded, &decoded_len);
468468
if (ret == FLB_SIMDUTF_CONNECTOR_CONVERT_OK) {
469469
data = decoded;
470470
end = data + decoded_len;
471471
}
472-
else if (ret == FLB_SIMDUTF_CONNECTOR_CONVERT_NOP) {
472+
else if (ret == FLB_UNICODE_CONVERT_NOP) {
473473
flb_plg_debug(ctx->ins, "nothing to convert encoding '%.*s'", end - data, data);
474474
}
475475
else {

tests/runtime/in_tail.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Approach for this tests is basing on filter_kubernetes tests
2727
#include <fluent-bit/flb_pthread.h>
2828
#include <fluent-bit/flb_compat.h>
2929
#ifdef FLB_HAVE_UNICODE_ENCODER
30-
#include <fluent-bit/simdutf/flb_simdutf_connector.h>
30+
#include <fluent-bit/flb_unicode.h>
3131
#endif
3232
#include <stdlib.h>
3333
#include <sys/stat.h>
@@ -455,7 +455,7 @@ static int cb_check_result_unicode(void *record, size_t size, void *data)
455455
goto exit;
456456
}
457457

458-
valid = flb_simdutf_connector_validate_utf8(record, size);
458+
valid = flb_unicode_validate(record, size);
459459
if (valid == FLB_FALSE) {
460460
goto exit;
461461
}

0 commit comments

Comments
 (0)