FreeCalypso > hg > sms-coding-utils
view libcoding/ucs2_bigend.c @ 30:d7571dc2fecc
doc: encoder/generator portion is now just one part
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 13 Jun 2024 23:16:04 +0000 |
parents | 2d0082216916 |
children |
line wrap: on
line source
/* * This library module implements the function for converting a UCS-2 * string from native 16-bit words into a byte buffer for SMS. */ #include <sys/types.h> ucs2_out_bigend(inbuf, outbuf, nuni) u_short *inbuf; u_char *outbuf; unsigned nuni; { u_short *ip = inbuf; u_char *op = outbuf; unsigned n, uni; for (n = 0; n < nuni; n++) { uni = *ip++; *op++ = uni >> 8; *op++ = uni; } }