ATS_string.h 2.87 KB
/*
Copyright Wang yong ALL RIGHT RESERVED !
 @ file name: ATS_string.h

 @ description:  字符串接口文件

 @ Author: wangyong, doforfaith@gmail.com
 
 @ Modify History:

	Date					Event												Person
 10-05-31      Creator               			wangyong	
 
*/
#if defined(__SKY_3DGUI__)

#ifndef __ATS_STRING_H__
#define __ATS_STRING_H__

#include "ATS_basic.h"
#include "ATS_adaptation_features.h"

#if defined(ATS_PLATFORM) && (ATS_PLATFORM == ATS_PLATFORM_MTK)

#ifndef ATS_str_sprintf
#define ATS_str_sprintf 	sprintf
#endif

#ifndef ATS_str_wsprintf
#define ATS_str_wsprintf 	kal_wsprintf
#endif


//extern int sprintf(char *, const char *, ...);
extern void kal_wsprintf(unsigned short *outstr, char *fmt, ...);

#endif /*defined(ATS_PLATFORM) && (ATS_PLATFORM == ATS_PLATFORM_MTK)*/




/*Ascii String 操作函数*/
extern ats_int32 ATS_str_strlen(const ats_uint8 *s);

extern ats_uint8 *ATS_str_strcpy(ats_uint8 *to, const ats_uint8 *from);

extern ats_uint8 *ATS_str_strncpy(ats_uint8 *to, const ats_uint8 *from, ats_uint32 n);

extern ats_int32 ATS_str_strcmp(const ats_uint8 *s1, const ats_uint8 *s2);

extern ats_int32 ATS_str_strncmp(const ats_uint8 *s1, const ats_uint8 *s2, ats_uint32 n);

extern ats_uint8 *ATS_str_strcat(ats_uint8 *s1, const ats_uint8 *s2);

extern ats_uint8 *ATS_str_strncat(ats_uint8 *s1, const ats_uint8 *s2, ats_uint32 n);

extern ats_uint8 *ATS_str_strchr(const ats_uint8 *s, ats_int32 c);

extern ats_uint8 *ATS_str_strrchr(const ats_uint8 *str, ats_int32 ch);

extern ats_uint8 *ATS_str_strstr(const ats_uint8 *s1, const ats_uint8 *s2 );

extern void ATS_str_tolower(ats_uint8 *s);

extern void ATS_str_toupper(ats_uint8 *s);



/*Unicode String 操作函数*/
extern ats_int32 ATS_str_wstrlen(const ats_uint16 *wstr);

extern ats_uint16 *ATS_str_wstrcpy(ats_uint16 *to, const ats_uint16 *from);

extern ats_uint16 *ATS_str_wstrncpy(ats_uint16 *to, const ats_uint16 *from, ats_int32 n);

extern ats_int32 ATS_str_wstrcmp(const ats_uint16 *s1, const ats_uint16 *s2);

extern ats_int32 ATS_str_wstrncmp(const ats_uint16 *s1, const ats_uint16 *s2, ats_int32 n);

extern ats_uint16 *ATS_str_wstrcat(ats_uint16 *s1, const ats_uint16 *s2);

extern ats_uint16 *ATS_str_wstrncat(ats_uint16 *s1, const ats_uint16 *s2, ats_int32 n);

extern ats_uint16 *ATS_str_wstrchr(const ats_uint16 *s, ats_int32 c);

extern ats_uint16 *ATS_str_wstrrchr(const ats_uint16 *str, ats_int32 ch);

extern ats_uint16 *ATS_str_wstrstr(const ats_uint16 *s1, const ats_uint16 *s2 );


/*Ascii 与Unicode 的转换接口*/
extern ats_uint16 ATS_str_to_wstr(ats_uint16 *pOutBuffer, ats_uint8 *pInBuffer);

extern ats_uint16 ATS_str_n_to_wstr(ats_uint16 *pOutBuffer, ats_uint8 *pInBuffer, ats_uint32 len);

extern ats_uint16 ATS_wstr_to_str(ats_uint8 *pOutBuffer, ats_uint16 *pInBuffer);

extern ats_uint16 ATS_wstr_n_to_str(ats_uint8 *pOutBuffer, ats_uint16 *pInBuffer, ats_uint32 len);


#endif /*__ATS_STRING_H__*/
#endif /*__SKY_3DGUI__*/