Next: The bit mask API for general category, Up: General category [Contents][Index]
This data type denotes a general category value. It is an immediate type that can be copied by simple assignment, without involving memory allocation. It is not an array type.
The following are the predefined general category value. Additional general categories may be added in the future.
The UC_CATEGORY_* constants reflect the systematic general category
values assigned by the Unicode Consortium. Whereas the other UC_*
macros are aliases, for use when readable code is preferred.
uc_general_category_t UC_CATEGORY_L ¶ uc_general_category_t UC_LETTER ¶ This represents the general category “Letter”.
uc_general_category_t UC_CATEGORY_Lu ¶ uc_general_category_t UC_UPPERCASE_LETTER ¶ This represents the general category “Letter, uppercase”.
uc_general_category_t UC_CATEGORY_Ll ¶ uc_general_category_t UC_LOWERCASE_LETTER ¶ This represents the general category “Letter, lowercase”.
uc_general_category_t UC_CATEGORY_Lt ¶ uc_general_category_t UC_TITLECASE_LETTER ¶ This represents the general category “Letter, titlecase”.
uc_general_category_t UC_CATEGORY_Lm ¶ uc_general_category_t UC_MODIFIER_LETTER ¶ This represents the general category “Letter, modifier”.
uc_general_category_t UC_CATEGORY_Lo ¶ uc_general_category_t UC_OTHER_LETTER ¶ This represents the general category “Letter, other”.
uc_general_category_t UC_CATEGORY_M ¶ uc_general_category_t UC_MARK ¶ This represents the general category “Marker”.
uc_general_category_t UC_CATEGORY_Mn ¶ uc_general_category_t UC_NON_SPACING_MARK ¶ This represents the general category “Marker, nonspacing”.
uc_general_category_t UC_CATEGORY_Mc ¶ uc_general_category_t UC_COMBINING_SPACING_MARK ¶ This represents the general category “Marker, spacing combining”.
uc_general_category_t UC_CATEGORY_Me ¶ uc_general_category_t UC_ENCLOSING_MARK ¶ This represents the general category “Marker, enclosing”.
uc_general_category_t UC_CATEGORY_N ¶ uc_general_category_t UC_NUMBER ¶ This represents the general category “Number”.
uc_general_category_t UC_CATEGORY_Nd ¶ uc_general_category_t UC_DECIMAL_DIGIT_NUMBER ¶ This represents the general category “Number, decimal digit”.
uc_general_category_t UC_CATEGORY_Nl ¶ uc_general_category_t UC_LETTER_NUMBER ¶ This represents the general category “Number, letter”.
uc_general_category_t UC_CATEGORY_No ¶ uc_general_category_t UC_OTHER_NUMBER ¶ This represents the general category “Number, other”.
uc_general_category_t UC_CATEGORY_P ¶ uc_general_category_t UC_PUNCTUATION ¶ This represents the general category “Punctuation”.
uc_general_category_t UC_CATEGORY_Pc ¶ uc_general_category_t UC_CONNECTOR_PUNCTUATION ¶ This represents the general category “Punctuation, connector”.
uc_general_category_t UC_CATEGORY_Pd ¶ uc_general_category_t UC_DASH_PUNCTUATION ¶ This represents the general category “Punctuation, dash”.
uc_general_category_t UC_CATEGORY_Ps ¶ uc_general_category_t UC_OPEN_PUNCTUATION ¶ This represents the general category “Punctuation, open”, a.k.a. “start punctuation”.
uc_general_category_t UC_CATEGORY_Pe ¶ uc_general_category_t UC_CLOSE_PUNCTUATION ¶ This represents the general category “Punctuation, close”, a.k.a. “end punctuation”.
uc_general_category_t UC_CATEGORY_Pi ¶ uc_general_category_t UC_INITIAL_QUOTE_PUNCTUATION ¶ This represents the general category “Punctuation, initial quote”.
uc_general_category_t UC_CATEGORY_Pf ¶ uc_general_category_t UC_FINAL_QUOTE_PUNCTUATION ¶ This represents the general category “Punctuation, final quote”.
uc_general_category_t UC_CATEGORY_Po ¶ uc_general_category_t UC_OTHER_PUNCTUATION ¶ This represents the general category “Punctuation, other”.
uc_general_category_t UC_CATEGORY_S ¶ uc_general_category_t UC_SYMBOL ¶ This represents the general category “Symbol”.
uc_general_category_t UC_CATEGORY_Sm ¶ uc_general_category_t UC_MATH_SYMBOL ¶ This represents the general category “Symbol, math”.
uc_general_category_t UC_CATEGORY_Sc ¶ uc_general_category_t UC_CURRENCY_SYMBOL ¶ This represents the general category “Symbol, currency”.
uc_general_category_t UC_CATEGORY_Sk ¶ uc_general_category_t UC_MODIFIER_SYMBOL ¶ This represents the general category “Symbol, modifier”.
uc_general_category_t UC_CATEGORY_So ¶ uc_general_category_t UC_OTHER_SYMBOL ¶ This represents the general category “Symbol, other”.
uc_general_category_t UC_CATEGORY_Z ¶ uc_general_category_t UC_SEPARATOR ¶ This represents the general category “Separator”.
uc_general_category_t UC_CATEGORY_Zs ¶ uc_general_category_t UC_SPACE_SEPARATOR ¶ This represents the general category “Separator, space”.
uc_general_category_t UC_CATEGORY_Zl ¶ uc_general_category_t UC_LINE_SEPARATOR ¶ This represents the general category “Separator, line”.
uc_general_category_t UC_CATEGORY_Zp ¶ uc_general_category_t UC_PARAGRAPH_SEPARATOR ¶ This represents the general category “Separator, paragraph”.
uc_general_category_t UC_CATEGORY_C ¶ uc_general_category_t UC_OTHER ¶ This represents the general category “Other”.
uc_general_category_t UC_CATEGORY_Cc ¶ uc_general_category_t UC_CONTROL ¶ This represents the general category “Other, control”.
uc_general_category_t UC_CATEGORY_Cf ¶ uc_general_category_t UC_FORMAT ¶ This represents the general category “Other, format”.
uc_general_category_t UC_CATEGORY_Cs ¶ uc_general_category_t UC_SURROGATE ¶ This represents the general category “Other, surrogate”. All code points in this category are invalid characters.
uc_general_category_t UC_CATEGORY_Co ¶ uc_general_category_t UC_PRIVATE_USE ¶ This represents the general category “Other, private use”.
uc_general_category_t UC_CATEGORY_Cn ¶ uc_general_category_t UC_UNASSIGNED ¶ This represents the general category “Other, not assigned”. Some code points in this category are invalid characters.
The following functions combine general categories, like in a boolean algebra, except that there is no ‘not’ operation.
uc_general_category_t uc_general_category_or (uc_general_category_t category1, uc_general_category_t category2) ¶ Returns the union of two general categories. This corresponds to the unions of the two sets of characters.
uc_general_category_t uc_general_category_and (uc_general_category_t category1, uc_general_category_t category2) ¶ Returns the intersection of two general categories as bit masks. This does not correspond to the intersection of the two sets of characters.
uc_general_category_t uc_general_category_and_not (uc_general_category_t category1, uc_general_category_t category2) ¶ Returns the intersection of a general category with the complement of a second general category, as bit masks. This does not correspond to the intersection with complement, when viewing the categories as sets of characters.
The following functions associate general categories with their name.
const char * uc_general_category_name (uc_general_category_t category) ¶ Returns the name of a general category, more precisely, the abbreviated name. Returns NULL if the general category corresponds to a bit mask that does not have a name.
const char * uc_general_category_long_name (uc_general_category_t category) ¶ Returns the long name of a general category. Returns NULL if the general category corresponds to a bit mask that does not have a name.
uc_general_category_t uc_general_category_byname (const char *category_name) ¶ Returns the general category given by name, e.g. "Lu", or by long
name, e.g. "Uppercase Letter".
This lookup ignores spaces, underscores, or hyphens as word separators and is
case-insignificant.
The following functions view general categories as sets of Unicode characters.
uc_general_category_t uc_general_category (ucs4_t uc) ¶ Returns the general category of a Unicode character.
This function uses a big table.
bool uc_is_general_category (ucs4_t uc, uc_general_category_t category) ¶ Tests whether a Unicode character belongs to a given category. The category argument can be a predefined general category or the combination of several predefined general categories.
Next: The bit mask API for general category, Up: General category [Contents][Index]