Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calyptia: switch to YAML for Fleet config #9698

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
8f95fb1
calyptia: switch to YAML for Fleet config
patrick-stephens Dec 9, 2024
46797a4
calyptia: switch to YAML for Fleet config
patrick-stephens Dec 9, 2024
d2c32a9
cprofiles: fix macOS error
patrick-stephens Dec 9, 2024
2e7f408
calyptia: ensure machine-id config filename stays consistent
patrick-stephens Dec 9, 2024
8e689ec
calyptia: ensure fleet config is yaml
patrick-stephens Dec 9, 2024
4ab02b6
calyptia: split up input plugin files
patrick-stephens Dec 11, 2024
93c4a64
calyptia: remove bool usage
patrick-stephens Dec 11, 2024
a6a9c9c
calyptia: add support for configurable format
patrick-stephens Dec 11, 2024
02d367d
test: add basic config format check
patrick-stephens Dec 11, 2024
3ea4a53
calyptia: add support for configurable format
patrick-stephens Dec 11, 2024
12165af
test: fix memory usage
patrick-stephens Dec 11, 2024
5ef6296
in_calyptia_fleet: fix up review comments
patrick-stephens Dec 16, 2024
5d51ec8
tests: runtime: in_calyptia_fleet: add placeholders
patrick-stephens Dec 16, 2024
0d6fea1
in_calyptia_fleet: refactor to expose functions
patrick-stephens Dec 16, 2024
5c80ce7
in_calyptia_fleet: fix Windows failure
patrick-stephens Dec 16, 2024
e302b5b
in_calyptia_fleet: fix possible uninit usage
patrick-stephens Dec 16, 2024
86bf6d4
tests: runtime: in_calyptia_fleet: update mock server
patrick-stephens Dec 16, 2024
bfacebb
tests: runtime: in_calyptia_fleet: remove useless mocking
patrick-stephens Dec 17, 2024
9e2234e
tests: runtime_shell: custom_calyptia: add checks for fleet management
patrick-stephens Dec 17, 2024
17ecbde
tests: runtime_shell: custom_calyptia: fix config
patrick-stephens Dec 17, 2024
fd097a6
workflows: pin packaging to ubuntu 22
patrick-stephens Dec 17, 2024
6c0b8d7
tests: runtime_shell: custom_calyptia: fix checks
patrick-stephens Dec 17, 2024
86295d4
tests: runtime_shell: custom_calyptia: fix checks
patrick-stephens Dec 17, 2024
3b99604
tests: runtime_shell: custom_calyptia: use dummy input
patrick-stephens Dec 18, 2024
17203f0
tests: runtime_shell: custom_calyptia: use random input
patrick-stephens Dec 18, 2024
7859f9d
utils: Detect machine_id corruption and fill out a dummy value
cosmo0920 Dec 4, 2024
5d0c591
build: Use signed char in RISC-V 64bit (#9524)
cosmo0920 Dec 11, 2024
cb4fda6
update fluentbit_users.png (#9710)
erikbledsoe Dec 11, 2024
4c2427d
docs: update deployment details
edsiper Dec 11, 2024
a67e305
in_forward: Recreate connection when resumed
cosmo0920 Nov 18, 2024
566911d
in_forward: Synchronize the status of pause/resume with mutex
cosmo0920 Nov 19, 2024
2e58b29
in_forward: Remove a needless add event for handling sockets
cosmo0920 Dec 9, 2024
b4a4ffb
in_forward: Synchronize is_paused state and deleting conns
cosmo0920 Dec 12, 2024
f827a56
utf8: enhance handling of multibyte sequences
edsiper Dec 4, 2024
697a167
build: add flb_utf8.c
edsiper Dec 4, 2024
642dadf
utils: use new utf8 decoder API
edsiper Dec 4, 2024
e3d1e9b
tests: internal: utils: adjusts expected utf8 encoded bytes
edsiper Dec 4, 2024
7d6d190
tests: internal: data: pack: generators: fix json encoding ascii utf8
edsiper Dec 5, 2024
e9b642d
utf8: remove lookup table
edsiper Dec 5, 2024
c590271
utils: add utf8 encoding for codepoints beyond BMP
edsiper Dec 5, 2024
291745d
sds: use new utf8 decoder for sds_cat_utf8
edsiper Dec 5, 2024
8173465
tests: internal: sds: adjust unit test for utf8
edsiper Dec 5, 2024
e1ea896
tests: internal: utils: add missing test
edsiper Dec 5, 2024
9a5d89d
sds: utf8: remove dead code
edsiper Dec 12, 2024
11693e0
out_opentelemetry: remove strict check on severityText value
edsiper Dec 14, 2024
cdef7e1
in_opentelemetry: logs: add support for metadata in JSON payload
edsiper Dec 14, 2024
d981737
in_opentelemetry: json logs: process spanID, traceID and observedTime…
edsiper Dec 14, 2024
4a992b3
out_lib: add new option 'data_mode'
edsiper Dec 16, 2024
9639f90
tests: internal: in_opentelemetry: extend tests for group metadata an…
edsiper Dec 16, 2024
4d84658
cfl_record_accessor: Plug resource leaks (CID 516097)
cosmo0920 Dec 16, 2024
5c91c18
plugin: Detect config format and use a proper loader
cosmo0920 Dec 17, 2024
40610f1
workflows: bump helm/kind-action from 1.10.0 to 1.11.0 (#9736)
dependabot[bot] Dec 17, 2024
6a29c90
lib: c-ares: upgrade to v1.34.4
edsiper Dec 18, 2024
740cfcf
lib: cprofiles: upgrade to v0.1.0
edsiper Dec 18, 2024
8f0a122
build: added include path for the headers cprofiles generates
leonardo-albertovich Dec 18, 2024
8418353
workflows: resolve ubuntu 24 packaging problems (#9751)
patrick-stephens Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/call-build-linux-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
call-build-capture-source:
# Capture source tarball and generate checksum for it
name: Extract any supporting metadata
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
permissions:
contents: read
Expand Down Expand Up @@ -105,8 +105,8 @@ jobs:
call-build-linux-packages:
name: ${{ matrix.distro }} package build and stage to S3
environment: ${{ inputs.environment }}
# Ensure for OSS Fluent Bit repo we enable usage of Actuated runners for ARM builds, for forks it should keep existing ubuntu-latest usage.
runs-on: ${{ (contains(matrix.distro, 'arm' ) && (github.repository == 'fluent/fluent-bit') && 'actuated-arm64-8cpu-16gb') || 'ubuntu-latest' }}
# Ensure for OSS Fluent Bit repo we enable usage of Actuated runners for ARM builds, for forks it should keep existing ubuntu-22.04 usage.
runs-on: ${{ (contains(matrix.distro, 'arm' ) && (github.repository == 'fluent/fluent-bit') && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }}
permissions:
contents: read
strategy:
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
name: Create repo metadata in S3
# Only upload for staging
if: inputs.environment == 'staging'
# Need to use 18.04 as 20.04 has no createrepo available
# Need to use 22.04 as 20.04 has no createrepo available
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
needs:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/call-build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ jobs:
fail-fast: false
matrix:
config:
- name: "Normal macOS-latest runner (Intel)"
runner: macos-12
- name: "Apple Silicon macOS runner"
runner: macos-14

Expand Down Expand Up @@ -121,8 +119,6 @@ jobs:
fail-fast: false
matrix:
config:
- name: "Normal macOS-latest package (Intel)"
os: macos-12
- name: "Apple Silicon macOS package"
os: macos-14

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call-run-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jobs:
bats-version: 1.9.0

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.10.0
uses: helm/kind-action@v1.11.0
with:
node_image: kindest/node:${{ matrix.k8s-release }}
cluster_name: kind
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call-test-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
ref: ${{ inputs.ref }}

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.10.0
uses: helm/kind-action@v1.11.0

- name: Set up Helm
uses: azure/setup-helm@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/staging-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:

staging-release-apt-packages:
name: S3 - update APT packages bucket
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
environment: release
needs:
- staging-release-version-check
Expand Down Expand Up @@ -327,7 +327,7 @@ jobs:

staging-release-source-s3:
name: S3 - update source bucket
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
environment: release
needs:
- staging-release-version-check
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compiler }}
FLB_OPT: ${{ matrix.flb_option }}
CALYPTIA_FLEET_TOKEN: ${{ secrets.CALYPTIA_FLEET_TOKEN }}

run-macos-unit-tests:
# We chain this after Linux one as there are costs and restrictions associated
Expand Down Expand Up @@ -111,6 +112,7 @@ jobs:
CC: gcc
CXX: g++
FLB_OPT: ${{ matrix.flb_option }}
CALYPTIA_FLEET_TOKEN: ${{ secrets.CALYPTIA_FLEET_TOKEN }}

run-aarch64-unit-tests:
# Ensure for OSS Fluent Bit repo we enable usage of Actuated runners for ARM builds, for forks it should keep existing ubuntu-latest usage.
Expand Down Expand Up @@ -167,6 +169,7 @@ jobs:
env:
CC: ${{ matrix.config.compiler }}
CXX: ${{ matrix.config.compiler }}
CALYPTIA_FLEET_TOKEN: ${{ secrets.CALYPTIA_FLEET_TOKEN }}

run-qemu-ubuntu-unit-tests:
# We chain this after Linux one as there are CPU time costs for QEMU emulation
Expand All @@ -179,6 +182,7 @@ jobs:
matrix:
arch:
- s390x
- riscv64
steps:
- name: Checkout Fluent Bit code
uses: actions/checkout@v4
Expand All @@ -188,19 +192,17 @@ jobs:
id: build-and-test-on-qemu
with:
arch: ${{ matrix.arch }}
distro: ubuntu20.04
distro: ubuntu22.04
shell: /bin/bash
dockerRunArgs: |
--volume "/var/lib/dbus/machine-id:/var/lib/dbus/machine-id"
--volume "/etc/machine-id:/etc/machine-id"
install: |
apt-get update
apt-get install -y gcc-7 g++-7 clang-6.0 libyaml-dev cmake flex bison libssl-dev libbpf-dev linux-tools-common#libsystemd-dev
ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true
apt-get install -y gcc-12 g++-12 libyaml-dev cmake flex bison libssl-dev libbpf-dev linux-tools-common

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 90
run: |
cd build
export nparallel=$(( $(getconf _NPROCESSORS_ONLN) > 8 ? 8 : $(getconf _NPROCESSORS_ONLN) ))
Expand All @@ -218,7 +220,6 @@ jobs:
make -j $nparallel
ctest -j $nparallel --build-run-dir . --output-on-failure


# Required check looks at this so do not remove
run-all-unit-tests:
if: always()
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ init/fluent-bit.service
lib/chunkio/include/chunkio/cio_version.h
lib/monkey/monkey.service
lib/monkey/include/monkey/mk_core/mk_core_info.h
lib/cprofiles/include/cprofiles/cprof_info.h

packaging/.env
packaging/packages
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ if (FLB_SYSTEM_LINUX)
include(cmake/s390x.cmake)
endif ()

# Build for Linux - riscv64 arch
if (FLB_SYSTEM_LINUX)
include(cmake/riscv64.cmake)
endif ()

# Enable signed char support on Linux AARCH64 if specified
if (FLB_LINUX_ON_AARCH64)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@

![](documentation/fluentbit_ecosystem.png)

[Fluent Bit](http://fluentbit.io) is a fast Log Processor and Forwarder for Linux, Windows, Embedded Linux, MacOS and BSD family operating systems. It's part of the Graduated [Fluentd](http://fluentd.org) Ecosystem and a [CNCF](https://cncf.io) sub-project.
[Fluent Bit](http://fluentbit.io) is a fast Log, Metrics and Traces Processor and Forwarder for Linux, Windows, Embedded Linux, MacOS and BSD family operating systems. It's part of the Graduated [Fluentd](http://fluentd.org) Ecosystem and a [CNCF](https://cncf.io) sub-project.

Fluent Bit allows to collect log events or metrics from different sources, process them and deliver them to different backends such as [Fluentd](http://fluentd.org), Elasticsearch, Splunk, DataDog, Kafka, New Relic, Azure services, AWS services, Google services, NATS, InfluxDB or any custom HTTP end-point.
Fluent Bit allows to collect different signal types such as logs, metrics and traces from different sources, process them and deliver them to different backends such as [Fluentd](http://fluentd.org), Elasticsearch, Splunk, DataDog, Kafka, New Relic, Azure services, AWS services, Google services, NATS, InfluxDB or any custom HTTP end-point.

Fluent Bit comes with full SQL [Stream Processing](https://docs.fluentbit.io/manual/stream-processing/introduction) capabilities: data manipulation and analytics using SQL queries.

Fluent Bit runs on x86_64, x86, arm32v7, and arm64v8 architectures.



## Features

- High Performance at low CPU and Memory footprint
Expand All @@ -48,7 +46,7 @@ Fluent Bit runs on x86_64, x86, arm32v7, and arm64v8 architectures.

## Fluent Bit in Production

[Fluent Bit](https://fluentbit.io) is used widely in production environments. As of 2022, [Fluent Bit surpasses 3 Billion downloads](https://www.cncf.io/blog/2022/10/13/fluent-bit-surpasses-three-billion-downloads/) and continues to be deployed over **10 million times a day**. The following is a preview of who uses Fluent Bit heavily in production:
Fluent Bit is a widely adopted solution in production environments. As of 2024, Fluent Bit has surpassed 15 billion downloads and continues to be deployed over 10 million times daily. Below is a preview of some of the organizations that rely heavily on Fluent Bit in their production systems:

> If your company uses Fluent Bit and is not listed, feel free to open a GitHub issue and we will add the logo.

Expand Down
1 change: 1 addition & 0 deletions cmake/headers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ include_directories(

${CMAKE_CURRENT_BINARY_DIR}/${FLB_PATH_LIB_JANSSON}/include
${CMAKE_CURRENT_BINARY_DIR}/lib/cmetrics
${CMAKE_CURRENT_BINARY_DIR}/lib/cprofiles/include
${CMAKE_CURRENT_BINARY_DIR}/include

${CMAKE_CURRENT_BINARY_DIR}/lib/monkey/include/
Expand Down
2 changes: 1 addition & 1 deletion cmake/libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(FLB_PATH_LIB_ONIGMO "lib/onigmo")
set(FLB_PATH_LIB_MPACK "lib/mpack-amalgamation-1.1.1")
set(FLB_PATH_LIB_MINIZ "lib/miniz")
set(FLB_PATH_LIB_TUTF8E "lib/tutf8e")
set(FLB_PATH_LIB_CARES "lib/c-ares-1.33.1")
set(FLB_PATH_LIB_CARES "lib/c-ares-1.34.4")
set(FLB_PATH_LIB_SNAPPY "lib/snappy-fef67ac")
set(FLB_PATH_LIB_RDKAFKA "lib/librdkafka-2.4.0")
set(FLB_PATH_LIB_RING_BUFFER "lib/lwrb")
Expand Down
8 changes: 8 additions & 0 deletions cmake/riscv64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv64)")
message(STATUS "Forcing characters to be signed, as on x86_64.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
if(FLB_LUAJIT)
message(WARNING "LuaJIT is disabled, this platform does not support built-in LuaJIT and system provided one neither.")
set(FLB_LUAJIT OFF)
endif()
endif ()
Binary file modified documentation/fluentbit_users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion include/fluent-bit/calyptia/calyptia_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
#define CALYPTIA_ENDPOINT_TRACE "/v1/traces/%s"

#define CALYPTIA_ENDPOINT_FLEETS "/v1/fleets"
#define CALYPTIA_ENDPOINT_FLEET_CONFIG_INI "/v1/fleets/%s/config?format=ini"
#define CALYPTIA_ENDPOINT_FLEET_CONFIG_INI "/v1/fleets/%s/config?format=ini&config_format=ini"
#define CALYPTIA_ENDPOINT_FLEET_CONFIG_YAML "/v1/fleets/%s/config?format=yaml&config_format=yaml"
#define CALYPTIA_ENDPOINT_FLEET_FILES "/v1/fleets/%s/files"
#define CALYPTIA_ENDPOINT_FLEET_BY_NAME "/v1/search?project_id=%s&resource=fleet&term=%s&exact=true"

/* Storage */
#define CALYPTIA_SESSION_FILE "session.CALYPTIA"
Expand Down
82 changes: 7 additions & 75 deletions include/fluent-bit/flb_utf8.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,84 +20,16 @@
#ifndef FLB_UTF8_H
#define FLB_UTF8_H

#define FLB_UTF8_ACCEPT 0
#define FLB_UTF8_REJECT 1
#define FLB_UTF8_CONTINUE 2

#include <fluent-bit/flb_info.h>
#include <inttypes.h>

/* is the start of a UTF-8 string ? */
#define flb_utf8_check(c) (((c) & 0xC0) != 0x80)

static const char trailingBytesForUTF8[256] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
};

/* returns length of next utf-8 sequence */
static inline int flb_utf8_len(const char *s)
{
return trailingBytesForUTF8[(unsigned int)(unsigned char)s[0]] + 1;
}

/*
* UTF-8 Decoding routines are originally written by Bjoern Hoehrmann
* <[email protected]> and taken from the following web site:
*
* http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
*
* They have been siglhy renamed to follow Fluent Bit naming requirements.
*/

#define FLB_UTF8_ACCEPT 0
#define FLB_UTF8_REJECT 1

static const uint8_t utf8d[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 40..5f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 60..7f
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, // 80..9f
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, // a0..bf
8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, // c0..df
0xa,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x4,0x3,0x3, // e0..ef
0xb,0x6,0x6,0x6,0x5,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, // f0..ff
0x0,0x1,0x2,0x3,0x5,0x8,0x7,0x1,0x1,0x1,0x4,0x6,0x1,0x1,0x1,0x1, // s0..s0
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1, // s1..s2
1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1, // s3..s4
1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,1,1,1,1,1, // s5..s6
1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // s7..s8
};

static inline uint32_t flb_utf8_decode(uint32_t *state, uint32_t *codep,
uint32_t byte)
{
uint32_t type = utf8d[byte];

*codep = (*state != FLB_UTF8_ACCEPT) ?
(byte & 0x3fu) | (*codep << 6) :
(0xff >> type) & (byte);

*state = utf8d[256 + *state*16 + type];
return *state;
}


static inline void flb_utf8_print(const uint8_t *s) {
uint32_t codepoint;
uint32_t state = 0;

for (; *s; ++s)
if (!flb_utf8_decode(&state, &codepoint, *s)) {
printf("\\u%04x\n", codepoint);
}

if (state != FLB_UTF8_ACCEPT) {
printf("The string is not well-formed\n");
}
}
int flb_utf8_len(const char *s);
uint32_t flb_utf8_decode(uint32_t *state, uint32_t *codep, uint8_t byte);
void flb_utf8_print(char *input);

#endif
65 changes: 0 additions & 65 deletions lib/c-ares-1.33.1/RELEASE-NOTES.md

This file was deleted.

Loading
Loading