ATS_string.h
2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
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__*/