Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 70 of file lfn.c.
Referenced by CNV_THIS_PART(), and lfn_get().
{ const unsigned char *up; unsigned char *out, *cp; int len, val; for( len = 0, up = uni; (up-uni)/2 < maxlen && (up[0] || up[1]); up += 2 ){ if (UNICODE_CONVERTABLE(up[0],up[1])) ++len; else len += 4; } cp = out = use_q ? qalloc( &FsCheckMemQueue, len+1 ) : vfalloc( len+1 ); for( up = uni; (up-uni)/2 < maxlen && (up[0] || up[1]); up += 2 ) { if (UNICODE_CONVERTABLE(up[0],up[1])) *cp++ = up[0]; else { /* here the same escape notation is used as in the Linux kernel */ *cp++ = ':'; val = (up[1] << 8) + up[0]; cp[2] = fat_uni2esc[val & 0x3f]; val >>= 6; cp[1] = fat_uni2esc[val & 0x3f]; val >>= 6; cp[0] = fat_uni2esc[val & 0x3f]; cp += 3; } } *cp = 0; return (char *)out; }