FreeCalypso > hg > freecalypso-tools
comparison uptools/libcoding/ucs2_bigend.c @ 377:f7228c18463a
uptools/libcoding: added function for UCS-2 BE output
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 08 Mar 2018 23:59:42 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
376:83c755829e31 | 377:f7228c18463a |
---|---|
1 /* | |
2 * This library module implements the function for converting a UCS-2 | |
3 * string from native 16-bit words into a byte buffer for SMS. | |
4 */ | |
5 | |
6 #include <sys/types.h> | |
7 | |
8 ucs2_out_bigend(inbuf, outbuf, nuni) | |
9 u_short *inbuf; | |
10 u_char *outbuf; | |
11 unsigned nuni; | |
12 { | |
13 u_short *ip = inbuf; | |
14 u_char *op = outbuf; | |
15 unsigned n, uni; | |
16 | |
17 for (n = 0; n < nuni; n++) { | |
18 uni = *ip++; | |
19 *op++ = uni >> 8; | |
20 *op++ = uni; | |
21 } | |
22 } |