Deleted Added
full compact
citrus_utf7.c (219019) citrus_utf7.c (252583)
1/* $FreeBSD: head/lib/libiconv_modules/UTF7/citrus_utf7.c 219019 2011-02-25 00:04:39Z gabor $ */
1/* $FreeBSD: head/lib/libiconv_modules/UTF7/citrus_utf7.c 252583 2013-07-03 18:27:45Z peter $ */
2/* $NetBSD: citrus_utf7.c,v 1.5 2006/08/23 12:57:24 tnozaki Exp $ */
3
4/*-
5 * Copyright (c)2004, 2005 Citrus Project,
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 134 unchanged lines hidden (view full) ---

144#define SRG_BASE UINT32_C(0x10000)
145#define HISRG_MIN UINT16_C(0xd800)
146#define HISRG_MAX UINT16_C(0xdbff)
147#define LOSRG_MIN UINT16_C(0xdc00)
148#define LOSRG_MAX UINT16_C(0xdfff)
149
150static int
151_citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei,
2/* $NetBSD: citrus_utf7.c,v 1.5 2006/08/23 12:57:24 tnozaki Exp $ */
3
4/*-
5 * Copyright (c)2004, 2005 Citrus Project,
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 134 unchanged lines hidden (view full) ---

144#define SRG_BASE UINT32_C(0x10000)
145#define HISRG_MIN UINT16_C(0xd800)
146#define HISRG_MAX UINT16_C(0xdbff)
147#define LOSRG_MIN UINT16_C(0xdc00)
148#define LOSRG_MAX UINT16_C(0xdfff)
149
150static int
151_citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei,
152 uint16_t * __restrict u16, char ** __restrict s, size_t n,
152 uint16_t * __restrict u16, const char ** __restrict s, size_t n,
153 _UTF7State * __restrict psenc, size_t * __restrict nresult)
154{
155 _UTF7State sv;
153 _UTF7State * __restrict psenc, size_t * __restrict nresult)
154{
155 _UTF7State sv;
156 char *s0;
156 const char *s0;
157 int done, i, len;
158
159 s0 = *s;
160 sv = *psenc;
161
162 for (i = 0, done = 0; done == 0; i++) {
163 if (i == psenc->chlen) {
164 if (n-- < 1) {

--- 68 unchanged lines hidden (view full) ---

233
234ilseq:
235 *nresult = (size_t)-1;
236 return (EILSEQ);
237}
238
239static int
240_citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei,
157 int done, i, len;
158
159 s0 = *s;
160 sv = *psenc;
161
162 for (i = 0, done = 0; done == 0; i++) {
163 if (i == psenc->chlen) {
164 if (n-- < 1) {

--- 68 unchanged lines hidden (view full) ---

233
234ilseq:
235 *nresult = (size_t)-1;
236 return (EILSEQ);
237}
238
239static int
240_citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei,
241 wchar_t * __restrict pwc, char ** __restrict s, size_t n,
241 wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
242 _UTF7State * __restrict psenc, size_t * __restrict nresult)
243{
242 _UTF7State * __restrict psenc, size_t * __restrict nresult)
243{
244 char *s0;
244 const char *s0;
245 uint32_t u32;
246 uint16_t hi, lo;
247 size_t nr, siz;
248 int err;
249
250 if (*s == NULL) {
251 _citrus_UTF7_init_state(ei, psenc);
252 *nresult = (size_t)_ENCODING_IS_STATE_DEPENDENT;

--- 247 unchanged lines hidden ---
245 uint32_t u32;
246 uint16_t hi, lo;
247 size_t nr, siz;
248 int err;
249
250 if (*s == NULL) {
251 _citrus_UTF7_init_state(ei, psenc);
252 *nresult = (size_t)_ENCODING_IS_STATE_DEPENDENT;

--- 247 unchanged lines hidden ---