diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-11-29 11:31:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-11-29 11:31:35 +0000 |
commit | b39a9f52ed3f33082f13f51678d053ee80a2e1f4 (patch) | |
tree | 2144a18d85681df09f83e255f2e5c6d04e61e878 /src/libutil/rspamd_simdutf.h | |
parent | 6c0223b32b8fcb6621fa64197214abb400a09f52 (diff) | |
download | rspamd-b39a9f52ed3f33082f13f51678d053ee80a2e1f4.tar.gz rspamd-b39a9f52ed3f33082f13f51678d053ee80a2e1f4.zip |
[Rework] Replace fastutf with simdutf
Simdutf is faster and has way better support of the architectures (especially
when it comes to non-x86 stuff). Hence, it is a good idea to use it instead
of the non-supported fastutf8 stuff.
Diffstat (limited to 'src/libutil/rspamd_simdutf.h')
-rw-r--r-- | src/libutil/rspamd_simdutf.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/libutil/rspamd_simdutf.h b/src/libutil/rspamd_simdutf.h new file mode 100644 index 000000000..c1fa07892 --- /dev/null +++ b/src/libutil/rspamd_simdutf.h @@ -0,0 +1,34 @@ +/* + * Copyright 2024 Vsevolod Stakhov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef RSPAMD_RSPAMD_SIMDUTF_H +#define RSPAMD_RSPAMD_SIMDUTF_H + +#pragma once +#include "config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void rspamd_fast_utf8_library_init(unsigned flags); +off_t rspamd_fast_utf8_validate(const unsigned char *data, size_t len); + +#ifdef __cplusplus +} +#endif + +#endif//RSPAMD_RSPAMD_SIMDUTF_H |