PostgreSQL Source Code: src/include/utils/ascii.h File Reference (original) (raw)
Go to the source code of this file.
◆ ascii_safe_strlcpy()
void ascii_safe_strlcpy | ( | char * | dest, |
---|---|---|---|
const char * | src, | ||
size_t | destsiz | ||
) |
◆ is_valid_ascii()
static bool is_valid_ascii ( const unsigned char * s, int len ) | inlinestatic |
---|
Definition at line 25 of file ascii.h.
26{
27 const unsigned char *const s_end = s + len;
30#ifdef USE_NO_SIMD
32#endif
33
35
36 while (s < s_end)
37 {
39
40
41#ifdef USE_NO_SIMD
42
43
44
45
46
47
48
49
50
51
52
53
55#else
56
57
58
59
60
63#endif
64
65
66 highbit_cum = vector8_or(highbit_cum, chunk);
67
68 s += sizeof(chunk);
69 }
70
71
73 return false;
74
75#ifdef USE_NO_SIMD
76
78 return false;
79#endif
80
81 return true;
82}
Assert(PointerIsAligned(start, uint64))
static Vector8 vector8_broadcast(const uint8 c)
static void vector8_load(Vector8 *v, const uint8 *s)
static Vector8 vector8_or(const Vector8 v1, const Vector8 v2)
static bool vector8_is_highbit_set(const Vector8 v)
References Assert(), len, vector8_broadcast(), vector8_is_highbit_set(), vector8_load(), and vector8_or().
Referenced by pg_utf8_verifystr().