]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/i386/string-inlines.c
Update.
[thirdparty/glibc.git] / sysdeps / i386 / string-inlines.c
1 /* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
18
19 /* <bits/string.h> and <bits/string2.h> declare some extern inline
20 functions. These functions are declared additionally here if
21 inlining is not possible. */
22
23 #undef __USE_STRING_INLINES
24 #define __USE_STRING_INLINES
25 #define _FORCE_INLINES
26 #define __STRING_INLINE /* empty */
27 #define __NO_INLINE__
28
29 #include <string.h>
30 #undef index
31 #undef rindex
32
33 #undef __NO_INLINE__
34 #include <bits/string.h>
35 #include <bits/string2.h>
36
37 /* Functions which are inlines in i486 but not i386. */
38 void *
39 __memcpy_by2 (void *dest, const void *src, size_t n)
40 {
41 return memcpy (dest, src, n);
42 }
43 strong_alias (__memcpy_by2, __memcpy_by4)
44 strong_alias (__memcpy_by2, __memcpy_g)
45 strong_alias (__memcpy_by2, __memcpy_g_internal)
46
47 void *
48 __memset_ccn_by2 (void *s, unsigned int c, size_t n)
49 {
50 return memset (s, c & 0xff, n);
51 }
52 strong_alias (__memset_ccn_by2, __memset_ccn_by4)
53
54 void *
55 __memset_gcn_by2 (void *s, int c, size_t n)
56 {
57 return memset (s, c, n);
58 }
59 strong_alias (__memset_gcn_by2, __memset_gcn_by4)
60
61 size_t
62 __strlen_g (const char *s)
63 {
64 return strlen (s);
65 }
66
67 char *
68 __strcpy_g (char *d, const char *s)
69 {
70 return strcpy (d, s);
71 }
72
73 char *
74 __mempcpy_by2 (char *d, const char *s, size_t n)
75 {
76 return mempcpy (d, s, n);
77 }
78 strong_alias (__mempcpy_by2, __mempcpy_by4)
79 strong_alias (__mempcpy_by2, __mempcpy_byn)
80
81 char *
82 __stpcpy_g (char *d, const char *s)
83 {
84 return stpcpy (d, s);
85 }
86
87 char *
88 __strncpy_by2 (char *d, const char s[], size_t srclen, size_t n)
89 {
90 return strncpy (d, s, n);
91 }
92 strong_alias (__strncpy_by2, __strncpy_by4)
93 strong_alias (__strncpy_by2, __strncpy_byn)
94
95 char *
96 __strncpy_gg (char *d, const char *s, size_t n)
97 {
98 return strncpy (d, s, n);
99 }
100
101 char *
102 __strcat_c (char *d, const char s[], size_t srclen)
103 {
104 return strcat (d, s);
105 }
106
107 char *
108 __strcat_g (char *d, const char *s)
109 {
110 return strcat (d, s);
111 }
112
113 char *
114 __strncat_g (char *d, const char s[], size_t n)
115 {
116 return strncat (d, s, n);
117 }
118
119 int
120 __strcmp_gg (const char *s1, const char *s2)
121 {
122 return strcmp (s1, s2);
123 }
124
125 int
126 __strncmp_g (const char *s1, const char *s2, size_t n)
127 {
128 return strncmp (s1, s2, n);
129 }
130
131 char *
132 __strrchr_c (const char *s, int c)
133 {
134 return strrchr (s, c >> 8);
135 }
136
137 char *
138 __strrchr_g (const char *s, int c)
139 {
140 return strrchr (s, c);
141 }
142
143 size_t
144 __strcspn_cg (const char *s, const char reject[], size_t reject_len)
145 {
146 return strcspn (s, reject);
147 }
148
149 size_t
150 __strcspn_g (const char *s, const char *reject)
151 {
152 return strcspn (s, reject);
153 }
154
155 size_t
156 __strspn_cg (const char *s, const char accept[], size_t accept_len)
157 {
158 return strspn (s, accept);
159 }
160
161 size_t
162 __strspn_g (const char *s, const char *accept)
163 {
164 return strspn (s, accept);
165 }
166
167 char *
168 __strpbrk_cg (const char *s, const char accept[], size_t accept_len)
169 {
170 return strpbrk (s, accept);
171 }
172
173 char *
174 __strpbrk_g (const char *s, const char *accept)
175 {
176 return strpbrk (s, accept);
177 }
178
179 char *
180 __strstr_cg (const char *haystack, const char needle[], size_t needle_len)
181 {
182 return strstr (haystack, needle);
183 }
184
185 char *
186 __strstr_g (const char *haystack, const char needle[])
187 {
188 return strstr (haystack, needle);
189 }