/*-----------------------------------------------------------------------------+
|                                                                              |
|       Copyright (c), Raisonance S.A.S., 1987-2007                            |
|                                                                              |
+------------------------------------------------------------------------------+
|                                                                              |
|       File: STRING.H                                                         |
|                                                                              |
+--------------+-------+----------------------------------------------+--------+
|     DATE     |VERSION| HISTORY/CHANGES                              |   BY   |
|  (MM/DD/YY)  | VX.Y  |                                              |        |
+--------------+-------+----------------------------------------------+--------+
|   ??/??/??   |  1.0  | Initial implementation                       |   XX   |
|   11/07/02   |  1.1  | Reimplementation                             |   JR   |
|   11/29/05   |  1.2  | ST7 compiler / Pass register masks          |   SC   |
+--------------+-------+----------------------------------------------+--------+
|Purpose    :                                                                  |
|   String handling                                                            |
+-----------------------------------------------------------------------------*/

#ifndef  _STRING_H_
#define  _STRING_H_

#pragma SAVE

/* include particular files at this point */
#if defined(__RC51__)
   #include <51\MAIN_C51.h>
#elif defined(__RCMX__)
   #include <MX\MAIN_MX.h>
#elif defined(__RCXA__)
   #include <XA\MAIN_XA.h>
#elif defined(__RCST5__)
   #include <ST5\MAIN_ST5.h>
#elif defined(__RCST6__)
   #include <ST6\MAIN_ST6.h>
#elif defined(__RCST7__)
	#include <ST7\MAIN_ST7.h>
#elif defined(__RCMP__)
   #include <MP\MAIN_MP.h>
#endif

#if defined(__RCST7__)
   #define copy_size_t unsigned char
#else
   #define copy_size_t size_t
#endif

#ifndef NULL
   #define NULL 0L
#endif

extern void  LOCAL_GENERIC* memccpy (void       LOCAL_GENERIC* dest, void LOCAL_GENERIC       *src, char c, string_tvar len) reentrant;
extern void  LOCAL_GENERIC* memchr  (const void LOCAL_GENERIC* s,    string_tvar              c,    copy_size_t n) reentrant;
extern int                  memcmp  (const void LOCAL_GENERIC* s1,   const void LOCAL_GENERIC *s2,  copy_size_t n) reentrant;
extern void  LOCAL_GENERIC* memcpy  (void       LOCAL_GENERIC* dest, const void LOCAL_GENERIC *src, copy_size_t n) reentrant;
extern void  LOCAL_GENERIC* memmove (void       LOCAL_GENERIC* dest, const void LOCAL_GENERIC *src, copy_size_t n) reentrant;
extern void  LOCAL_GENERIC* memset  (const void LOCAL_GENERIC* s,    string_tvar              c,    copy_size_t n) reentrant;
extern char  LOCAL_GENERIC* strcat  (char       LOCAL_GENERIC *p1,   const char LOCAL_GENERIC *p2) reentrant;
extern char  LOCAL_GENERIC* strchr  (const char LOCAL_GENERIC *s,    string_tvar              c) reentrant;
extern int                  strcmp  (const char LOCAL_GENERIC *p1,   const char LOCAL_GENERIC *p2) reentrant;
extern char  LOCAL_GENERIC* strcpy  (char       LOCAL_GENERIC *p1,   const char LOCAL_GENERIC *p2) reentrant;
extern size_t               strcspn (const char LOCAL_GENERIC *s1,   const char LOCAL_GENERIC *s2) reentrant;
extern size_t               strlen  (const char LOCAL_GENERIC *s) reentrant;
extern char  LOCAL_GENERIC* strncat (char       LOCAL_GENERIC *p1,   const char LOCAL_GENERIC *p2,  copy_size_t n) reentrant;
extern int                  strncmp (const char LOCAL_GENERIC *p1,   const char LOCAL_GENERIC *p2,  copy_size_t n) reentrant;
extern char  LOCAL_GENERIC* strncpy (char       LOCAL_GENERIC *p1,   const char LOCAL_GENERIC *p2,  copy_size_t n) reentrant;
extern char*                strpbrk (const char LOCAL_GENERIC *s1,   const char LOCAL_GENERIC *s2) reentrant;
extern int                  strpos  (const char LOCAL_GENERIC *s,    string_tvar              c) reentrant;
extern char  LOCAL_GENERIC* strrchr (const char LOCAL_GENERIC *s,    string_tvar              c) reentrant;
extern int                  strrpos (const char LOCAL_GENERIC *s,    string_tvar              c) reentrant;
extern size_t               strspn  (const char LOCAL_GENERIC *s1,   const char LOCAL_GENERIC *s2) reentrant;
extern char  LOCAL_GENERIC* strstr  (const char LOCAL_GENERIC *s1,   const char LOCAL_GENERIC *s2) reentrant;
extern char  LOCAL_GENERIC* strtok  (char       LOCAL_GENERIC *s1,   const char LOCAL_GENERIC *s2) reentrant;


#if defined(__RCMP__)
   #include <MP\REGMASK.h>
#endif

#pragma RESTORE

#endif
