citrus_iconv_std.c (219019) | citrus_iconv_std.c (252583) |
---|---|
1/* $FreeBSD: head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c 219019 2011-02-25 00:04:39Z gabor $ */ | 1/* $FreeBSD: head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c 252583 2013-07-03 18:27:45Z peter $ */ |
2/* $NetBSD: citrus_iconv_std.c,v 1.15 2006/11/13 19:08:19 tnozaki Exp $ */ 3 4/*- 5 * Copyright (c)2003 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 --- 89 unchanged lines hidden (view full) --- 99{ 100 101 if (se->se_ps) 102 _stdenc_init_state(se->se_handle, se->se_ps); 103} 104 105static __inline int 106mbtocsx(struct _citrus_iconv_std_encoding *se, | 2/* $NetBSD: citrus_iconv_std.c,v 1.15 2006/11/13 19:08:19 tnozaki Exp $ */ 3 4/*- 5 * Copyright (c)2003 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 --- 89 unchanged lines hidden (view full) --- 99{ 100 101 if (se->se_ps) 102 _stdenc_init_state(se->se_handle, se->se_ps); 103} 104 105static __inline int 106mbtocsx(struct _citrus_iconv_std_encoding *se, |
107 _csid_t *csid, _index_t *idx, char **s, size_t n, size_t *nresult, | 107 _csid_t *csid, _index_t *idx, const char **s, size_t n, size_t *nresult, |
108 struct iconv_hooks *hooks) 109{ 110 111 return (_stdenc_mbtocs(se->se_handle, csid, idx, s, n, se->se_ps, 112 nresult, hooks)); 113} 114 115static __inline int --- 340 unchanged lines hidden (view full) --- 456_citrus_iconv_std_iconv_uninit_context(struct _citrus_iconv *cv) 457{ 458 459 free(cv->cv_closure); 460} 461 462static int 463_citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv, | 108 struct iconv_hooks *hooks) 109{ 110 111 return (_stdenc_mbtocs(se->se_handle, csid, idx, s, n, se->se_ps, 112 nresult, hooks)); 113} 114 115static __inline int --- 340 unchanged lines hidden (view full) --- 456_citrus_iconv_std_iconv_uninit_context(struct _citrus_iconv *cv) 457{ 458 459 free(cv->cv_closure); 460} 461 462static int 463_citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv, |
464 char * __restrict * __restrict in, size_t * __restrict inbytes, | 464 const char * __restrict * __restrict in, size_t * __restrict inbytes, |
465 char * __restrict * __restrict out, size_t * __restrict outbytes, 466 uint32_t flags, size_t * __restrict invalids) 467{ 468 const struct _citrus_iconv_std_shared *is = cv->cv_shared->ci_closure; 469 struct _citrus_iconv_std_context *sc = cv->cv_closure; 470 _csid_t csid; 471 _index_t idx; | 465 char * __restrict * __restrict out, size_t * __restrict outbytes, 466 uint32_t flags, size_t * __restrict invalids) 467{ 468 const struct _citrus_iconv_std_shared *is = cv->cv_shared->ci_closure; 469 struct _citrus_iconv_std_context *sc = cv->cv_closure; 470 _csid_t csid; 471 _index_t idx; |
472 char *tmpin; | 472 const char *tmpin; |
473 size_t inval, szrin, szrout; 474 int ret, state = 0; 475 476 inval = 0; 477 if (in == NULL || *in == NULL) { 478 /* special cases */ 479 if (out != NULL && *out != NULL) { 480 /* init output state and store the shift sequence */ --- 103 unchanged lines hidden --- | 473 size_t inval, szrin, szrout; 474 int ret, state = 0; 475 476 inval = 0; 477 if (in == NULL || *in == NULL) { 478 /* special cases */ 479 if (out != NULL && *out != NULL) { 480 /* init output state and store the shift sequence */ --- 103 unchanged lines hidden --- |