/* * UniStrncpy_to_le: Copy length limited string with pad to little-endian
*/ staticinline __le16 *UniStrncpy_to_le(__le16 * ucs1, constwchar_t * ucs2,
size_t n)
{
__le16 *anchor = ucs1;
while (n-- && *ucs2) /* Copy the strings */
*ucs1++ = cpu_to_le16(*ucs2++);
n++; while (n--) /* Pad with nulls */
*ucs1++ = 0; return anchor;
}
/* * UniStrncpy_from_le: Copy length limited string with pad from little-endian
*/ staticinlinewchar_t *UniStrncpy_from_le(wchar_t * ucs1, const __le16 * ucs2,
size_t n)
{ wchar_t *anchor = ucs1;
while (n-- && *ucs2) /* Copy the strings */
*ucs1++ = __le16_to_cpu(*ucs2++);
n++; while (n--) /* Pad with nulls */
*ucs1++ = 0; return anchor;
}
/* * UniToupper: Convert a unicode character to upper case
*/ staticinlinewchar_t UniToupper(wchar_t uc)
{ conststruct UniCaseRange *rp;
if (uc < sizeof(NlsUniUpperTable)) { /* Latin characters */ return uc + NlsUniUpperTable[uc]; /* Use base tables */
} else {
rp = NlsUniUpperRange; /* Use range tables */ while (rp->start) { if (uc < rp->start) /* Before start of range */ return uc; /* Uppercase = input */ if (uc <= rp->end) /* In range */ return uc + rp->table[uc - rp->start];
rp++; /* Try next range */
}
} return uc; /* Past last range */
}
/* * UniStrupr: Upper case a unicode string
*/ staticinlinewchar_t *UniStrupr(wchar_t * upin)
{ wchar_t *up;
up = upin; while (*up) { /* For all characters */
*up = UniToupper(*up);
up++;
} return upin; /* Return input pointer */
}
#endif/* !_H_JFS_UNICODE */
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.