Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*-------------------------------------------------------------------------
 *
 * unicode_category.h
 *    Routines for determining the category of Unicode characters.
 *
 * These definitions can be used by both frontend and backend code.
 *
 * Copyright (c) 2017-2026, PostgreSQL Global Development Group
 *
 * src/include/common/unicode_category.h
 *
 *-------------------------------------------------------------------------
 */
#ifndef UNICODE_CATEGORY_H
#define UNICODE_CATEGORY_H
 
/*
 * Unicode General Category Values
 *
 * See: https://www.unicode.org/reports/tr44/#General_Category_Values
 *
 * The Unicode stability policy guarantees: "The enumeration of
 * General_Category property values is fixed. No new values will be
 * added". See: https://www.unicode.org/policies/stability_policy.html
 *
 * Numeric values chosen to match corresponding ICU UCharCategory.
 */
typedef enum pg_unicode_category
{
    PG_U_UNASSIGNED = 0,        /* Cn */
    PG_U_UPPERCASE_LETTER = 1,  /* Lu */
    PG_U_LOWERCASE_LETTER = 2,  /* Ll */
    PG_U_TITLECASE_LETTER = 3,  /* Lt */
    PG_U_MODIFIER_LETTER = 4,   /* Lm */
    PG_U_OTHER_LETTER = 5,      /* Lo */
    PG_U_NONSPACING_MARK = 6,   /* Mn */
    PG_U_ENCLOSING_MARK = 7,    /* Me */
    PG_U_SPACING_MARK = 8,      /* Mc */
    PG_U_DECIMAL_NUMBER = 9,    /* Nd */
    PG_U_LETTER_NUMBER = 10,    /* Nl */
    PG_U_OTHER_NUMBER = 11,     /* No */
    PG_U_SPACE_SEPARATOR = 12,  /* Zs */
    PG_U_LINE_SEPARATOR = 13,   /* Zl */
    PG_U_PARAGRAPH_SEPARATOR = 14,  /* Zp */
    PG_U_CONTROL = 15,          /* Cc */
    PG_U_FORMAT = 16,           /* Cf */
    PG_U_PRIVATE_USE = 17,      /* Co */
    PG_U_SURROGATE = 18,        /* Cs */
    PG_U_DASH_PUNCTUATION = 19, /* Pd */
    PG_U_OPEN_PUNCTUATION = 20, /* Ps */
    PG_U_CLOSE_PUNCTUATION = 21,    /* Pe */
    PG_U_CONNECTOR_PUNCTUATION = 22,    /* Pc */
    PG_U_OTHER_PUNCTUATION = 23,    /* Po */
    PG_U_MATH_SYMBOL = 24,      /* Sm */
    PG_U_CURRENCY_SYMBOL = 25,  /* Sc */
    PG_U_MODIFIER_SYMBOL = 26,  /* Sk */
    PG_U_OTHER_SYMBOL = 27,     /* So */
    PG_U_INITIAL_PUNCTUATION = 28,  /* Pi */
    PG_U_FINAL_PUNCTUATION = 29 /* Pf */
} pg_unicode_category;
 
extern pg_unicode_category unicode_category(char32_t code);
extern const char *unicode_category_string(pg_unicode_category category);
extern const char *unicode_category_abbrev(pg_unicode_category category);
 
extern bool pg_u_prop_alphabetic(char32_t code);
extern bool pg_u_prop_lowercase(char32_t code);
extern bool pg_u_prop_uppercase(char32_t code);
extern bool pg_u_prop_cased(char32_t code);
extern bool pg_u_prop_case_ignorable(char32_t code);
extern bool pg_u_prop_white_space(char32_t code);
extern bool pg_u_prop_hex_digit(char32_t code);
extern bool pg_u_prop_join_control(char32_t code);
 
extern bool pg_u_isdigit(char32_t code, bool posix);
extern bool pg_u_isalpha(char32_t code);
extern bool pg_u_isalnum(char32_t code, bool posix);
extern bool pg_u_isword(char32_t code);
extern bool pg_u_isupper(char32_t code);
extern bool pg_u_islower(char32_t code);
extern bool pg_u_isblank(char32_t code);
extern bool pg_u_iscntrl(char32_t code);
extern bool pg_u_isgraph(char32_t code);
extern bool pg_u_isprint(char32_t code);
extern bool pg_u_ispunct(char32_t code, bool posix);
extern bool pg_u_isspace(char32_t code);
extern bool pg_u_isxdigit(char32_t code, bool posix);
 
#endif                          /* UNICODE_CATEGORY_H */