text-2.1.1: An efficient packed Unicode text type.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Text.Internal.Validate.Simd

Description

Validate that a byte sequence is UTF-8-encoded text. All of these functions return zero when the byte sequence is not UTF-8-encoded text, and they return an unspecified non-zero value when the byte sequence is UTF-8-encoded text.

Variants are provided for both ByteArray# and Ptr. Additionally, variants are provided that use both the safe and unsafe FFI.

If compiling with SIMDUTF turned off, this module exports nothing.

Documentation

c_is_valid_utf8_ptr_unsafe Source #

Arguments

:: Ptr Word8

Bytes

-> CSize

Length

-> IO CInt 

c_is_valid_utf8_ptr_safe Source #

Arguments

:: Ptr Word8

Bytes

-> CSize

Length

-> IO CInt 

c_is_valid_utf8_bytearray_unsafe Source #

Arguments

:: ByteArray#

Bytes

-> CSize

Offset into bytes

-> CSize

Length

-> IO CInt 

c_is_valid_utf8_bytearray_safe Source #

Arguments

:: ByteArray#

Bytes

-> CSize

Offset into bytes

-> CSize

Length

-> IO CInt