#ifndef _MSL_CSTRING
#define _MSL_CSTRING

#include <ansi_params.h>

#if !_MSL_USING_MW_C_HEADERS
    #include <string.h>

    #if _MSL_PUT_THIRD_PARTY_C_IN_STD
        #include <msl_cpp_std_string.h>
    #endif
#elif defined(__PALMOS_TRAPS__)
    #include <cstring_Palm_OS>
#else

#include <null.h>
#include <size_t.h>
#include <msl_secure.h>
#include <msl_rsize_t.h>

#if _MSL_NEEDS_EXTRAS
    #include <extras_string.h>
#endif

#ifndef RC_INVOKED

#include <string_api.h>

_MSL_BEGIN_NAMESPACE_STD
_MSL_BEGIN_EXTERN_C

_MSL_IMP_EXP_C void * _MSL_CDECL memset(void *, int, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C int _MSL_CDECL memcmp(const void *, const void *, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C void * _MSL_CDECL memcpy(void * _MSL_RESTRICT, const void * _MSL_RESTRICT, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C void * _MSL_CDECL memmove(void *, const void *, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C size_t _MSL_CDECL strlen(const char *) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strcpy(char * _MSL_RESTRICT, const char * _MSL_RESTRICT) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strncpy(char * _MSL_RESTRICT, const char * _MSL_RESTRICT, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strcat(char * _MSL_RESTRICT, const char * _MSL_RESTRICT) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strncat(char * _MSL_RESTRICT, const char * _MSL_RESTRICT, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C int _MSL_CDECL strcmp(const char *, const char *) _MSL_CANT_THROW;
_MSL_IMP_EXP_C int _MSL_CDECL strncmp(const char *, const char *, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C int _MSL_CDECL strcoll(const char *, const char *) _MSL_CANT_THROW;
_MSL_IMP_EXP_C size_t _MSL_CDECL strxfrm(char * _MSL_RESTRICT, const char * _MSL_RESTRICT, size_t) _MSL_CANT_THROW;
#if !defined(__cplusplus) || __embedded_cplusplus != 0
_MSL_IMP_EXP_C void * _MSL_CDECL memchr(const void *, int, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strchr(const char *, int) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strpbrk(const char *, const char *) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strrchr(const char *, int) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strstr(const char *, const char *) _MSL_CANT_THROW;
#else
_MSL_IMP_EXP_C const void * _MSL_CDECL memchr(const void *, int, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C const char * _MSL_CDECL strchr(const char *, int) _MSL_CANT_THROW;
_MSL_IMP_EXP_C const char * _MSL_CDECL strpbrk(const char *, const char *) _MSL_CANT_THROW;
_MSL_IMP_EXP_C const char * _MSL_CDECL strrchr(const char *, int) _MSL_CANT_THROW;
_MSL_IMP_EXP_C const char * _MSL_CDECL strstr(const char *, const char *) _MSL_CANT_THROW;
#endif
_MSL_IMP_EXP_C size_t _MSL_CDECL strspn(const char *, const char *) _MSL_CANT_THROW;
_MSL_IMP_EXP_C size_t _MSL_CDECL strcspn(const char *, const char *) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strtok(char * _MSL_RESTRICT, const char * _MSL_RESTRICT) _MSL_CANT_THROW;
_MSL_IMP_EXP_C char * _MSL_CDECL strerror(int) _MSL_CANT_THROW;

#if defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__
_MSL_IMP_EXP_C errno_t _MSL_CDECL memcpy_s(void * _MSL_RESTRICT, rsize_t, const void * _MSL_RESTRICT, rsize_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C errno_t _MSL_CDECL memmove_s(void *, rsize_t, const void *, rsize_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C size_t _MSL_CDECL strnlen_s(const char *, size_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C errno_t _MSL_CDECL strcpy_s(char * _MSL_RESTRICT, rsize_t, const char * _MSL_RESTRICT) _MSL_CANT_THROW;
_MSL_IMP_EXP_C errno_t _MSL_CDECL strncpy_s(char * _MSL_RESTRICT, rsize_t, const char * _MSL_RESTRICT, rsize_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C errno_t _MSL_CDECL strcat_s(char * _MSL_RESTRICT, rsize_t, const char * _MSL_RESTRICT) _MSL_CANT_THROW;
_MSL_IMP_EXP_C errno_t _MSL_CDECL strncat_s(char * _MSL_RESTRICT, rsize_t, const char * _MSL_RESTRICT, rsize_t) _MSL_CANT_THROW;
_MSL_IMP_EXP_C errno_t _MSL_CDECL strerror_s(char *, rsize_t, errno_t) _MSL_CANT_THROW;

_MSL_IMP_EXP_C char * _MSL_CDECL strtok_s(char * _MSL_RESTRICT, const char * _MSL_RESTRICT, char * * _MSL_RESTRICT) _MSL_CANT_THROW;
#endif

_MSL_END_EXTERN_C

#if defined(__cplusplus) && __embedded_cplusplus == 0

extern "C++" {
inline
char * _MSL_CDECL strchr (char * s, int c) _MSL_CANT_THROW {
    return const_cast<char *>(strchr(static_cast<const char *>(s), c));
}

inline
char * _MSL_CDECL strpbrk (char * s1, const char * s2) _MSL_CANT_THROW {
    return const_cast<char *>(strpbrk(static_cast<const char *>(s1), s2));
}

inline
char * _MSL_CDECL strrchr (char * s, int c) _MSL_CANT_THROW {
    return const_cast<char *>(strrchr(static_cast<const char *>(s), c));
}

inline
char * _MSL_CDECL strstr (char * s1, const char * s2) _MSL_CANT_THROW {
    return const_cast<char *>(strstr(static_cast<const char *>(s1), s2));
}

inline
void * _MSL_CDECL memchr (void * s, int c, size_t n) _MSL_CANT_THROW {
    return const_cast<void *>(memchr(static_cast<const void *>(s), c, n));
}
}

#endif

_MSL_END_NAMESPACE_STD

#if (defined(__MC68K__) && __embedded__)
    #include <string.68k.h>
#endif

#endif

#endif

#endif
