groff: update vendor branch to v1.20.1
[dragonfly.git] / contrib / groff / src / include / unicode.h
CommitLineData
92d0a6a6 1// -*- C++ -*-
4d3e9548 2/* Copyright (C) 2002, 2003, 2006, 2009
92d0a6a6
JR
3 Free Software Foundation, Inc.
4 Written by Werner Lemberg <wl@gnu.org>
5
6This file is part of groff.
7
8groff is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
4d3e9548
JL
10Software Foundation, either version 3 of the License, or
11(at your option) any later version.
92d0a6a6
JR
12
13groff is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
4d3e9548
JL
18You should have received a copy of the GNU General Public License
19along with this program. If not, see <http://www.gnu.org/licenses/>. */
92d0a6a6 20
4d3e9548
JL
21// Convert a groff glyph name to a string containing an underscore-separated
22// list of Unicode code points. For example,
23//
24// `-' -> `2010'
25// `,c' -> `00E7'
26// `fl' -> `0066_006C'
27//
28// Return NULL if there is no equivalent.
92d0a6a6 29const char *glyph_name_to_unicode(const char *);
4d3e9548
JL
30
31// Convert a string containing an underscore-separated list of Unicode code
32// points to a groff glyph name. For example,
33//
34// `2010' -> `hy'
35// `0066_006C' -> `fl'
36//
37// Return NULL if there is no equivalent.
92d0a6a6 38const char *unicode_to_glyph_name(const char *);
4d3e9548
JL
39
40// Convert a string containing a precomposed Unicode character to a string
41// containing an underscore-separated list of Unicode code points,
42// representing its canonical decomposition. Also perform compatibility
43// equivalent replacement. For example,
44//
45// `1F3A' -> `0399_0313_0300'
46// `FA6A' -> `983B'
47//
48// Return NULL if there is no equivalent.
92d0a6a6
JR
49const char *decompose_unicode(const char *);
50
4d3e9548
JL
51// Test whether the given string denotes a Unicode character. It must
52// be of the form `uNNNN', obeying the following rules.
53//
54// - `NNNN' must consist of at least 4 hexadecimal digits in upper case.
55// - If there are more than 4 hexadecimal digits, the leading one must not
56// be zero,
57// - `NNNN' must denote a valid Unicode code point (U+0000..U+10FFFF,
58// excluding surrogate code points.
59//
60// Return a pointer to `NNNN' (skipping the leading `u' character) in case
61// of success, NULL otherwise.
92d0a6a6 62const char *check_unicode_name(const char *);
4d3e9548
JL
63
64// end of unicode.h