Lines Matching defs:fn

66 #define RETURN(e,n,fn) \
67 if (*fn && !e) e = E2BIG; \
260 _win_iconv(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
280 fz = tz = (*fn < *tn) ? *fn : *tn;
286 un = *fn;
294 if ((tz = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)*tb, *tn)) && tz <= *tn)
296 fz = *fn;
307 pz = *fn / 2;
308 fz = *fn - pz;
312 if (++fz >= *fn)
337 un = *fn / sizeof(WCHAR);
340 else if (!(un = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)*tb, 0)))
344 else if (!(un = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)ub, un)))
352 fz = *fn;
361 pz = *fn / 2;
362 bz = *fn - pz;
366 if (++bz > *fn)
389 error(DEBUG_TRACE, "AHA#%d _win_iconv *fn=%u fz=%u[%u] *tn=%u tz=%u\n", __LINE__, *fn, fz, fz * sizeof(WCHAR), *tn, tz);
400 *fn -= fz;
531 utf2bin(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
545 fe = f + (*fn);
593 *fn -= (char*)f - (*fb);
597 RETURN(e, n, fn);
605 bin2utf(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
618 fe = f + (*fn);
667 *fn -= (n = (char*)f - (*fb));
671 RETURN(e, n, fn);
715 ume2bin(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
731 fe = f + (*fn);
779 *fn -= (char*)f - (*fb);
783 RETURN(e, n, fn);
791 bin2ume(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
806 fe = f + (*fn);
853 *fn -= (n = (char*)f - (*fb));
857 RETURN(e, n, fn);
865 ucs2bin(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
877 fe = f + (*fn);
898 *fn -= (char*)f - (*fb);
902 RETURN(e, n, fn);
910 bin2ucs(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
923 fe = f + (*fn);
944 *fn -= (n = (char*)f - (*fb));
948 RETURN(e, n, fn);
956 scu2bin(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
968 fe = f + (*fn);
989 *fn -= (char*)f - (*fb);
993 RETURN(e, n, fn);
1001 bin2scu(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
1014 fe = f + (*fn);
1035 *fn -= (n = (char*)f - (*fb));
1039 RETURN(e, n, fn);
1230 * copy *fb size *fn to *tb size *tn
1231 * fb,fn tb,tn updated on return
1235 _ast_iconv(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
1271 tfn = *fn;
1279 *fn -= i;
1282 if ((*cc->from.fun)(cc->cvt, fb, fn, tb, tn) == (size_t)(-1))
1296 return (*cc->to.fun)(cc->cvt, fb, fn, tb, tn);
1302 if ((n = *fn) > cc->size)
1309 n = (*cc->to.fun)(cc->cvt, &b, fn, tb, tn);
1314 if (n > *fn)
1315 n = *fn;
1327 *fn -= n;
1334 * write *fb size *fn to op
1335 * fb,fn updated on return
1340 _ast_iconv_write(_ast_iconv_t cd, Sfio_t* op, char** fb, size_t* fn, size_t* e)
1349 while (*fn > 0)
1359 while (_ast_iconv(cd, fb, fn, &ts, &tn) == (size_t)(-1))
1364 error(DEBUG_TRACE, "AHA#%d iconv_write %d => %d `%-.*s'", __LINE__, *fn, tn, *fn, *fb);
1365 _r = _ast_iconv(cd, fb, fn, &ts, &tn);
1366 error(DEBUG_TRACE, "AHA#%d iconv_write %d => %d [%d]", __LINE__, *fn, tn, _r);
1378 (*fn)--;
1401 size_t fn;
1408 fn = n;
1411 if (fn != SF_UNBOUND)
1412 fn = -((ssize_t)(fn & (((size_t)(~0))>>1)));
1413 if (!(fb = (char*)sfreserve(ip, fn, locked = SF_LOCKR)) &&
1414 !(fb = (char*)sfreserve(ip, fn, locked = 0)))
1417 fn = fo = sfvalue(ip);
1425 while (_ast_iconv(cd, &fs, &fn, &ts, &tn) != (size_t)(-1) && fn > 0)
1435 fn--;
1442 for (i = fn; --i >= (fs - fb);)
1450 if (fn == fo)
1451 fn++;