man/l_roff-char.7.in: fix Bernd Warken (Dave Kemper, Werner Lemberg)..
[s-roff.git] / include / unicode.h
blob6de302a587ca7bada69467d2f47c54145e5adf7c
1 /*@
2 * Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 * Copyright (C) 2002, 2003, 2006
5 * Free Software Foundation, Inc.
6 * Written by Werner Lemberg <wl@gnu.org>
8 * This is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2, or (at your option) any later
11 * version.
13 * This is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with groff; see the file COPYING. If not, write to the Free Software
20 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef _UNICODE_H
23 #define _UNICODE_H
25 #include "config.h"
27 // Convert a groff glyph name to a string containing an underscore-separated
28 // list of Unicode code points. For example,
30 // `-' -> `2010'
31 // `,c' -> `00E7'
32 // `fl' -> `0066_006C'
34 // Return NULL if there is no equivalent.
35 const char *glyph_name_to_unicode(const char *);
37 // Convert a string containing an underscore-separated list of Unicode code
38 // points to a groff glyph name. For example,
40 // `2010' -> `hy'
41 // `0066_006C' -> `fl'
43 // Return NULL if there is no equivalent.
44 const char *unicode_to_glyph_name(const char *);
46 // Convert a string containing a precomposed Unicode character to a string
47 // containing an underscore-separated list of Unicode code points,
48 // representing its canonical decomposition. Also perform compatibility
49 // equivalent replacement. For example,
51 // `1F3A' -> `0399_0313_0300'
52 // `FA6A' -> `983B'
54 // Return NULL if there is no equivalent.
55 const char *decompose_unicode(const char *);
57 // Test whether the given string denotes a Unicode character. It must
58 // be of the form `uNNNN', obeying the following rules.
60 // - `NNNN' must consist of at least 4 hexadecimal digits in upper case.
61 // - If there are more than 4 hexadecimal digits, the leading one must not
62 // be zero,
63 // - `NNNN' must denote a valid Unicode code point (U+0000..U+10FFFF,
64 // excluding surrogate code points.
66 // Return a pointer to `NNNN' (skipping the leading `u' character) in case
67 // of success, NULL otherwise.
68 const char *check_unicode_name(const char *);
70 #endif // _UNICODE_H
71 // s-it2-mode