FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/gtt_include/ctm/ucs_functions.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /* | |
2 ******************************************************************************* | |
3 * | |
4 * COPYRIGHT (C) 2000 BY ERICSSON EUROLAB DEUTSCHLAND GmbH | |
5 * 90411 NUERNBERG, GERMANY, Tel Int + 49 911 5217 100 | |
6 * | |
7 * The program(s) may be used and/or copied only with the | |
8 * written permission from Ericsson or in accordance | |
9 * with the terms and conditions stipulated in the agreement or | |
10 * contract under which the program(s) have been supplied. | |
11 * | |
12 ******************************************************************************* | |
13 * | |
14 * File : baudot_functions.h | |
15 * Author : EEDN/RV Matthias Doerbecker | |
16 * Tested Platforms : Windows NT 4.0 | |
17 * Description : header file for ucs_functions.c | |
18 * | |
19 * Revision history | |
20 * | |
21 * $Log: $ | |
22 * | |
23 ******************************************************************************* | |
24 */ | |
25 #ifndef ucs_functions_h | |
26 #define ucs_functions_h "$Id: $" | |
27 | |
28 /* | |
29 ******************************************************************************* | |
30 * INCLUDE FILES | |
31 ******************************************************************************* | |
32 */ | |
33 | |
34 #include "fifo.h" | |
35 | |
36 /* | |
37 ******************************************************************************* | |
38 * DEFINITIONS | |
39 ******************************************************************************* | |
40 */ | |
41 | |
42 /****************************************************************************/ | |
43 /* convertChar2UCScode() */ | |
44 /* ********************* */ | |
45 /* Conversion from character into UCS code */ | |
46 /* (Universal Multiple-Octet Coded Character Set, Row 00 */ | |
47 /* of the Multilingual plane according to ISO/IEC 10646-1). */ | |
48 /* This routine only handles characters in the range 0...255 since that is */ | |
49 /* all that is required for the demonstration of Baudot support. */ | |
50 /* */ | |
51 /* input variables: */ | |
52 /* - inChar charcater that shall be converted */ | |
53 /* */ | |
54 /* return value: UCS code of the input character */ | |
55 /* or 0xFFFF in case that inChar is not valid */ | |
56 /* (e.g. inChar=='\0') */ | |
57 /* */ | |
58 /* Matthias Doerbecker, Ericsson Eurolab Deutschland (EED/N/RV), 2000/09/18 */ | |
59 /****************************************************************************/ | |
60 | |
61 UWORD16 convertChar2UCScode(char inChar); | |
62 | |
63 | |
64 /****************************************************************************/ | |
65 /* convertUCScode2char() */ | |
66 /* ********************* */ | |
67 /* Conversion from UCS code into character */ | |
68 /* This routine only handles characters in the range 0...255 since that is */ | |
69 /* all that is required for the demonstration of Baudot support. */ | |
70 /* */ | |
71 /* input variables: */ | |
72 /* - ucsCode UCS code index, */ | |
73 /* must be within the range 0...255 if BITS_PER_SYMB==8, */ | |
74 /* or in the range 0...63 if BITS_PER_SYMB==6, */ | |
75 /* */ | |
76 /* return value: character (or '\0' if ucsCode is not valid) */ | |
77 /* */ | |
78 /* Matthias Doerbecker, Ericsson Eurolab Deutschland (EED/N/RV), 2000/09/18 */ | |
79 /****************************************************************************/ | |
80 | |
81 char convertUCScode2char(UWORD16 ucsCode); | |
82 | |
83 | |
84 /****************************************************************************/ | |
85 /* transformUCS2UTF() */ | |
86 /* ****************** */ | |
87 /* Transformation from UCS code into UTF-8. UTF-8 is a sequence consisting */ | |
88 /* of 1, 2, 3, or 5 octets (bytes). See ISO/IEC 10646-1 Annex G. */ | |
89 /* */ | |
90 /* This routine only handles UCS codes in the range 0...0xFF since that is */ | |
91 /* all that is required for the demonstration of Baudot support. */ | |
92 /* */ | |
93 /* input variables: */ | |
94 /* - ucsCode UCS code index, */ | |
95 /* */ | |
96 /* output variables: */ | |
97 /* - ptr_octet_fifo_state pointer to the output fifo state buffer for */ | |
98 /* the UTF-8 octets. */ | |
99 /* */ | |
100 /* Matthias Doerbecker, Ericsson Eurolab Deutschland (EED/N/RV), 2000/06/29 */ | |
101 /****************************************************************************/ | |
102 | |
103 void transformUCS2UTF(UWORD16 ucsCode, | |
104 fifo_state_t* ptr_octet_fifo_state); | |
105 | |
106 | |
107 /****************************************************************************/ | |
108 /* transformUTF2UCS() */ | |
109 /* ****************** */ | |
110 /* Transformation from UTF-8 into UCS code. */ | |
111 /* */ | |
112 /* This routine only handles UTF-8 sequences consisting of one or two */ | |
113 /* octets (corresponding to UCS codes in the range 0...0xFF) since that is */ | |
114 /* all that is required for the demonstration of Baudot support. */ | |
115 /* */ | |
116 /* input/output variables: */ | |
117 /* - ptr_octet_fifo_state pointer to the input fifo state buffer for */ | |
118 /* the UTF-8 octets. */ | |
119 /* */ | |
120 /* output variables: */ | |
121 /* - *ptr_ucsCode UCS code index */ | |
122 /* */ | |
123 /* return value: */ | |
124 /* true, if conversion was successful */ | |
125 /* false, if the input fifo buffer didn't contain enough octets for a */ | |
126 /* conversion into UCS code. The output variable *ptr_ucsCode */ | |
127 /* doesn't contain a valid value in this case */ | |
128 /* */ | |
129 /* Matthias Doerbecker, Ericsson Eurolab Deutschland (EED/N/RV), 2000/06/29 */ | |
130 /****************************************************************************/ | |
131 | |
132 BOOL transformUTF2UCS(UWORD16 *ptr_ucsCode, | |
133 fifo_state_t *ptr_octet_fifo_state); | |
134 | |
135 | |
136 #endif |