Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 118 of file fold.c.
{ WCHAR *dstbase = dst; const WCHAR *expand; int i; if (srclen == -1) srclen = strlenW(src) + 1; /* Include terminating NUL in count */ if (!dstlen) { /* Calculate the required size for dst */ dstlen = srclen; if (flags & MAP_EXPAND_LIGATURES) { while (srclen--) { dstlen += get_ligature_len(*src); src++; } } else if (flags & MAP_COMPOSITE) { /* FIXME */ } else if (flags & MAP_PRECOMPOSED) { /* FIXME */ } return dstlen; } if (srclen > dstlen) return 0; dstlen -= srclen; /* Actually perform the mapping(s) specified */ for (i = 0; i < srclen; i++) { WCHAR ch = *src; if (flags & MAP_EXPAND_LIGATURES) { expand = get_ligature(ch); if (expand[0]) { if (!dstlen--) return 0; dst[0] = expand[0]; if (expand[2]) { if (!dstlen--) return 0; *++dst = expand[1]; ch = expand[2]; } else ch = expand[1]; dst++; } } else if (flags & MAP_COMPOSITE) { /* FIXME */ } else if (flags & MAP_PRECOMPOSED) { /* FIXME */ } if (flags & MAP_FOLDDIGITS) ch = to_unicode_digit(ch); if (flags & MAP_FOLDCZONE) ch = to_unicode_native(ch); *dst++ = ch; src++; } return dst - dstbase; }