Lines Matching refs:cc
239 _win_iconv_open(register Conv_t* cc, const char* t, const char* f) in _win_iconv_open() argument
244 if ((cc->from.index = _win_codeset(f)) < 0) in _win_iconv_open()
246 if ((cc->to.index = _win_codeset(t)) < 0) in _win_iconv_open()
249 error(DEBUG_TRACE, "AHA#%d _win_iconv_open f=0x%04x t=0x%04x\n", __LINE__, cc->from.index, cc->to.i… in _win_iconv_open()
251 return (_ast_iconv_t)cc; in _win_iconv_open()
262 Conv_t* cc = (Conv_t*)cd; in _win_iconv() local
272 error(DEBUG_TRACE, "AHA#%d _win_iconv from=0x%04x to=0x%04x\n", __LINE__, cc->from.index, cc->to.in… in _win_iconv()
274 if (cc->from.index == cc->to.index) in _win_iconv()
292 if (cc->to.index == CP_UCS2) in _win_iconv()
294 …if ((tz = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)*tb, *tn)) && tz <… in _win_iconv()
311 while (!(tz = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)fz, (LPWSTR)*tb, 0))) in _win_iconv()
335 if (cc->from.index == CP_UCS2) in _win_iconv()
340 else if (!(un = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)*tb, 0))) in _win_iconv()
344 else if (!(un = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)ub, un))) in _win_iconv()
351 if (tz = WideCharToMultiByte(cc->to.index, 0, (LPCWSTR)ub, un, *tb, *tn, 0, 0)) in _win_iconv()
365 while (!(fz = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)bz, (LPWSTR)ub, un))) in _win_iconv()
368 if (!(tz = WideCharToMultiByte(cc->to.index, 0, (LPCWSTR)ub, fz, *tb, 0, 0, 0))) in _win_iconv()
386 if (!(tz = WideCharToMultiByte(cc->to.index, 0, (LPCWSTR)ub, fz, *tb, tz, 0, 0))) in _win_iconv()
1049 register Conv_t* cc; in _ast_iconv_open() local
1084 if ((cc = freelist[i]) && streq(to, cc->to.name) && streq(fr, cc->from.name)) in _ast_iconv_open()
1092 if (cc->cvt != (iconv_t)(-1)) in _ast_iconv_open()
1093 iconv(cc->cvt, NiL, NiL, NiL, NiL); in _ast_iconv_open()
1095 return cc; in _ast_iconv_open()
1102 if (!(cc = newof(0, Conv_t, 1, strlen(to) + strlen(fr) + 2))) in _ast_iconv_open()
1104 cc->to.name = (char*)(cc + 1); in _ast_iconv_open()
1105 cc->from.name = strcopy(cc->to.name, to) + 1; in _ast_iconv_open()
1106 strcpy(cc->from.name, fr); in _ast_iconv_open()
1107 cc->cvt = (iconv_t)(-1); in _ast_iconv_open()
1114 cc->from.map = ccmap(fc, tc); in _ast_iconv_open()
1116 else if ((cc->cvt = iconv_open(to, fr)) != (iconv_t)(-1)) in _ast_iconv_open()
1117 cc->from.fun = (_ast_iconv_f)iconv; in _ast_iconv_open()
1120 else if ((cc->cvt = _win_iconv_open(cc, to, fr)) != (_ast_iconv_t)(-1)) in _ast_iconv_open()
1121 cc->from.fun = (_ast_iconv_f)_win_iconv; in _ast_iconv_open()
1128 cc->from.fun = utf2bin; in _ast_iconv_open()
1131 cc->from.fun = ume2bin; in _ast_iconv_open()
1134 cc->from.fun = ucs2bin; in _ast_iconv_open()
1137 cc->from.fun = scu2bin; in _ast_iconv_open()
1144 cc->from.map = ccmap(fc, CC_ASCII); in _ast_iconv_open()
1150 cc->to.fun = bin2utf; in _ast_iconv_open()
1153 cc->to.fun = bin2ume; in _ast_iconv_open()
1156 cc->to.fun = bin2ucs; in _ast_iconv_open()
1159 cc->to.fun = bin2scu; in _ast_iconv_open()
1166 cc->to.map = ccmap(CC_ASCII, tc); in _ast_iconv_open()
1170 return (iconv_t)cc; in _ast_iconv_open()
1182 Conv_t* cc; in _ast_iconv_close() local
1189 if (!(cc = (Conv_t*)cd)) in _ast_iconv_close()
1225 freelist[freeindex = i] = cc; in _ast_iconv_close()
1237 Conv_t* cc = (Conv_t*)cd; in _ast_iconv() local
1257 if (cc) in _ast_iconv()
1259 if (cc->from.fun) in _ast_iconv()
1261 if (cc->to.fun) in _ast_iconv()
1263 if (!cc->buf && !(cc->buf = oldof(0, char, cc->size = SF_BUFSIZE, 0))) in _ast_iconv()
1268 b = cc->buf; in _ast_iconv()
1269 i = cc->size; in _ast_iconv()
1272 if ((*cc->from.fun)(cc->cvt, &tfb, &tfn, &b, &i) == (size_t)(-1)) in _ast_iconv()
1274 tfn = b - cc->buf; in _ast_iconv()
1275 tfb = cc->buf; in _ast_iconv()
1276 n = (*cc->to.fun)(cc->cvt, &tfb, &tfn, tb, tn); in _ast_iconv()
1277 i = tfb - cc->buf; in _ast_iconv()
1282 if ((*cc->from.fun)(cc->cvt, fb, fn, tb, tn) == (size_t)(-1)) in _ast_iconv()
1285 if (m = cc->to.map) in _ast_iconv()
1293 else if (cc->to.fun) in _ast_iconv()
1295 if (!(m = cc->from.map)) in _ast_iconv()
1296 return (*cc->to.fun)(cc->cvt, fb, fn, tb, tn); in _ast_iconv()
1297 if (!cc->buf && !(cc->buf = oldof(0, char, cc->size = SF_BUFSIZE, 0))) in _ast_iconv()
1302 if ((n = *fn) > cc->size) in _ast_iconv()
1303 n = cc->size; in _ast_iconv()
1306 t = (unsigned char*)(b = cc->buf); in _ast_iconv()
1309 n = (*cc->to.fun)(cc->cvt, &b, fn, tb, tn); in _ast_iconv()
1310 *fb += b - cc->buf; in _ast_iconv()
1316 if (cc && (m = cc->from.map)) in _ast_iconv()