Lines Matching refs:cd

102 	iconv_t	cd;
126 if ((cd = malloc(sizeof (struct _iconv_info))) == NULL) {
138 free(cd);
143 cd->_conv = iconv_open_all(to, from, ipath, flag, string_based);
144 if (cd->_conv != (iconv_p)-1) {
148 return (cd);
154 cd->_conv = iconv_search_alias(&to_canonical, &from_canonical,
157 if (cd->_conv == (iconv_p)-1) {
170 free(cd);
179 cd->_conv = malloc(sizeof (struct _iconv_fields));
180 if (cd->_conv == NULL) {
183 free(cd);
188 cd->_conv->_icv_state = (void *)malloc(sizeof (int));
189 if (cd->_conv->_icv_state == NULL) {
192 free(cd->_conv);
193 free(cd);
197 cd->_conv->_icv_handle = NULL;
198 cd->_conv->_icv_iconv = passthru_icv_iconv;
199 cd->_conv->_icv_iconvctl = passthru_icv_iconvctl;
200 cd->_conv->_icv_iconvstr = passthru_icv_iconvstr;
201 cd->_conv->_icv_close = passthru_icv_close;
202 *((int *)(cd->_conv->_icv_state)) = flag;
208 return (cd);
461 * and stores it in cd->_icv_close
501 iconv_close(iconv_t cd)
503 if (cd == NULL) {
507 (*(cd->_conv)->_icv_close)(cd->_conv->_icv_state);
508 if (cd->_conv->_icv_handle != NULL)
509 (void) dlclose(cd->_conv->_icv_handle);
510 free(cd->_conv);
511 free(cd);
516 passthru_icv_close(iconv_t cd)
518 free((void *)cd);
523 iconv(iconv_t cd, char **inbuf, size_t *inbytesleft,
526 /* check if cd is valid */
527 if (cd == NULL) {
533 return ((*(cd->_conv)->_icv_iconv)(cd->_conv->_icv_state,
539 passthru_icv_iconv(iconv_t cd, const char **inbuf, size_t *inbufleft,
584 iconvctl(iconv_t cd, int req, void *arg)
588 if (cd == NULL) {
598 if (cd->_conv->_icv_iconvctl == NULL) {
617 return ((*cd->_conv->_icv_iconvctl)(cd->_conv->_icv_state, req, arg));
621 passthru_icv_iconvctl(iconv_t cd, int req, void *arg)
627 f = *((int *)cd);
668 *((int *)cd) = f;
678 iconv_t cd;
681 if ((cd = iconv_open_real(tocode, fromcode, 1)) == (iconv_t)-1) {
686 r = (*cd->_conv->_icv_iconvstr)(inarray, inlen, outarray, outlen, flag);
688 (void) dlclose(cd->_conv->_icv_handle);
689 free(cd->_conv);
690 free(cd);