1/** 2 * D header file for C99. 3 * 4 * $(C_HEADER_DESCRIPTION pubs.opengroup.org/onlinepubs/009695399/basedefs/_string.h.html, _string.h) 5 * 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) 10 * Authors: Sean Kelly 11 * Source: $(DRUNTIMESRC core/stdc/_string.d) 12 * Standards: ISO/IEC 9899:1999 (E) 13 */ 14 15module core.stdc.string; 16 17version (OSX) 18 version = Darwin; 19else version (iOS) 20 version = Darwin; 21else version (TVOS) 22 version = Darwin; 23else version (WatchOS) 24 version = Darwin; 25 26// Those libs don't expose the mandated C interface 27version (CRuntime_Glibc) 28 version = ReturnStrerrorR; 29else version (CRuntime_UClibc) 30 version = ReturnStrerrorR; 31 32extern (C): 33@system: 34nothrow: 35@nogc: 36 37/// 38inout(void)* memchr(return scope inout void* s, int c, size_t n) pure; 39/// 40int memcmp(scope const void* s1, scope const void* s2, size_t n) pure; 41/// 42void* memcpy(return scope void* s1, scope const void* s2, size_t n) pure; 43version (Windows) 44{ 45 /// 46 int memicmp(scope const char* s1, scope const char* s2, size_t n); 47} 48/// 49void* memmove(return scope void* s1, scope const void* s2, size_t n) pure; 50/// 51void* memset(return scope void* s, int c, size_t n) pure; 52 53/// 54char* strcat(return scope char* s1, scope const char* s2) pure; 55/// 56inout(char)* strchr(return scope inout(char)* s, int c) pure; 57/// 58int strcmp(scope const char* s1, scope const char* s2) pure; 59/// 60int strcoll(scope const char* s1, scope const char* s2); 61/// 62char* strcpy(return scope char* s1, scope const char* s2) pure; 63/// 64size_t strcspn(scope const char* s1, scope const char* s2) pure; 65/// 66char* strdup(scope const char *s); 67/// 68char* strerror(int errnum); 69// This `strerror_r` definition is not following the POSIX standard 70version (ReturnStrerrorR) 71{ 72 /// 73 const(char)* strerror_r(int errnum, return scope char* buf, size_t buflen); 74} 75// This one is 76else 77{ 78 int strerror_r(int errnum, scope char* buf, size_t buflen); 79} 80/// 81size_t strlen(scope const char* s) pure; 82/// 83char* strncat(return scope char* s1, scope const char* s2, size_t n) pure; 84/// 85int strncmp(scope const char* s1, scope const char* s2, size_t n) pure; 86/// 87char* strncpy(return scope char* s1, scope const char* s2, size_t n) pure; 88/// 89inout(char)* strpbrk(return scope inout(char)* s1, scope const char* s2) pure; 90/// 91inout(char)* strrchr(return scope inout(char)* s, int c) pure; 92/// 93size_t strspn(scope const char* s1, scope const char* s2) pure; 94/// 95inout(char)* strstr(return scope inout(char)* s1, scope const char* s2) pure; 96/// 97char* strtok(return scope char* s1, scope const char* s2); 98/// 99size_t strxfrm(scope char* s1, scope const char* s2, size_t n); 100