Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* winduni.h -- header file for unicode support for windres program. |
4a594fce NC |
2 | Copyright 1997, 1998, 2002, 2007 |
3 | Free Software Foundation, Inc. | |
252b5132 | 4 | Written by Ian Lance Taylor, Cygnus Support. |
4a594fce | 5 | Rewritten by Kai Tietz, Onevision. |
252b5132 RH |
6 | |
7 | This file is part of GNU Binutils. | |
8 | ||
9 | This program is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
11 | the Free Software Foundation; either version 2 of the License, or | |
12 | (at your option) any later version. | |
13 | ||
14 | This program is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License | |
20 | along with this program; if not, write to the Free Software | |
b43b5d5f NC |
21 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA |
22 | 02110-1301, USA. */ | |
252b5132 | 23 | |
e9792343 | 24 | #include "ansidecl.h" |
252b5132 | 25 | |
4a594fce NC |
26 | #ifndef WINDUNI_H |
27 | #define WINDUNI_H | |
28 | ||
252b5132 RH |
29 | /* This header file declares the types and functions we use for |
30 | unicode support in windres. Our unicode support is very limited at | |
31 | present. | |
32 | ||
33 | We don't put this stuff in windres.h so that winduni.c doesn't have | |
34 | to include windres.h. winduni.c needs to includes windows.h, and | |
35 | that would conflict with the definitions of Windows macros we | |
36 | already have in windres.h. */ | |
37 | ||
4a594fce NC |
38 | /* Use bfd_size_type to ensure a sufficient number of bits. */ |
39 | #ifndef DEFINED_RC_UINT_TYPE | |
40 | #define DEFINED_RC_UINT_TYPE | |
41 | typedef bfd_size_type rc_uint_type; | |
42 | #endif | |
43 | ||
252b5132 RH |
44 | /* We use this type to hold a unicode character. */ |
45 | ||
46 | typedef unsigned short unichar; | |
47 | ||
48 | /* Escape character translations. */ | |
49 | ||
4a594fce NC |
50 | #define ESCAPE_A 007 |
51 | #define ESCAPE_B 010 | |
52 | #define ESCAPE_F 014 | |
53 | #define ESCAPE_N 012 | |
54 | #define ESCAPE_R 015 | |
55 | #define ESCAPE_T 011 | |
56 | #define ESCAPE_V 013 | |
252b5132 RH |
57 | |
58 | /* Convert an ASCII string to a unicode string. */ | |
59 | ||
4a594fce NC |
60 | extern void unicode_from_ascii (rc_uint_type *, unichar **, const char *); |
61 | ||
62 | /* Convert an unicode string to an ASCII string. */ | |
63 | extern void ascii_from_unicode (rc_uint_type *, const unichar *, char **); | |
64 | ||
65 | /* Duplicate a unicode string by using res_alloc. */ | |
66 | extern unichar *unichar_dup (const unichar *); | |
67 | ||
68 | /* Duplicate a unicode string by using res_alloc and make it uppercase. */ | |
69 | extern unichar *unichar_dup_uppercase (const unichar *); | |
70 | ||
71 | /* The count of unichar elements. */ | |
72 | extern rc_uint_type unichar_len (const unichar *); | |
252b5132 RH |
73 | |
74 | /* Print a unicode string to a file. */ | |
4a594fce | 75 | extern void unicode_print (FILE *, const unichar *, rc_uint_type); |
252b5132 | 76 | |
4a594fce NC |
77 | /* Print a ascii string to a file. */ |
78 | extern void ascii_print (FILE *, const char *, rc_uint_type); | |
79 | ||
80 | /* Print a quoted unicode string to a file. */ | |
81 | extern void unicode_print_quoted (FILE *, const unichar *, rc_uint_type); | |
252b5132 RH |
82 | |
83 | /* Windres support routine called by unicode_from_ascii. This is both | |
84 | here and in windres.h. It should probably be in a separate header | |
85 | file, but it hardly seems worth it for one function. */ | |
86 | ||
4a594fce NC |
87 | extern void * res_alloc (rc_uint_type); |
88 | ||
89 | #endif |