Go to the documentation of this file.
7 #ifndef _S390_STRING_H_
8 #define _S390_STRING_H_
10 #ifndef _LINUX_TYPES_H
11 #include <linux/types.h>
14 #define __HAVE_ARCH_MEMCHR
15 #define __HAVE_ARCH_MEMCMP
16 #define __HAVE_ARCH_MEMCPY
17 #define __HAVE_ARCH_MEMSCAN
18 #define __HAVE_ARCH_MEMSET
19 #define __HAVE_ARCH_STRCAT
20 #define __HAVE_ARCH_STRCMP
21 #define __HAVE_ARCH_STRCPY
22 #define __HAVE_ARCH_STRLCAT
23 #define __HAVE_ARCH_STRLCPY
24 #define __HAVE_ARCH_STRLEN
25 #define __HAVE_ARCH_STRNCAT
26 #define __HAVE_ARCH_STRNCPY
27 #define __HAVE_ARCH_STRNLEN
28 #define __HAVE_ARCH_STRRCHR
29 #define __HAVE_ARCH_STRSTR
32 extern int memcmp(
const void *,
const void *,
size_t);
33 extern void *
memcpy(
void *,
const void *,
size_t);
34 extern void *
memset(
void *,
int,
size_t);
35 extern int strcmp(
const char *,
const char *);
36 extern size_t strlcat(
char *,
const char *,
size_t);
37 extern size_t strlcpy(
char *,
const char *,
size_t);
38 extern char *
strncat(
char *,
const char *,
size_t);
39 extern char *
strncpy(
char *,
const char *,
size_t);
40 extern char *
strrchr(
const char *,
int);
41 extern char *
strstr(
const char *,
const char *);
43 #undef __HAVE_ARCH_MEMMOVE
44 #undef __HAVE_ARCH_STRCHR
45 #undef __HAVE_ARCH_STRNCHR
46 #undef __HAVE_ARCH_STRNCMP
47 #undef __HAVE_ARCH_STRNICMP
48 #undef __HAVE_ARCH_STRPBRK
49 #undef __HAVE_ARCH_STRSEP
50 #undef __HAVE_ARCH_STRSPN
52 #if !defined(IN_ARCH_STRING_C)
54 static inline void *
memchr(
const void *
s,
int c,
size_t n)
56 register int r0 asm(
"0") = (
char) c;
69 static
inline void *memscan(
void *s,
int c,
size_t n)
71 register int r0 asm(
"0") = (
char) c;
72 const void *ret = s + n;
77 : "+
a" (ret), "+&
a" (s) : "
d" (
r0) : "cc");
83 register int r0 asm(
"0") = 0;
92 :
"=&a" (
dummy),
"+a" (dst),
"+a" (
src)
93 :
"d" (
r0),
"0" (0) :
"cc",
"memory" );
97 static inline char *
strcpy(
char *dst,
const char *src)
99 register int r0 asm(
"0") = 0;
105 :
"+&a" (
dst),
"+&a" (src) :
"d" (
r0)
110 static inline size_t strlen(
const char *s)
112 register unsigned long r0 asm(
"0") = 0;
118 :
"+d" (
r0),
"+a" (tmp) : :
"cc");
119 return r0 - (
unsigned long) s;
122 static inline size_t strnlen(
const char * s,
size_t n)
124 register int r0 asm(
"0") = 0;
126 const char *
end = s +
n;
131 :
"+a" (
end),
"+a" (tmp) :
"d" (
r0) :
"cc");
135 void *
memchr(
const void * s,
int c,
size_t n);
136 void *memscan(
void *s,
int c,
size_t n);
137 char *
strcat(
char *dst,
const char *src);
138 char *
strcpy(
char *dst,
const char *src);
139 size_t strlen(
const char *s);
140 size_t strnlen(
const char * s,
size_t n);