]>
Commit | Line | Data |
---|---|---|
ada7c492 A |
1 | /* |
2 | * Copyright (c) 2013 Apple Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * This file contains Original Code and/or Modifications of Original Code | |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. Please obtain a copy of the License at | |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
11 | * file. | |
12 | * | |
13 | * The Original Code and all software distributed under the License are | |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
18 | * Please see the License for the specific language governing rights and | |
19 | * limitations under the License. | |
20 | * | |
21 | * @APPLE_LICENSE_HEADER_END@ | |
22 | */ | |
23 | ||
24 | #ifndef _PLATFORM_STRING_H_ | |
25 | #define _PLATFORM_STRING_H_ | |
26 | ||
438624e0 | 27 | #include <_types.h> |
ada7c492 A |
28 | #include <sys/cdefs.h> |
29 | #include <Availability.h> | |
30 | #include <TargetConditionals.h> | |
438624e0 A |
31 | #include <sys/_types/_size_t.h> |
32 | #include <sys/_types/_null.h> | |
ada7c492 A |
33 | |
34 | #include <stdint.h> | |
35 | #include <sys/types.h> | |
36 | ||
37 | #define _PLATFORM_OPTIMIZED_BZERO 0 | |
38 | #define _PLATFORM_OPTIMIZED_MEMCCPY 0 | |
39 | #define _PLATFORM_OPTIMIZED_MEMCHR 0 | |
40 | #define _PLATFORM_OPTIMIZED_MEMCMP 0 | |
41 | #define _PLATFORM_OPTIMIZED_MEMMOVE 0 | |
42 | #define _PLATFORM_OPTIMIZED_MEMSET 0 | |
43 | #define _PLATFORM_OPTIMIZED_MEMSET_PATTERN4 0 | |
44 | #define _PLATFORM_OPTIMIZED_MEMSET_PATTERN8 0 | |
45 | #define _PLATFORM_OPTIMIZED_MEMSET_PATTERN16 0 | |
46 | #define _PLATFORM_OPTIMIZED_STRCHR 0 | |
47 | #define _PLATFORM_OPTIMIZED_STRCMP 0 | |
438624e0 A |
48 | #define _PLATFORM_OPTIMIZED_STRCPY 0 |
49 | #define _PLATFORM_OPTIMIZED_STRLCAT 0 | |
50 | #define _PLATFORM_OPTIMIZED_STRLCPY 0 | |
51 | #define _PLATFORM_OPTIMIZED_STRLEN 0 | |
ada7c492 | 52 | #define _PLATFORM_OPTIMIZED_STRNCMP 0 |
438624e0 A |
53 | #define _PLATFORM_OPTIMIZED_STRNCPY 0 |
54 | #define _PLATFORM_OPTIMIZED_STRNLEN 0 | |
55 | #define _PLATFORM_OPTIMIZED_STRSTR 0 | |
ada7c492 A |
56 | |
57 | /* Primitives used to implement C memory and string routines */ | |
58 | ||
59 | __BEGIN_DECLS | |
60 | ||
61 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
62 | void | |
63 | _platform_bzero(void *s, size_t n); | |
64 | ||
65 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
66 | void * | |
67 | _platform_memchr(const void *s, int c, size_t n); | |
68 | ||
69 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
70 | int | |
71 | _platform_memcmp(const void *s1, const void *s2, size_t n); | |
72 | ||
73 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
74 | void * | |
75 | _platform_memmove(void *dst, const void *src, size_t n); | |
76 | ||
77 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
78 | void * | |
438624e0 | 79 | _platform_memccpy(void *__restrict dst, const void *__restrict src, int c, size_t n); |
ada7c492 A |
80 | |
81 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
82 | void * | |
83 | _platform_memset(void *b, int c, size_t len); | |
84 | ||
85 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
86 | void | |
87 | _platform_memset_pattern4(void *b, const void *pattern4, size_t len); | |
88 | ||
89 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
90 | void | |
91 | _platform_memset_pattern8(void *b, const void *pattern8, size_t len); | |
92 | ||
93 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
94 | void | |
95 | _platform_memset_pattern16(void *b, const void *pattern16, size_t len); | |
96 | ||
97 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
98 | char * | |
99 | _platform_strchr(const char *s, int c); | |
100 | ||
101 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) | |
102 | int | |
103 | _platform_strcmp(const char *s1, const char *s2); | |
104 | ||
438624e0 A |
105 | __OSX_AVAILABLE(10.14) __IOS_AVAILABLE(12.0) __TVOS_AVAILABLE(12.0) __WATCHOS_AVAILABLE(5.0) |
106 | char * | |
107 | _platform_strcpy(char * __restrict dst, const char * __restrict src); | |
108 | ||
109 | __OSX_AVAILABLE(10.14) __IOS_AVAILABLE(12.0) __TVOS_AVAILABLE(12.0) __WATCHOS_AVAILABLE(5.0) | |
110 | size_t | |
111 | _platform_strlcat(char * __restrict dst, const char * __restrict src, size_t maxlen); | |
112 | ||
113 | __OSX_AVAILABLE(10.14) __IOS_AVAILABLE(12.0) __TVOS_AVAILABLE(12.0) __WATCHOS_AVAILABLE(5.0) | |
114 | size_t | |
115 | _platform_strlcpy(char * __restrict dst, const char * __restrict src, size_t maxlen); | |
116 | ||
117 | __OSX_AVAILABLE(10.14) __IOS_AVAILABLE(12.0) __TVOS_AVAILABLE(12.0) __WATCHOS_AVAILABLE(5.0) | |
118 | size_t | |
119 | _platform_strlen(const char *str); | |
120 | ||
ada7c492 A |
121 | __OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0) |
122 | int | |
123 | _platform_strncmp(const char *s1, const char *s2, size_t n); | |
124 | ||
438624e0 A |
125 | __OSX_AVAILABLE(10.14) __IOS_AVAILABLE(12.0) __TVOS_AVAILABLE(12.0) __WATCHOS_AVAILABLE(5.0) |
126 | char * | |
127 | _platform_strncpy(char * __restrict dst, const char * __restrict src, size_t maxlen); | |
128 | ||
129 | __OSX_AVAILABLE(10.14) __IOS_AVAILABLE(12.0) __TVOS_AVAILABLE(12.0) __WATCHOS_AVAILABLE(5.0) | |
130 | size_t | |
131 | _platform_strnlen(const char *s, size_t maxlen); | |
132 | ||
133 | __OSX_AVAILABLE(10.14) __IOS_AVAILABLE(12.0) __TVOS_AVAILABLE(12.0) __WATCHOS_AVAILABLE(5.0) | |
134 | char * | |
135 | _platform_strstr(const char *s, const char *find); | |
136 | ||
ada7c492 A |
137 | __END_DECLS |
138 | ||
139 | #endif /* _PLATFORM_STRING_H_ */ |