/***************************************************************************
 * FILE: string.h/cstring (String functions)
 *
 * =========================================================================
 *
 *                          Open Watcom Project
 *
 *    Copyright (c) 2002-2010 Open Watcom Contributors. All Rights Reserved.
 *    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
 *
 *    This file is automatically generated. Do not edit directly.
 *
 * =========================================================================
 *
 * Description: This header is part of the C/C++ standard library. It
 *              declares functions for manipulating null terminated arrays
 *              of characters. 
 ***************************************************************************/
#ifndef _CSTRING_INCLUDED
#define _CSTRING_INCLUDED

#ifndef _ENABLE_AUTODEPEND
 #pragma read_only_file;
#endif

#ifndef __cplusplus
 #error This header file requires C++
#endif

#ifndef _COMDEF_H_INCLUDED
 #include <_comdef.h>
#endif

extern "C" {

#ifndef _STDWCTYPE_T_DEFINED
#define _STDWCTYPE_T_DEFINED
 namespace std {
   typedef wchar_t wint_t;
   typedef wchar_t wctype_t;
 }
#endif

#ifndef _STDSIZE_T_DEFINED
#define _STDSIZE_T_DEFINED
 namespace std {
   typedef unsigned size_t;
 }
 typedef std::size_t _w_size_t;
#endif

#ifndef NULL
 #ifdef __cplusplus
  #if !defined(_M_I86) || defined(__SMALL__) || defined(__MEDIUM__)
   #define NULL 0
  #else
   #define NULL 0L
  #endif 
 #else
  #define NULL ((void *)0)
 #endif
#endif

#ifndef _NLSCMPERROR
 /* For MS compatibility, equal to INT_MAX */
 #define _NLSCMPERROR ((int)((unsigned int)~0 >> 1))
#endif

namespace std {
_WCIRTLINK extern void    *memchr( const void *__s, int __c, size_t __n );
_WCIRTLINK extern int     memcmp( const void *__s1, const void *__s2, size_t __n );
_WCIRTLINK extern void    *memcpy( void *__s1, const void *__s2, size_t __n );
_WCRTLINK  extern void    *memmove( void *__s1, const void *__s2, size_t __n );
#if defined(_M_I86)
_WCIRTLINK
#else
_WCRTLINK
#endif
           extern void    *memset( void *__s, int __c, size_t __n );
_WCIRTLINK extern char    *strcat( char *__s1, const char *__s2 );
_WCIRTLINK extern char    *strchr( const char *__s, int __c );
#if defined(_M_I86)
_WCIRTLINK
#else
_WCRTLINK
#endif
           extern int     strcmp( const char *__s1, const char *__s2 );
_WCRTLINK  extern int     strcoll( const char *__s1, const char *__s2 );
_WCIRTLINK extern char    *strcpy( char *__s1, const char *__s2 );
_WCRTLINK  extern size_t  strcspn( const char *__s1, const char *__s2 );
_WCRTLINK  extern char    *strerror( int __errnum );
_WCIRTLINK extern size_t  strlen( const char *__s );
_WCRTLINK  extern char    *strncat( char *__s1, const char *__s2, size_t __n );
_WCRTLINK  extern int     strncmp( const char *__s1, const char *__s2, size_t __n );
_WCRTLINK  extern char    *strncpy( char *__s1, const char *__s2, size_t __n );
_WCRTLINK  extern char    *strpbrk( const char *__s1, const char *__s2 );
_WCRTLINK  extern char    *strrchr( const char *__s, int __c );
_WCRTLINK  extern size_t  strspn( const char *__s1, const char *__s2 );
_WCRTLINK  extern char    *strstr( const char *__s1, const char *__s2 );
_WCRTLINK  extern char    *strtok( char *__s1, const char *__s2 );
_WCRTLINK  extern size_t  strxfrm( char *__s1, const char *__s2, size_t __n );
} // namespace std

_WCRTLINK  extern int _stricoll( const char *__s1, const char *__s2 );
_WCRTLINK  extern int _strncoll( const char *__s1, const char *__s2, _w_size_t __n );
_WCRTLINK  extern int _strnicoll( const char *__s1, const char *__s2, _w_size_t __n );

#if defined(__NT__)
_WCRTLINK extern char  *_doserror( int __oserrnum );
#endif
_WCRTLINK extern int   _memicmp( const void *__s1, const void *__s2, _w_size_t __n );
_WCRTLINK extern char  *_strdup( const char *__string );
_WCRTLINK extern char  *_strerror( const char *__s );
_WCRTLINK extern int   _stricmp( const char *__s1, const char *__s2 );
_WCRTLINK extern char  *_strlwr( char *__string );
_WCRTLINK extern int   _strnicmp( const char *__s1, const char *__s2, _w_size_t __n );
_WCRTLINK extern char  *_strnset( char *__string, int __c, _w_size_t __len );
_WCRTLINK extern char  *_strrev( char *__string );
_WCRTLINK extern char  *_strset( char *__string, int __c );
_WCRTLINK extern char  *_strupr( char *__string );

#if !defined(NO_EXT_KEYS) /* extensions enabled */

/* WATCOM's Additional Functions (non-ISO, non-POSIX) */

_WCRTLINK  extern char   *strspnp( const char *__s1, const char *__s2 );

#if !defined(_fmemccpy) || !defined(_INC_WINDOWSX)
_WCRTLINK extern void _WCFAR *_fmemccpy( void _WCFAR *__s1, const void _WCFAR *__s2, int __c, _w_size_t __n );
#endif
#if !defined(_fmemchr) || !defined(_INC_WINDOWSX)
_WCIRTLINK extern void _WCFAR *_fmemchr( const void _WCFAR *__s, int __c, _w_size_t __n );
#endif
#if !defined(_fmemcpy) || !defined(_INC_WINDOWSX)
_WCIRTLINK extern void _WCFAR *_fmemcpy( void _WCFAR *__s1, const void _WCFAR *__s2, _w_size_t __n );
#endif
#if !defined(_fmemmove) || !defined(_INC_WINDOWSX)
_WCRTLINK extern void _WCFAR *_fmemmove( void _WCFAR *__s1, const void _WCFAR *__s2, _w_size_t __n );
#endif
#if !defined(_fmemset) || !defined(_INC_WINDOWSX)
_WCIRTLINK extern void _WCFAR *_fmemset( void _WCFAR *__s, int __c, _w_size_t __n );
#endif
#if !defined(_fmemcmp) || !defined(_INC_WINDOWSX)
_WCIRTLINK extern int _fmemcmp( const void _WCFAR *__s1, const void _WCFAR *__s2, _w_size_t __n );
#endif
#if !defined(_fmemicmp) || !defined(_INC_WINDOWSX)
_WCRTLINK extern int _fmemicmp( const void _WCFAR *__s1, const void _WCFAR *__s2, _w_size_t __n );
#endif
#if !defined(_fstrcat) || !defined(_INC_WINDOWSX)
_WCIRTLINK extern char _WCFAR *_fstrcat( char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrchr) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrchr( const char _WCFAR *__s, int __c );
#endif
#if !defined(_fstrcmp) || !defined(_INC_WINDOWSX)
_WCIRTLINK extern int _fstrcmp( const char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrcpy) || !defined(_INC_WINDOWSX)
_WCIRTLINK extern char _WCFAR *_fstrcpy( char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrcspn) || !defined(_INC_WINDOWSX)
_WCRTLINK extern _w_size_t _fstrcspn( const char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrdup) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrdup( const char _WCFAR *__string );
#endif
#if !defined(_fstricmp) || !defined(_INC_WINDOWSX)
_WCRTLINK extern int _fstricmp( const char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrncat) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrncat( char _WCFAR *__s1, const char _WCFAR *__s2, _w_size_t __n );
#endif
#if !defined(_fstrlen) || !defined(_INC_WINDOWSX)
_WCIRTLINK extern _w_size_t _fstrlen( const char _WCFAR *__s );
#endif
#if !defined(_fstrlwr) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrlwr( char _WCFAR *__string );
#endif
#if !defined(_fstrncmp) || !defined(_INC_WINDOWSX)
_WCRTLINK extern int _fstrncmp( const char _WCFAR *__s1, const char _WCFAR *__s2, _w_size_t __n );
#endif
#if !defined(_fstrncpy) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrncpy( char _WCFAR *__s1, const char _WCFAR *__s2, _w_size_t __n );
#endif
#if !defined(_fstrnicmp) || !defined(_INC_WINDOWSX)
_WCRTLINK extern int _fstrnicmp( const char _WCFAR *__s1, const char _WCFAR *__s2, _w_size_t __n );
#endif
#if !defined(_fstrnset) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrnset( char _WCFAR *__string, int __c, _w_size_t __len );
#endif
#if !defined(_fstrpbrk) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrpbrk( const char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrrchr) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrrchr( const char _WCFAR *__s, int __c );
#endif
#if !defined(_fstrrev) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrrev( char _WCFAR *__string );
#endif
#if !defined(_fstrset) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrset( char _WCFAR *__string, int __c );
#endif
#if !defined(_fstrspn) || !defined(_INC_WINDOWSX)
_WCRTLINK extern _w_size_t _fstrspn( const char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrspnp) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrspnp( const char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrstr) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrstr( const char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrtok) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrtok( char _WCFAR *__s1, const char _WCFAR *__s2 );
#endif
#if !defined(_fstrupr) || !defined(_INC_WINDOWSX)
_WCRTLINK extern char _WCFAR *_fstrupr( char _WCFAR *__string );
#endif
_WCIRTLINK extern void movedata( unsigned __srcseg, unsigned __srcoff, unsigned __tgtseg, unsigned __tgtoff, unsigned __len );

_WCRTLINK extern int   bcmp( const void *__s1, const void *__s2, _w_size_t __n );
_WCRTLINK extern void  bcopy( const void *__s1, void *__s2, _w_size_t __n );
_WCRTLINK extern void  bzero( void *__s, _w_size_t __n );
_WCRTLINK extern void  *memccpy( void *__s1, const void *__s2, int __c, _w_size_t __n );
_WCRTLINK extern int   memicmp( const void *__s1, const void *__s2, _w_size_t __n );
_WCRTLINK extern int   strcmpi( const char *__s1, const char *__s2 );
_WCRTLINK extern char  *strdup( const char *__string );
_WCRTLINK extern int   stricmp( const char *__s1, const char *__s2 );
_WCRTLINK extern char  *strlwr( char *__string );
_WCRTLINK extern int   strnicmp( const char *__s1, const char *__s2, _w_size_t __n );
_WCRTLINK extern char  *strnset( char *__string, int __c, _w_size_t __len );
_WCRTLINK extern char  *strrev( char *__string );
_WCRTLINK extern char  *strset( char *__string, int __c );
_WCRTLINK extern char  *strupr( char *__string );

/* BSD 'safe' string copy functions */
_WCRTLINK extern _w_size_t strlcat( char *__s1, const char *__s2, _w_size_t __n );
_WCRTLINK extern _w_size_t strlcpy( char *__s1, const char *__s2, _w_size_t __n );

namespace std {
_WCRTLINK extern wchar_t  *wcscat( wchar_t *, const wchar_t * );
_WCRTLINK extern wchar_t  *wcschr( const wchar_t *, wint_t );
_WCRTLINK extern int      wcscmp( const wchar_t *, const wchar_t * );
_WCRTLINK extern int      wcscoll( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern wchar_t  *wcscpy( wchar_t *, const wchar_t * );
_WCRTLINK extern size_t   wcscspn( const wchar_t *, const wchar_t * );
_WCRTLINK extern size_t   wcslen( const wchar_t * );
_WCRTLINK extern wchar_t  *wcsncat( wchar_t *, const wchar_t *, size_t );
_WCRTLINK extern int      wcsncmp( const wchar_t *, const wchar_t *, size_t );
_WCRTLINK extern wchar_t  *wcsncpy( wchar_t *, const wchar_t *, size_t );
_WCRTLINK extern wchar_t  *wcspbrk( const wchar_t *, const wchar_t * );
_WCRTLINK extern wchar_t  *wcsrchr( const wchar_t *, wint_t );
_WCRTLINK extern size_t   wcsspn( const wchar_t *, const wchar_t * );
_WCRTLINK extern wchar_t  *wcsstr( const wchar_t *, const wchar_t * );
_WCRTLINK extern wchar_t  *wcstok( wchar_t *, const wchar_t *, wchar_t ** );
_WCRTLINK extern size_t   wcsxfrm( wchar_t *__s1, const wchar_t *__s2, size_t __n );
} // namespace std

_WCRTLINK extern int      wcscmpi( const wchar_t *, const wchar_t * );
_WCRTLINK extern wchar_t  *wcserror( int );
#if defined(__NT__)
_WCRTLINK extern wchar_t  *_wdoserror( int __errnum );
#endif

_WCRTLINK extern wchar_t    *_ustrtok( wchar_t *, const wchar_t * );
_WCRTLINK extern wchar_t    *_wcsnset( wchar_t *, int, _w_size_t );
_WCRTLINK extern wchar_t    *_wcsspnp( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern int        _wcsnicmp( const wchar_t *, const wchar_t *, _w_size_t );
_WCRTLINK extern wchar_t    *_wcsdup( const wchar_t * );
_WCRTLINK extern wchar_t    *_wcslwr( wchar_t * );
_WCRTLINK extern wchar_t    *_wcsupr( wchar_t * );
_WCRTLINK extern int        _wcsicmp( const wchar_t *, const wchar_t * );
_WCRTLINK extern int        _wcsicoll( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern int        _wcsncoll( const wchar_t *__s1, const wchar_t *__s2, _w_size_t __n );
_WCRTLINK extern int        _wcsnicoll( const wchar_t *__s1, const wchar_t *__s2, _w_size_t __n );
_WCRTLINK extern wchar_t    *_wcsrev( wchar_t * );
_WCRTLINK extern wchar_t    *_wcsset( wchar_t *, wchar_t );
_WCRTLINK extern wchar_t    *_wcserror( const wchar_t * );

/* BSD 'safe' wide string copy functions */
_WCRTLINK extern _w_size_t  wcslcat( wchar_t *__s1, const wchar_t *__s2, _w_size_t __n );
_WCRTLINK extern _w_size_t  wcslcpy( wchar_t *__s1, const wchar_t *__s2, _w_size_t __n );

/* Additional Functions (POSIX but non-standard in string.h) */

_WCRTLINK extern int strcasecmp( const char *__s1, const char *__s2 );
_WCRTLINK extern int strncasecmp( const char *__s1, const char *__s2, _w_size_t __n );

#endif /* extensions enabled */

#ifdef  __INLINE_FUNCTIONS__
#if !defined(NO_EXT_KEYS) /* extensions enabled */
 #pragma intrinsic(movedata,_fmemchr,_fmemcmp,_fmemcpy,_fmemset)
 #pragma intrinsic(_fstrcat,_fstrcmp,_fstrcpy,_fstrlen)
#endif /* extensions enabled */
namespace std {
  #pragma intrinsic(memchr,memcmp,memcpy,strcat,strcpy,strlen,strchr)
  #if defined(_M_I86)
    #pragma intrinsic(memset,strcmp)
  #endif
}
#endif  /* __INLINE_FUNCTIONS__ */

} /* extern "C" */

#endif
