FreeBSD/sys/contrib/dev/acpica/compiler/dtfield.c
/******************************************************************************
 *
 * FUNCTION:    DtCompileUnicode
 *
 * PARAMETERS:  Buffer              - Output buffer
 *              Field               - String to be copied to buffer
 *              ByteLength          - Maximum length of string
 *
 * RETURN:      None
 *
 * DESCRIPTION: Convert ASCII string to Unicode string
 *
 * Note:  The Unicode string is 16 bits per character, no leading signature,
 *        with a 16-bit terminating NULL.
 *
 *****************************************************************************/
DtCompileUnicode
PARAMETERS:  Buffer              - Output buffer
Field               - String to be copied to buffer
ByteLength          - Maximum length of string

None

Convert ASCII string to Unicode string

The Unicode string is 16 bits per character, no leading signature,
with a 16-bit terminating NULL.
DtCompileUnicode PARAMETERS : Buffer - Output buffer Field - String to be copied to buffer ByteLength - Maximum length of string None Convert ASCII string to Unicode string The Unicode string is 16 bits per character no leading signature with a 16 - bit terminating NULL .
static void
DtCompileUnicode (
    UINT8                   *Buffer,
    DT_FIELD                *Field,
    UINT32                  ByteLength)
{
    UINT32                  Count;
    UINT32                  i;
    char                    *AsciiString;
    UINT16                  *UnicodeString;
    AsciiString = Field->Value;
    UnicodeString = (UINT16 *) Buffer;
    Count = strlen (AsciiString) + 1;
    for (i = 0; i < Count; i++)
    {
        UnicodeString[i] = (UINT16) AsciiString[i];
    }
}
static void DtCompileUnicode ( UINT8 * Buffer , DT_FIELD * Field , UINT32 ByteLength ) { UINT32 Count ; UINT32 i ; char * AsciiString ; UINT16 * UnicodeString ; AsciiString = Field -> Value ; UnicodeString = ( UINT16 * ) Buffer ; Count = strlen ( AsciiString ) + 1 ; for ( i = 0 ; i < Count ; i ++ ) { UnicodeString [ i ] = ( UINT16 ) AsciiString [ i ] ; } }
FUNCTION:    DtCompileUnicode
 PARAMETERS:  Buffer              - Output buffer
              Field               - String to be copied to buffer
              ByteLength          - Maximum length of string
FUNCTION : DtCompileUnicode PARAMETERS : Buffer - Output buffer Field - String to be copied to buffer ByteLength - Maximum length of string
/* Convert to Unicode string (including null terminator) */