aboutsummaryrefslogtreecommitdiff
path: root/iconv/gconv_simple.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-02-13 19:00:53 +0000
committerUlrich Drepper <drepper@redhat.com>2000-02-13 19:00:53 +0000
commit7cdd956e1c55930a020b61806d642b6047deffc7 (patch)
treef6daa27ab94fcc5593bc3a8495c3ec40b20344ca /iconv/gconv_simple.c
parentf5ff12d851be1c225385c037ccfc29ffa6216c94 (diff)
downloadglibc-7cdd956e1c55930a020b61806d642b6047deffc7.zip
glibc-7cdd956e1c55930a020b61806d642b6047deffc7.tar.gz
glibc-7cdd956e1c55930a020b61806d642b6047deffc7.tar.bz2
Update.
2000-02-13 Ulrich Drepper <drepper@redhat.com> * iconvdata/Makefile (modules): Add UTF-16. (distribute): Add utf-16.c. * iconvdata/gconv-modules: Add entries for UTF-16, UTF-16BE, and UTF-16LE. * iconvdata/utf-16.c: New file. * iconv/gconv_builtin.h: Remove UTF-16 entries here. * iconv/gconv_simple.c: Remove conversion functions to and from UTF-16. * iconv/skeleton.c: Increment __invocation_coounter after every call to the loops.
Diffstat (limited to 'iconv/gconv_simple.c')
-rw-r--r--iconv/gconv_simple.c170
1 files changed, 0 insertions, 170 deletions
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index 6acdd5d..31e7970 100644
--- a/iconv/gconv_simple.c
+++ b/iconv/gconv_simple.c
@@ -462,173 +462,3 @@ internal_ucs4_loop (const unsigned char **inptrp, const unsigned char *inend,
#endif
#include <iconv/loop.c>
#include <iconv/skeleton.c>
-
-
-/* Convert from the internal (UCS4-like) format to UTF-16. */
-#define DEFINE_INIT 0
-#define DEFINE_FINI 0
-#define MIN_NEEDED_FROM 4
-#define MIN_NEEDED_TO 2
-#define MAX_NEEDED_TO 4
-#define FROM_DIRECTION 1
-#define FROM_LOOP internal_utf16_loop
-#define TO_LOOP internal_utf16_loop /* This is not used. */
-#define FUNCTION_NAME __gconv_transform_internal_utf16
-
-#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
-#define MAX_NEEDED_OUTPUT MAX_NEEDED_TO
-#define LOOPFCT FROM_LOOP
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-# define BODY \
- { \
- if (*((uint32_t *) inptr) >= 0x10000) \
- { \
- if (*((uint32_t *) inptr) >= 0x110000) \
- { \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
- \
- /* Generate a surrogate character. */ \
- if (NEED_LENGTH_TEST && outptr + 4 > outend) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- \
- *((uint16_t *) outptr)++ = bswap_16 (0xd7c0 \
- + (*((uint32_t *) inptr) >> 10));\
- *((uint16_t *) outptr)++ = bswap_16 (0xdc00 \
- + (*((uint32_t *) inptr) \
- & 0x3ff)); \
- } \
- else \
- /* Please note that we use the `uint32_t' from-pointer as an `uint16_t' \
- pointer which works since we are on a little endian machine. */ \
- *((uint16_t *) outptr)++ = bswap_16 (*((uint16_t *) inptr)); \
- inptr += 4; \
- }
-#else
-# define BODY \
- { \
- if (*((uint32_t *) inptr) >= 0x10000) \
- { \
- if (*((uint32_t *) inptr) >= 0x110000) \
- { \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
- \
- /* Generate a surrogate character. */ \
- if (NEED_LENGTH_TEST && outptr + 4 > outend) \
- { \
- /* Overflow in the output buffer. */ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- \
- *((uint16_t *) outptr)++ = 0xd7c0 + (*((uint32_t *) inptr) >> 10); \
- *((uint16_t *) outptr)++ = 0xdc00 + (*((uint32_t *) inptr) & 0x3ff); \
- } \
- else \
- *((uint16_t *) outptr)++ = *((uint32_t *) inptr)++; \
- }
-#endif
-#include <iconv/loop.c>
-#include <iconv/skeleton.c>
-
-
-/* Convert from UTF-16 to the internal (UCS4-like) format. */
-#define DEFINE_INIT 0
-#define DEFINE_FINI 0
-#define MIN_NEEDED_FROM 2
-#define MAX_NEEDED_FROM 4
-#define MIN_NEEDED_TO 4
-#define FROM_DIRECTION 1
-#define FROM_LOOP utf16_internal_loop
-#define TO_LOOP utf16_internal_loop /* This is not used.*/
-#define FUNCTION_NAME __gconv_transform_utf16_internal
-
-#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
-#define MAX_NEEDED_INPUT MAX_NEEDED_FROM
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
-#define LOOPFCT FROM_LOOP
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-# define BODY \
- { \
- uint16_t u1 = bswap_16 (*(uint16_t *) inptr); \
- \
- if (u1 < 0xd800 || u1 > 0xdfff) \
- { \
- /* No surrogate. */ \
- *((uint32_t *) outptr)++ = u1; \
- inptr += 2; \
- } \
- else \
- { \
- uint16_t u2; \
- \
- /* It's a surrogate character. At least the first word says \
- it is. */ \
- if (NEED_LENGTH_TEST && inptr + 4 > inend) \
- { \
- /* We don't have enough input for another complete input \
- character. */ \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- \
- u2 = bswap_16 (((uint16_t *) inptr)[1]); \
- if (u2 < 0xdc00 || u2 >= 0xdfff) \
- { \
- /* This is no valid second word for a surrogate. */ \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
- \
- *((uint32_t *) outptr)++ = ((u1 - 0xd7c0) << 10) + (u2 - 0xdc00); \
- inptr += 4; \
- } \
- }
-#else
-# define BODY \
- { \
- uint16_t u1 = *(uint16_t *) inptr; \
- \
- if (u1 < 0xd800 || u1 > 0xdfff) \
- { \
- /* No surrogate. */ \
- *((uint32_t *) outptr)++ = u1; \
- inptr += 2; \
- } \
- else \
- { \
- uint16_t u2; \
- \
- /* It's a surrogate character. At least the first word says \
- it is. */ \
- if (NEED_LENGTH_TEST && inptr + 4 > inend) \
- { \
- /* We don't have enough input for another complete input \
- character. */ \
- result = __GCONV_INCOMPLETE_INPUT; \
- break; \
- } \
- \
- u2 = ((uint16_t *) inptr)[1]; \
- if (u2 < 0xdc00 || u2 >= 0xdfff) \
- { \
- /* This is no valid second word for a surrogate. */ \
- result = __GCONV_ILLEGAL_INPUT; \
- break; \
- } \
- \
- *((uint32_t *) outptr)++ = ((u1 - 0xd7c0) << 10) + (u2 - 0xdc00); \
- inptr += 4; \
- } \
- }
-#endif
-#include <iconv/loop.c>
-#include <iconv/skeleton.c>