*** empty log message ***
[bpt/guile.git] / doc / mltext.texi
CommitLineData
38a93523
NJ
1@node Working with Multilingual Text
2@chapter Working with Multilingual Text
3
4@node Guile Character Properties, Exchanging Text With The Outside World, Multibyte String Functions, Functions for Operating on Multibyte Text
5@section Guile Character Properties
6
7These functions give information about the nature of a given Guile
8character. These are defined for any @code{scm_mb_char_t} value.
9
10@deftypefn {Libguile Function} int scm_mb_isalnum (scm_mb_char_t @var{c})
11Return non-zero iff @var{c} is an alphabetic or numeric character.
12@end deftypefn
13
14@deftypefn {Libguile Function} int scm_mb_is_alpha (scm_mb_char_t @var{c})
15Return non-zero iff @var{c} is an alphabetic character.
16@end deftypefn
17
18@deftypefn {Libguile Function} int scm_mb_iscntrl (scm_mb_char_t @var{c})
19Return non-zero iff @var{c} is a control character.
20@end deftypefn
21
22@deftypefn {Libguile Function} int scm_mb_isdigit (scm_mb_char_t @var{c})
23Return non-zero iff @var{c} is a digit.
24@end deftypefn
25
26@deftypefn {Libguile Function} int scm_mb_isgraph (scm_mb_char_t @var{c})
27Return non-zero iff @var{c} is a visible character.
28@end deftypefn
29
30@deftypefn {Libguile Function} int scm_mb_isupper (scm_mb_char_t @var{c})
31Return non-zero iff @var{c} is an upper-case character.
32@end deftypefn
33
34@deftypefn {Libguile Function} int scm_mb_islower (scm_mb_char_t @var{c})
35Return non-zero iff @var{c} is a lower-case character.
36@end deftypefn
37
38@deftypefn {Libguile Function} int scm_mb_istitle (scm_mb_char_t @var{c})
39Return non-zero iff @var{c} is a title-case character. See the Unicode
40standard for an explanation of title case.
41@end deftypefn
42
43@deftypefn {Libguile Function} int scm_mb_isprint (scm_mb_char_t @var{c})
44Return non-zero iff @var{c} is a printable character.
45@end deftypefn
46
47@deftypefn {Libguile Function} int scm_mb_ispunct (scm_mb_char_t @var{c})
48Return non-zero iff @var{c} is a punctuation character.
49@end deftypefn
50
51@deftypefn {Libguile Function} int scm_mb_isspace (scm_mb_char_t @var{c})
52Return non-zero iff @var{c} is a whitespace character.
53@end deftypefn
54
55@deftypefn {Libguile Function} int scm_mb_isxdigit (scm_mb_char_t @var{c})
b45898ca 56Return non-zero iff @var{c} is a hexadecimal digit.
38a93523
NJ
57@end deftypefn
58
59@deftypefn {Libguile Function} int scm_mb_isdefined (scm_mb_char_t @var{c})
60Return non-zero iff @var{c} is a valid character.
61@end deftypefn
62
63@deftypefn {Libguile Function} scm_mb_char_t scm_mb_char_toupper (scm_mb_char_t @var{c})
64@deftypefnx {Libguile Function} scm_mb_char_t scm_mb_char_tolower (scm_mb_char_t @var{c})
65@deftypefnx {Libguile Function} scm_mb_char_t scm_mb_char_totitle (scm_mb_char_t @var{c})
66Convert @var{c} to upper, lower, or title case. If @var{c} has no
67equivalent in the requested case, or is already in that case, return it
68unchanged.
69@end deftypefn
70
71@deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c})
b45898ca 72If @var{c} is a hexadecimal digit (according to
38a93523
NJ
73@code{scm_mb_isxdigit}), then return its numeric value. Otherwise
74return -1.
75@end deftypefn
76
77@deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c})
78If @var{c} is a digit (according to @code{scm_mb_isdigit}), then
79return its numeric value. Otherwise return -1.
80@end deftypefn
81
82
83@node Multibyte Character Tables, Multibyte Character Categories, Exchanging Text With The Outside World, Functions for Operating on Multibyte Text
84@section Multibyte Character Tables
85
86A @dfn{character table} is a table mapping @code{scm_mb_char_t} values
87onto Guile objects. Guile provides functions for creating character
88tables, setting entries, and looking up characters. Character tables
89are Guile objects, so they are managed by Guile's garbage collector.
90
91A character table can have a ``parent'' table, from which it inherits
92values for characters. If a character table @var{child}, with a parent
93table @var{parent} maps some character @var{c} to the value
94@code{SCM_UNDEFINED}, then @code{scm_c_char_table_ref (@var{child},
95@var{c})} will look up @var{c} in @var{parent}, and return the value it
96finds there.
97
98This section describes only the C API for working with character tables.
99For the Scheme-level API, see @ref{some other section}.
100
101@deftypefn {Libguile Function} scm_make_char_table (SCM @var{init}, SCM @var{parent})
102Return a new character table object which maps every character to
103@var{init}. If @var{parent} is a character table, then @var{parent} is
104the new table's parent. If @var{parent} table is @code{SCM_UNDEFINED},
105then the new table has no parent. Otherwise, signal a type error.
106@end deffn
107
108@deftypefn {Libguile Function} SCM scm_c_char_table_ref (SCM @var{table}, scm_mb_char_t @var{c})
109Look up the character @var{c} in the character table @var{table}, and
110return the value found there. If @var{table} maps @var{c} to
111@code{SCM_UNDEFINED}, and @var{table} has a parent, then look up @var{c}
112in the parent.
113
114If @var{table} is not a character table, signal an error.
115@end deftypefn
116
117@deftypefn {Libguile Function} SCM scm_c_char_table_set_x (SCM @var{table}, scm_mb_char_t @var{c}, SCM @var{value})
118Set @var{table}'s value for the character @var{c} to @var{value}.
119If @var{value} is @code{SCM_UNDEFINED}, then @var{table}'s parent's
120value will show through for @var{c}.
121
122If @var{table} is not a character table, signal an error.
123
124This function changes only @var{table} itself, never @var{table}'s
125parent.
126@end deftypefn
127
128[[this is all wrong. what about default values?]]
129
130
131
132
133
134@node Multibyte Character Categories, , Multibyte Character Tables, Functions for Operating on Multibyte Text
135@section Multibyte Character Categories
136
137[[This will describe an ADT representing subsets of the Guile character
138set.]]
139
140
141
142
143@node Exchanging Guile Text With the Outside World
144@subsection Exchanging Guile Text With the Outside World
145
146[[Scheme-level functions for converting between encodings]]