ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static char * cnv_unicode ( const unsigned char uni,
int  maxlen,
int  use_q 
) [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;
}

Generated on Sat May 26 2012 06:03:40 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.