//----------------------------------------------------------------
//
// NeuroChip NM6403, C++ library
// 1997-1999 (c) RC Module Inc.
// cstring,
//
//----------------------------------------------------------------

#ifndef	_CSTRING_HEADER
#define	_CSTRING_HEADER


#include <_nsstd.h>

#include <cstddef>


_NS_STD_BEGIN

#ifdef __cplusplus
extern "C" {
#endif

    // Functions that deal with memory blocks

void * memcpy(void * __dest, const void * __src, size_t __n);
void * memmove(void * __dest, const void * __src, size_t __n);
void * memset(void * __s, int __c, size_t __n);
int memcmp(const void * __s1, const void * __s2, size_t __n);

    // Functions that deal with ASCIZ strings

char * strcpy(char *__dest, const char *__src);
char * strncpy(char *__dest, const char *__src, size_t __n);
char * strcat(char *__dest, const char *__src);
char * strncat(char *__dest, const char *__src, size_t __n);
int strcmp(const char *__s1, const char *__s2);
int strncmp(const char *__s1, const char *__s2, size_t __n);
size_t	strcspn (const char *__s, const char *__reject);
size_t	strspn (const char *__s, const char *__accept);
char *  strtok  (char *__s, const char *__delim);
size_t  strlen (const char *__s);
const void * memchr(const void * __s, int __c, size_t __n);
const char* strchr (const char *__s, int __c);
const char* strrchr (const char *__s, int __c);
const char*   strpbrk (const char *__s, const char *__accept);
const char* strstr (const char *__where, const char *__what);

#ifdef __cplusplus
}
#endif

    // Changes specified by the C++ Standard

#ifdef __cplusplus

inline char* strstr (char *__where, const char *__what)
{
	return (char*)strstr((const char*)__where,__what);
}

inline char*   strpbrk (char *__s, const char *__accept)
{
	return ((char*) strpbrk((const char *)__s,__accept));
}

inline void * memchr(void * __s, int __c, size_t __n)
{
        return (void*)memchr((const void*)__s,__c,__n);
}

inline  char* strchr (char *__s, int __c)
{
        return  (char*)strchr((const char*)__s,__c);
}

inline  char* strrchr (char *__s, int __c)
{
        return  (char*)strrchr((const char*)__s,__c);
}

#endif

_NS_STD_END


#endif  // _CSTRING_HEADER
