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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
@node Working with Multilingual Text
@chapter Working with Multilingual Text
@node Guile Character Properties, Exchanging Text With The Outside World, Multibyte String Functions, Functions for Operating on Multibyte Text
@section Guile Character Properties
These functions give information about the nature of a given Guile
character. These are defined for any @code{scm_mb_char_t} value.
@deftypefn {Libguile Function} int scm_mb_isalnum (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is an alphabetic or numeric character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_is_alpha (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is an alphabetic character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_iscntrl (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a control character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_isdigit (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a digit.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_isgraph (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a visible character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_isupper (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is an upper-case character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_islower (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a lower-case character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_istitle (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a title-case character. See the Unicode
standard for an explanation of title case.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_isprint (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a printable character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_ispunct (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a punctuation character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_isspace (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a whitespace character.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_isxdigit (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a hexadecimal digit.
@end deftypefn
@deftypefn {Libguile Function} int scm_mb_isdefined (scm_mb_char_t @var{c})
Return non-zero iff @var{c} is a valid character.
@end deftypefn
@deftypefn {Libguile Function} scm_mb_char_t scm_mb_char_toupper (scm_mb_char_t @var{c})
@deftypefnx {Libguile Function} scm_mb_char_t scm_mb_char_tolower (scm_mb_char_t @var{c})
@deftypefnx {Libguile Function} scm_mb_char_t scm_mb_char_totitle (scm_mb_char_t @var{c})
Convert @var{c} to upper, lower, or title case. If @var{c} has no
equivalent in the requested case, or is already in that case, return it
unchanged.
@end deftypefn
@deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c})
If @var{c} is a hexadecimal digit (according to
@code{scm_mb_isxdigit}), then return its numeric value. Otherwise
return -1.
@end deftypefn
@deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c})
If @var{c} is a digit (according to @code{scm_mb_isdigit}), then
return its numeric value. Otherwise return -1.
@end deftypefn
@node Multibyte Character Tables, Multibyte Character Categories, Exchanging Text With The Outside World, Functions for Operating on Multibyte Text
@section Multibyte Character Tables
A @dfn{character table} is a table mapping @code{scm_mb_char_t} values
onto Guile objects. Guile provides functions for creating character
tables, setting entries, and looking up characters. Character tables
are Guile objects, so they are managed by Guile's garbage collector.
A character table can have a ``parent'' table, from which it inherits
values for characters. If a character table @var{child}, with a parent
table @var{parent} maps some character @var{c} to the value
@code{SCM_UNDEFINED}, then @code{scm_c_char_table_ref (@var{child},
@var{c})} will look up @var{c} in @var{parent}, and return the value it
finds there.
This section describes only the C API for working with character tables.
For the Scheme-level API, see @ref{some other section}.
@deftypefn {Libguile Function} scm_make_char_table (SCM @var{init}, SCM @var{parent})
Return a new character table object which maps every character to
@var{init}. If @var{parent} is a character table, then @var{parent} is
the new table's parent. If @var{parent} table is @code{SCM_UNDEFINED},
then the new table has no parent. Otherwise, signal a type error.
@end deffn
@deftypefn {Libguile Function} SCM scm_c_char_table_ref (SCM @var{table}, scm_mb_char_t @var{c})
Look up the character @var{c} in the character table @var{table}, and
return the value found there. If @var{table} maps @var{c} to
@code{SCM_UNDEFINED}, and @var{table} has a parent, then look up @var{c}
in the parent.
If @var{table} is not a character table, signal an error.
@end deftypefn
@deftypefn {Libguile Function} SCM scm_c_char_table_set_x (SCM @var{table}, scm_mb_char_t @var{c}, SCM @var{value})
Set @var{table}'s value for the character @var{c} to @var{value}.
If @var{value} is @code{SCM_UNDEFINED}, then @var{table}'s parent's
value will show through for @var{c}.
If @var{table} is not a character table, signal an error.
This function changes only @var{table} itself, never @var{table}'s
parent.
@end deftypefn
[[this is all wrong. what about default values?]]
@node Multibyte Character Categories, , Multibyte Character Tables, Functions for Operating on Multibyte Text
@section Multibyte Character Categories
[[This will describe an ADT representing subsets of the Guile character
set.]]
@node Exchanging Guile Text With the Outside World
@subsection Exchanging Guile Text With the Outside World
[[Scheme-level functions for converting between encodings]]
|