2 * D header file for C99.
4 * $(C_HEADER_DESCRIPTION pubs.opengroup.org/onlinepubs/009695399/basedefs/_string.h.html, _string.h)
6 * Copyright: Copyright Sean Kelly 2005 - 2009.
7 * License: Distributed under the
8 * $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
9 * (See accompanying file LICENSE)
11 * Source: $(DRUNTIMESRC core/stdc/_string.d)
12 * Standards: ISO/IEC 9899:1999 (E)
15 module core
.stdc
.string
;
23 else version (WatchOS
)
26 // Those libs don't expose the mandated C interface
27 version (CRuntime_Glibc
)
28 version = ReturnStrerrorR
;
29 else version (CRuntime_UClibc
)
30 version = ReturnStrerrorR
;
37 inout(void)* memchr(return scope inout void* s
, int c
, size_t n
) pure;
39 int memcmp(scope const void* s1
, scope const void* s2
, size_t n
) pure;
41 void* memcpy(return scope void* s1
, scope const void* s2
, size_t n
) pure;
45 int memicmp(scope const char* s1
, scope const char* s2
, size_t n
);
48 void* memmove(return scope void* s1
, scope const void* s2
, size_t n
) pure;
50 void* memset(return scope void* s
, int c
, size_t n
) pure;
53 char* strcat(return scope char* s1
, scope const char* s2
) pure;
55 inout(char)* strchr(return scope inout(char)* s
, int c
) pure;
57 int strcmp(scope const char* s1
, scope const char* s2
) pure;
59 int strcoll(scope const char* s1
, scope const char* s2
);
61 char* strcpy(return scope char* s1
, scope const char* s2
) pure;
63 size_t
strcspn(scope const char* s1
, scope const char* s2
) pure;
65 char* strdup(scope const char *s
);
67 char* strndup(scope const char *str, size_t size
);
69 char* strerror(int errnum
);
70 // This `strerror_r` definition is not following the POSIX standard
71 version (ReturnStrerrorR
)
74 const(char)* strerror_r(int errnum
, return scope char* buf
, size_t buflen
);
77 else version (CRuntime_Newlib
)
80 pragma(mangle
, "__xpg_strerror_r")
81 int strerror_r(int errnum
, scope char* buf
, size_t buflen
);
86 int strerror_r(int errnum
, scope char* buf
, size_t buflen
);
89 size_t
strlen(scope const char* s
) pure;
91 char* strncat(return scope char* s1
, scope const char* s2
, size_t n
) pure;
93 int strncmp(scope const char* s1
, scope const char* s2
, size_t n
) pure;
95 char* strncpy(return scope char* s1
, scope const char* s2
, size_t n
) pure;
97 inout(char)* strpbrk(return scope inout(char)* s1
, scope const char* s2
) pure;
99 inout(char)* strrchr(return scope inout(char)* s
, int c
) pure;
101 size_t
strspn(scope const char* s1
, scope const char* s2
) pure;
103 inout(char)* strstr(return scope inout(char)* s1
, scope const char* s2
) pure;
105 char* strtok(return scope char* s1
, scope const char* s2
);
107 size_t
strxfrm(scope char* s1
, scope const char* s2
, size_t n
);