/src/openssl/include/internal/unicode.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | #ifndef OSSL_INTERNAL_UNICODE_H |
11 | | #define OSSL_INTERNAL_UNICODE_H |
12 | | #pragma once |
13 | | |
14 | | #include <openssl/e_os2.h> |
15 | | #include <stdint.h> |
16 | | |
17 | | typedef enum { |
18 | | SURROGATE_MIN = UINT32_C(0xd800), |
19 | | SURROGATE_MAX = UINT32_C(0xdfff), |
20 | | UNICODE_MAX = UINT32_C(0x10ffff), |
21 | | UNICODE_LIMIT |
22 | | } UNICODE_CONSTANTS; |
23 | | |
24 | | static ossl_unused ossl_inline int is_unicode_surrogate(unsigned long value) |
25 | 0 | { |
26 | 0 | return value >= SURROGATE_MIN && value <= SURROGATE_MAX; |
27 | 0 | } Unexecuted instantiation: a_strex.c:is_unicode_surrogate Unexecuted instantiation: a_utf8.c:is_unicode_surrogate Unexecuted instantiation: a_mbstr.c:is_unicode_surrogate |
28 | | |
29 | | static ossl_unused ossl_inline int is_unicode_valid(unsigned long value) |
30 | 0 | { |
31 | 0 | return value <= UNICODE_MAX && !is_unicode_surrogate(value); |
32 | 0 | } Unexecuted instantiation: a_strex.c:is_unicode_valid Unexecuted instantiation: a_utf8.c:is_unicode_valid Unexecuted instantiation: a_mbstr.c:is_unicode_valid |
33 | | |
34 | | #endif |