//	Zinc Application Framework - Z_STRING.HPP
//	COPYRIGHT (C) 1990-1999.  All Rights Reserved.
//	Zinc Software Incorporated.  Pleasant Grove, Utah  USA

#if !defined(Z_STRING_HPP)
#define Z_STRING_HPP
#include <z_env.hpp>
#include <string.h>

#if defined(ZAF_ISO8859_1)
	ZAF_EXPORT ZafIChar *ZafStrdup(const ZafIChar *srcString);
	ZAF_EXPORT int ZafStricmp(const ZafIChar *a, const ZafIChar *b);
	ZAF_EXPORT ZafIChar *ZafStrlwr(ZafIChar *string);
	ZAF_EXPORT ZafIChar *ZafStrupr(ZafIChar *string);
	int ZAF_EXPORT ZafStrColl(const ZafIChar *s1, const ZafIChar *s2);
	int ZAF_EXPORT ZafStrXFrm(ZafIChar *s1, const ZafIChar *s2, int n);

#	define OSstrdup	strdup
#	define OSstricmp	stricmp
#	define OSstrlwr	strlwr
#	define OSstrupr	strupr
#	define strdup		ZafStrdup
#	define stricmp		ZafStricmp
#	define strlwr		ZafStrlwr
#	define strupr		ZafStrupr
#	define OSstrcoll	strcoll
#	define OSstrxfrm	strxfrm
#	define strcoll		ZafStrColl
#	define strxfrm		ZafStrXFrm

#elif defined(ZAF_UNICODE)
#	define strdup		ZafStrdup
#	define stricmp		ZafStricmp
#	define strlwr		ZafStrlwr
#	define strupr		ZafStrupr

	extern "C++" ZAF_EXPORT ZafIChar *strcpy(ZafIChar *s1, const ZafIChar *s2);
	extern "C++" ZAF_EXPORT ZafIChar *strncpy(ZafIChar *s1, const ZafIChar *s2, int n);
	extern "C++" ZAF_EXPORT ZafIChar *strcat(ZafIChar *s1, const ZafIChar *s2);
	extern "C++" ZAF_EXPORT ZafIChar *strncat(ZafIChar *s1, const ZafIChar *s2, int n);
	extern "C++" ZAF_EXPORT int strcmp(const ZafIChar *s1, const ZafIChar *s2);
	extern "C++" ZAF_EXPORT int strcoll(const ZafIChar *s1, const ZafIChar *s2);
	extern "C++" ZAF_EXPORT int strncmp(const ZafIChar *s1, const ZafIChar *s2, int n);
	extern "C++" ZAF_EXPORT int strxfrm(ZafIChar *s1, const ZafIChar *s2, int n);
	extern "C++" ZAF_EXPORT ZafIChar *strchr(const ZafIChar *s, int c);
	extern "C++" ZAF_EXPORT int strcspn(const ZafIChar *s1, const ZafIChar *s2);
	extern "C++" ZAF_EXPORT ZafIChar *strpbrk(const ZafIChar *s1, const ZafIChar *s2);
	extern "C++" ZAF_EXPORT ZafIChar *strrchr(const ZafIChar *s, int c);
	extern "C++" ZAF_EXPORT int strspn(const ZafIChar *s1, const ZafIChar *s2);
	extern "C++" ZAF_EXPORT ZafIChar *strstr(const ZafIChar *string, const ZafIChar *substring);
	extern "C++" ZAF_EXPORT ZafIChar *strtok(ZafIChar *s1, const ZafIChar *s2);
	//*** Can't overload this function (yet?)
	//*** extern "C++" ZAF_EXPORT ZafIChar *strerror(int errnum);
	extern "C++" ZAF_EXPORT int strlen(const ZafIChar *string);

	extern "C++" ZAF_EXPORT ZafIChar *strdup(const ZafIChar *srcString);
	extern "C++" ZAF_EXPORT int stricmp(const ZafIChar *a, const ZafIChar *b);
	extern "C++" ZAF_EXPORT ZafIChar *strlwr(ZafIChar *string);
	extern "C++" ZAF_EXPORT ZafIChar *strupr(ZafIChar *string);

	ZAF_EXPORT ZafIChar *DecomposeCharacter(ZafIChar val);
	ZAF_EXPORT ZafIChar *DecomposeString(const ZafIChar *str, int n = -1);
#endif

ZAF_EXPORT int streq(const ZafIChar *s1, const ZafIChar *s2);
#if defined(ZAF_UNICODE)
ZAF_EXPORT int streq(const ZafIChar *s1, const char *s2);
ZAF_EXPORT int streq(const char *s1, const char *s2);
#endif

ZAF_EXPORT int strneq(const ZafIChar *s1, const ZafIChar *s2, int n);
ZAF_EXPORT int strnicmp(const ZafIChar *a, const ZafIChar *b, int n);
ZAF_EXPORT void strrepc(ZafIChar *string, ZafIChar c, ZafIChar repc);
ZAF_EXPORT void strstrip(ZafIChar *string, ZafIChar c);

#endif

