• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

12.4.4.4 Wide-character versions
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • The Foreign Include File
          • Analysing Terms via the Foreign Interface
            • Wide-character versions
              • PL_new_atom_wchars()
              • PL_atom_wchars()
              • PL_get_wchars()
              • PL_put_wchars()
              • PL_unify_wchars()
              • PL_unify_wchars_diff()
              • PL_wcwidth()
              • PL_is_id_start()
              • PL_is_id_continue()
              • PL_is_uppercase()
              • PL_is_decimal()
              • PL_is_layout()
              • PL_ctype_flags()
              • PL_toupper()
              • PL_tolower()
              • PL_totitle()
    • Packages
Availability:C-language interface function
unsigned int PL_ctype_flags(int chr)
Returns the POSIX character classes of the 32-bit code point chr as the bitwise or of the constants below, e.g.
if ( PL_ctype_flags(c) & PL_CTYPE_ALPHA )
  ...

PL_CTYPE_ALNUM PL_CTYPE_ALPHA or a numeric character
PL_CTYPE_ALPHA Unicode Alphabetic
PL_CTYPE_CNTRL general category Cc or Cf
PL_CTYPE_DIGIT 0 ...9, as POSIX demands
PL_CTYPE_GRAPH printable and not white space
PL_CTYPE_LOWER Unicode Lowercase
PL_CTYPE_PRINT PL_CTYPE_GRAPH or white space
PL_CTYPE_PUNCT printable, neither alnum nor space
PL_CTYPE_SPACE Unicode White_Space
PL_CTYPE_UPPER Unicode Uppercase

This is the classifier behind code_type/2 and char_type/2 and a locale-independent replacement for the <wctype.h> functions iswalpha(), iswspace(), ... Besides not varying with LC_CTYPE, it does not vary between C libraries (glibc and Darwin disagree on whether U+00A0 and U+0085 are white space, for example) and it answers for the full Unicode range also on Windows, where wint_t is 16 bits and the <wctype.h> functions silently fail for non-BMP code points.

ClioPatria (version V3.1.1-59-g7b9a7a3)