Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/iconv/citrus_stdenc_template.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#undef _TO_EI | #undef _TO_EI | ||||
#undef _CE_TO_EI | #undef _CE_TO_EI | ||||
#undef _TO_STATE | #undef _TO_STATE | ||||
#define _TO_EI(_cl_) ((_ENCODING_INFO*)(_cl_)) | #define _TO_EI(_cl_) ((_ENCODING_INFO*)(_cl_)) | ||||
#define _CE_TO_EI(_ce_) (_TO_EI((_ce_)->ce_closure)) | #define _CE_TO_EI(_ce_) (_TO_EI((_ce_)->ce_closure)) | ||||
#define _TO_STATE(_ps_) ((_ENCODING_STATE*)(_ps_)) | #define _TO_STATE(_ps_) ((_ENCODING_STATE*)(_ps_)) | ||||
#ifndef _ENCODING_MB_CUR_MIN | |||||
/* Assume one byte minimum unless otherwise specified. */ | |||||
#define _ENCODING_MB_CUR_MIN(_ei_) 1 | |||||
thj: I can't track down the resolution of encoding info. This define always being one seems to… | |||||
Done Inline ActionsThese are all kind of whacky, but this file is actually part of the module template and only gets #include'd at the bottom of a module.c, so the module is free to #define it and we'll use that instead below. The below methods are declared in the module's .h, which is what libiconv uses. kevans: These are all kind of whacky, but this file is actually part of the module template and only… | |||||
#endif | |||||
/* ---------------------------------------------------------------------- | /* ---------------------------------------------------------------------- | ||||
* templates for public functions | * templates for public functions | ||||
*/ | */ | ||||
int | int | ||||
_FUNCNAME(stdenc_getops)(struct _citrus_stdenc_ops *ops, | _FUNCNAME(stdenc_getops)(struct _citrus_stdenc_ops *ops, | ||||
size_t lenops __unused) | size_t lenops __unused) | ||||
{ | { | ||||
Show All 22 Lines | _FUNCNAME(stdenc_init)(struct _citrus_stdenc * __restrict ce, | ||||
if (ret) { | if (ret) { | ||||
free((void *)ei); | free((void *)ei); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
ce->ce_closure = ei; | ce->ce_closure = ei; | ||||
et->et_state_size = sizeof(_ENCODING_STATE); | et->et_state_size = sizeof(_ENCODING_STATE); | ||||
et->et_mb_cur_max = _ENCODING_MB_CUR_MAX(_CE_TO_EI(ce)); | et->et_mb_cur_max = _ENCODING_MB_CUR_MAX(_CE_TO_EI(ce)); | ||||
et->et_mb_cur_min = _ENCODING_MB_CUR_MIN(_CE_TO_EI(ce)); | |||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
_FUNCNAME(stdenc_uninit)(struct _citrus_stdenc * __restrict ce) | _FUNCNAME(stdenc_uninit)(struct _citrus_stdenc * __restrict ce) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |
I can't track down the resolution of encoding info. This define always being one seems to exclude the 'otherwise specified' part of the comment, is the minimum changed somewhere else?