]> git.saurik.com Git - apple/libplatform.git/blame - private/platform/string.h
libplatform-254.40.4.tar.gz
[apple/libplatform.git] / private / platform / string.h
CommitLineData
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)
62void
63_platform_bzero(void *s, size_t n);
64
65__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
66void *
67_platform_memchr(const void *s, int c, size_t n);
68
69__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
70int
71_platform_memcmp(const void *s1, const void *s2, size_t n);
72
73__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
74void *
75_platform_memmove(void *dst, const void *src, size_t n);
76
77__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
78void *
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)
82void *
83_platform_memset(void *b, int c, size_t len);
84
85__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
86void
87_platform_memset_pattern4(void *b, const void *pattern4, size_t len);
88
89__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
90void
91_platform_memset_pattern8(void *b, const void *pattern8, size_t len);
92
93__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
94void
95_platform_memset_pattern16(void *b, const void *pattern16, size_t len);
96
97__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
98char *
99_platform_strchr(const char *s, int c);
100
101__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
102int
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)
106char *
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)
110size_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)
114size_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)
118size_t
119_platform_strlen(const char *str);
120
ada7c492
A
121__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
122int
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)
126char *
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)
130size_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)
134char *
135_platform_strstr(const char *s, const char *find);
136
ada7c492
A
137__END_DECLS
138
139#endif /* _PLATFORM_STRING_H_ */