Use the in-kernel u8 type instead.
Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/* SHOULD BE INTERNAL TO FRAMEWORK AKA DEPRECATED */
u32 CsrCharStringSerLen(const CsrCharString *str);
-u32 CsrUtf8StringSerLen(const CsrUtf8String *str);
+u32 CsrUtf8StringSerLen(const u8 *str);
u32 CsrUtf16StringSerLen(const u16 *str);
/* Prototypes for primitive type serializers */
void CsrUint32Ser(u8 *buffer, CsrSize *offset, u32 value);
void CsrMemCpySer(u8 *buffer, CsrSize *offset, const void *value, CsrSize length);
void CsrCharStringSer(u8 *buffer, CsrSize *offset, const CsrCharString *value);
-void CsrUtf8StringSer(u8 *buffer, CsrSize *offset, const CsrUtf8String *value);
+void CsrUtf8StringSer(u8 *buffer, CsrSize *offset, const u8 *value);
void CsrUtf16StringSer(u8 *buffer, CsrSize *offset, const u16 *value);
void CsrVoidPtrSer(u8 *buffer, CsrSize *offset, void *ptr);
void CsrSizeSer(u8 *buffer, CsrSize *offset, CsrSize value);
void CsrUint32Des(u32 *value, u8 *buffer, CsrSize *offset);
void CsrMemCpyDes(void *value, u8 *buffer, CsrSize *offset, CsrSize length);
void CsrCharStringDes(CsrCharString **value, u8 *buffer, CsrSize *offset);
-void CsrUtf8StringDes(CsrUtf8String **value, u8 *buffer, CsrSize *offset);
+void CsrUtf8StringDes(u8 **value, u8 *buffer, CsrSize *offset);
void CsrUtf16StringDes(u16 **value, u8 *buffer, CsrSize *offset);
void CsrVoidPtrDes(void **value, u8 *buffer, CsrSize *offset);
void CsrSizeDes(CsrSize *value, u8 *buffer, CsrSize *offset);
}
EXPORT_SYMBOL_GPL(CsrCharStringDes);
-void CsrUtf8StringDes(CsrUtf8String **value, u8 *buffer, CsrSize *offset)
+void CsrUtf8StringDes(u8 **value, u8 *buffer, CsrSize *offset)
{
- *value = (CsrUtf8String *) CsrStrDup((CsrCharString *) &buffer[*offset]);
+ *value = (u8 *) CsrStrDup((CsrCharString *) &buffer[*offset]);
*offset += CsrStrLen((CsrCharString *) *value) + 1;
}
}
EXPORT_SYMBOL_GPL(CsrCharStringSer);
-void CsrUtf8StringSer(u8 *buffer, CsrSize *offset, const CsrUtf8String *value)
+void CsrUtf8StringSer(u8 *buffer, CsrSize *offset, const u8 *value)
{
CsrCharStringSer(buffer, offset, (CsrCharString *) value);
}
}
}
-u32 CsrUtf8StringSerLen(const CsrUtf8String *str)
+u32 CsrUtf8StringSerLen(const u8 *str)
{
if (str)
{
/* String types */
typedef char CsrCharString;
-typedef u8 CsrUtf8String;
/*
* 64-bit integers
u32 CsrUtf16StringToUint32(const u16 *unicodeString);
u32 CsrUtf16StrLen(const u16 *unicodeString);
-CsrUtf8String *CsrUtf16String2Utf8(const u16 *source);
+u8 *CsrUtf16String2Utf8(const u16 *source);
-u16 *CsrUtf82Utf16String(const CsrUtf8String *utf8String);
+u16 *CsrUtf82Utf16String(const u8 *utf8String);
u16 *CsrUtf16StrCpy(u16 *target, const u16 *source);
u16 *CsrUtf16StringDuplicate(const u16 *source);
u16 *CsrUtf16String2XML(u16 *str);
u16 *CsrXML2Utf16String(u16 *str);
-s32 CsrUtf8StrCmp(const CsrUtf8String *string1, const CsrUtf8String *string2);
-s32 CsrUtf8StrNCmp(const CsrUtf8String *string1, const CsrUtf8String *string2, CsrSize count);
-u32 CsrUtf8StringLengthInBytes(const CsrUtf8String *string);
+s32 CsrUtf8StrCmp(const u8 *string1, const u8 *string2);
+s32 CsrUtf8StrNCmp(const u8 *string1, const u8 *string2, CsrSize count);
+u32 CsrUtf8StringLengthInBytes(const u8 *string);
/*******************************************************************************
Returns target
*******************************************************************************/
-CsrUtf8String *CsrUtf8StrTruncate(CsrUtf8String *target, CsrSize count);
+u8 *CsrUtf8StrTruncate(u8 *target, CsrSize count);
/*******************************************************************************
Returns target
*******************************************************************************/
-CsrUtf8String *CsrUtf8StrCpy(CsrUtf8String *target, const CsrUtf8String *source);
+u8 *CsrUtf8StrCpy(u8 *target, const u8 *source);
/*******************************************************************************
Returns target
*******************************************************************************/
-CsrUtf8String *CsrUtf8StrNCpy(CsrUtf8String *target, const CsrUtf8String *source, CsrSize count);
+u8 *CsrUtf8StrNCpy(u8 *target, const u8 *source, CsrSize count);
/*******************************************************************************
Returns target
*******************************************************************************/
-CsrUtf8String *CsrUtf8StrNCpyZero(CsrUtf8String *target, const CsrUtf8String *source, CsrSize count);
+u8 *CsrUtf8StrNCpyZero(u8 *target, const u8 *source, CsrSize count);
/*******************************************************************************
Returns a duplicate of source.
*******************************************************************************/
-CsrUtf8String *CsrUtf8StrDup(const CsrUtf8String *source);
+u8 *CsrUtf8StrDup(const u8 *source);
-CsrUtf8String *CsrUtf8StringConcatenateTexts(const CsrUtf8String *inputText1, const CsrUtf8String *inputText2, const CsrUtf8String *inputText3, const CsrUtf8String *inputText4);
+u8 *CsrUtf8StringConcatenateTexts(const u8 *inputText1, const u8 *inputText2, const u8 *inputText3, const u8 *inputText4);
/*
* UCS2
* Output: 0-terminated string of byte oriented UTF8 coded characters.
*
*********************************************************************************/
-CsrUtf8String *CsrUtf16String2Utf8(const u16 *source)
+u8 *CsrUtf16String2Utf8(const u16 *source)
{
- CsrUtf8String *dest, *destStart = NULL;
+ u8 *dest, *destStart = NULL;
u32 i;
u32 ch;
u32 length;
TRUE if the given code unit is legal.
*****************************************************************************/
-static CsrBool isLegalUtf8(const CsrUtf8String *codeUnit, u32 length)
+static CsrBool isLegalUtf8(const u8 *codeUnit, u32 length)
{
- const CsrUtf8String *srcPtr = codeUnit + length;
+ const u8 *srcPtr = codeUnit + length;
u8 byte;
switch (length) /* Everything falls through except case 1 */
* Output: 0-terminated string of UTF-16 characters.
*
*********************************************************************************/
-u16 *CsrUtf82Utf16String(const CsrUtf8String *utf8String)
+u16 *CsrUtf82Utf16String(const u8 *utf8String)
{
CsrSize i, length = 0;
CsrSize sourceLength;
return resultString;
}
-s32 CsrUtf8StrCmp(const CsrUtf8String *string1, const CsrUtf8String *string2)
+s32 CsrUtf8StrCmp(const u8 *string1, const u8 *string2)
{
return CsrStrCmp((const CsrCharString *) string1, (const CsrCharString *) string2);
}
-s32 CsrUtf8StrNCmp(const CsrUtf8String *string1, const CsrUtf8String *string2, CsrSize count)
+s32 CsrUtf8StrNCmp(const u8 *string1, const u8 *string2, CsrSize count)
{
return CsrStrNCmp((const CsrCharString *) string1, (const CsrCharString *) string2, count);
}
-u32 CsrUtf8StringLengthInBytes(const CsrUtf8String *string)
+u32 CsrUtf8StringLengthInBytes(const u8 *string)
{
CsrSize length = 0;
if (string)
return (u32) length;
}
-CsrUtf8String *CsrUtf8StrCpy(CsrUtf8String *target, const CsrUtf8String *source)
+u8 *CsrUtf8StrCpy(u8 *target, const u8 *source)
{
- return (CsrUtf8String *) CsrStrCpy((CsrCharString *) target, (const CsrCharString *) source);
+ return (u8 *) CsrStrCpy((CsrCharString *) target, (const CsrCharString *) source);
}
-CsrUtf8String *CsrUtf8StrTruncate(CsrUtf8String *target, CsrSize count)
+u8 *CsrUtf8StrTruncate(u8 *target, CsrSize count)
{
CsrSize lastByte = count - 1;
return target;
}
-CsrUtf8String *CsrUtf8StrNCpy(CsrUtf8String *target, const CsrUtf8String *source, CsrSize count)
+u8 *CsrUtf8StrNCpy(u8 *target, const u8 *source, CsrSize count)
{
- return (CsrUtf8String *) CsrStrNCpy((CsrCharString *) target, (const CsrCharString *) source, count);
+ return (u8 *) CsrStrNCpy((CsrCharString *) target, (const CsrCharString *) source, count);
}
-CsrUtf8String *CsrUtf8StrNCpyZero(CsrUtf8String *target, const CsrUtf8String *source, CsrSize count)
+u8 *CsrUtf8StrNCpyZero(u8 *target, const u8 *source, CsrSize count)
{
CsrStrNCpy((CsrCharString *) target, (const CsrCharString *) source, count);
if (target[count - 1] != '\0')
return target;
}
-CsrUtf8String *CsrUtf8StrDup(const CsrUtf8String *source)
+u8 *CsrUtf8StrDup(const u8 *source)
{
- return (CsrUtf8String *) CsrStrDup((const CsrCharString *) source);
+ return (u8 *) CsrStrDup((const CsrCharString *) source);
}
-CsrUtf8String *CsrUtf8StringConcatenateTexts(const CsrUtf8String *inputText1, const CsrUtf8String *inputText2, const CsrUtf8String *inputText3, const CsrUtf8String *inputText4)
+u8 *CsrUtf8StringConcatenateTexts(const u8 *inputText1, const u8 *inputText2, const u8 *inputText3, const u8 *inputText4)
{
- CsrUtf8String *outputText;
+ u8 *outputText;
u32 textLen, textLen1, textLen2, textLen3, textLen4;
textLen1 = CsrUtf8StringLengthInBytes(inputText1);
return NULL;
}
- outputText = (CsrUtf8String *) CsrPmemAlloc((textLen + 1) * sizeof(CsrUtf8String)); /* add space for 0-termination*/
+ outputText = (u8 *) CsrPmemAlloc((textLen + 1) * sizeof(u8)); /* add space for 0-termination*/
if (inputText1 != NULL)