Back to index

glibc  2.9
string-inlines.c
Go to the documentation of this file.
00001 /* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 /*  <bits/string.h> and <bits/string2.h> declare some extern inline
00020     functions.  These functions are declared additionally here if
00021     inlining is not possible.  */
00022 
00023 #undef __USE_STRING_INLINES
00024 #define __USE_STRING_INLINES
00025 #define _FORCE_INLINES
00026 #define __STRING_INLINE /* empty */
00027 #define __NO_INLINE__
00028 
00029 #include <string.h>
00030 #undef index
00031 #undef rindex
00032 
00033 #undef __NO_INLINE__
00034 #include <bits/string.h>
00035 #include <bits/string2.h>
00036 
00037 /* Functions which are inlines in i486 but not i386.  */
00038 void *
00039 __memcpy_by2 (void *dest, const void *src, size_t n)
00040 {
00041   return memcpy (dest, src, n);
00042 }
00043 strong_alias (__memcpy_by2, __memcpy_by4)
00044 strong_alias (__memcpy_by2, __memcpy_g)
00045 strong_alias (__memcpy_by2, __memcpy_g_internal)
00046 
00047 void *
00048 __memset_ccn_by2 (void *s, unsigned int c, size_t n)
00049 {
00050   return memset (s, c & 0xff, n);
00051 }
00052 strong_alias (__memset_ccn_by2, __memset_ccn_by4)
00053 
00054 void *
00055 __memset_gcn_by2 (void *s, int c, size_t n)
00056 {
00057   return memset (s, c, n);
00058 }
00059 strong_alias (__memset_gcn_by2, __memset_gcn_by4)
00060 
00061 size_t
00062 __strlen_g (const char *s)
00063 {
00064   return strlen (s);
00065 }
00066 
00067 char *
00068 __strcpy_g (char *d, const char *s)
00069 {
00070   return strcpy (d, s);
00071 }
00072 
00073 char *
00074 __mempcpy_by2 (char *d, const char *s, size_t n)
00075 {
00076   return mempcpy (d, s, n);
00077 }
00078 strong_alias (__mempcpy_by2, __mempcpy_by4)
00079 strong_alias (__mempcpy_by2, __mempcpy_byn)
00080 
00081 char *
00082 __stpcpy_g (char *d, const char *s)
00083 {
00084   return stpcpy (d, s);
00085 }
00086 
00087 char *
00088 __strncpy_by2 (char *d, const char s[], size_t srclen, size_t n)
00089 {
00090   return strncpy (d, s, n);
00091 }
00092 strong_alias (__strncpy_by2, __strncpy_by4)
00093 strong_alias (__strncpy_by2, __strncpy_byn)
00094 
00095 char *
00096 __strncpy_gg (char *d, const char *s, size_t n)
00097 {
00098   return strncpy (d, s, n);
00099 }
00100 
00101 char *
00102 __strcat_c (char *d, const char s[], size_t srclen)
00103 {
00104   return strcat (d, s);
00105 }
00106 
00107 char *
00108 __strcat_g (char *d, const char *s)
00109 {
00110   return strcat (d, s);
00111 }
00112 
00113 char *
00114 __strncat_g (char *d, const char s[], size_t n)
00115 {
00116   return strncat (d, s, n);
00117 }
00118 
00119 int
00120 __strcmp_gg (const char *s1, const char *s2)
00121 {
00122   return strcmp (s1, s2);
00123 }
00124 
00125 int
00126 __strncmp_g (const char *s1, const char *s2, size_t n)
00127 {
00128   return strncmp (s1, s2, n);
00129 }
00130 
00131 char *
00132 __strrchr_c (const char *s, int c)
00133 {
00134   return strrchr (s, c >> 8);
00135 }
00136 
00137 char *
00138 __strrchr_g (const char *s, int c)
00139 {
00140   return strrchr (s, c);
00141 }
00142 
00143 size_t
00144 __strcspn_cg (const char *s, const char reject[], size_t reject_len)
00145 {
00146   return strcspn (s, reject);
00147 }
00148 
00149 size_t
00150 __strcspn_g (const char *s, const char *reject)
00151 {
00152   return strcspn (s, reject);
00153 }
00154 
00155 size_t
00156 __strspn_cg (const char *s, const char accept[], size_t accept_len)
00157 {
00158   return strspn (s, accept);
00159 }
00160 
00161 size_t
00162 __strspn_g (const char *s, const char *accept)
00163 {
00164   return strspn (s, accept);
00165 }
00166 
00167 char *
00168 __strpbrk_cg (const char *s, const char accept[], size_t accept_len)
00169 {
00170   return strpbrk (s, accept);
00171 }
00172 
00173 char *
00174 __strpbrk_g (const char *s, const char *accept)
00175 {
00176   return strpbrk (s, accept);
00177 }
00178 
00179 char *
00180 __strstr_cg (const char *haystack, const char needle[], size_t needle_len)
00181 {
00182   return strstr (haystack, needle);
00183 }
00184 
00185 char *
00186 __strstr_g (const char *haystack, const char needle[])
00187 {
00188   return strstr (haystack, needle);
00189 }