Imported Upstream version 0.9.3
[platform/upstream/libunistring.git] / doc / uniname.texi
1 @node uniname.h
2 @chapter Names of Unicode characters @code{<uniname.h>}
3
4 @cindex Unicode character, name
5 This include file implements the association between a Unicode character and
6 its name.
7
8 The name of a Unicode character allows to distinguish it from other, similar
9 looking characters.  For example, the character @samp{x} has the name
10 @code{"LATIN SMALL LETTER X"} and is therefore different from the character
11 named @code{"MULTIPLICATION SIGN"}.
12
13 @deftypevr Macro {unsigned int} UNINAME_MAX
14 This macro expands to a constant that is the required size of buffer for a
15 Unicode character name.
16 @end deftypevr
17
18 @deftypefun {char *} unicode_character_name (ucs4_t @var{uc}, char *@var{buf})
19 Looks up the name of a Unicode character, in uppercase ASCII.
20 @var{buf} must point to a buffer, at least @code{UNINAME_MAX} bytes in size.
21 Returns the filled @var{buf}, or NULL if the character does not have a name.
22 @end deftypefun
23
24 @deftypefun ucs4_t unicode_name_character (const char *@var{name})
25 Looks up the Unicode character with a given name, in upper- or lowercase
26 ASCII.  Returns the character if found, or @code{UNINAME_INVALID} if not found.
27 @end deftypefun
28
29 @deftypevr Macro ucs4_t UNINAME_INVALID
30 This macro expands to a constant that is a special return value of the
31 @code{unicode_name_character} function.
32 @end deftypevr