#ifndef	V_STR_H
#define	V_STR_H

/*
 *	Paranoidal string-handling routines.
 */
#ifdef	__cplusplus
extern	"C" {
#endif	/* __cplusplus */
	/*
	 *	strCopy - analog to strncpy.
	 *	Differences:
	 *	1. Remember: third parameter is AMOUNT OF MEMORY allocated for 'dst'.
	 *	2. 'Dst' is ALWAYS terminated by null-character ('\0').
	 *	3. Strings 'dst' and 'src' can be overlapped.
	 *	4. Ifdef CHECKED_BUILD and dst==NULL, default static buffer returned.
	 */
	char_p	V_GLOBAL	strCopy(char_p dst,char_p src,
		int dest_storage_length);
	/*
	 *	strCat - analog to strncat.
	 *	Differences:
	 *	1. Strings 'dst' and 'src' can be overlapped.
	 *	2. Ifdef CHECHED_BUILD and dst==NULL, default static buffer returned.
	 */
	char_p	V_GLOBAL	strCat(char_p dst,char_p src,
		int max_chars_to_be_added);
	/*
	 * Takes lenght of 'dst' as third parameter.
	 */
	char_p	V_GLOBAL	strCat2(char *dst,char *adden,vsize_t dst_buf_len);
	/*
	 *	Strips leading whitespace from string. Returns str.
	 *	Note. Ifdef CHECHED_BUILD and str==NULL, default static buffer returned.
	 */
	char_p	V_GLOBAL	strStripLead(char_p str);
	/*
	 *	Strips trailing whitespace from string. Returns str.
	 *	Note. Ifdef CHECHED_BUILD and str==NULL, default static buffer returned.
	 */
	char_p	V_GLOBAL	strStripTrail(char_p str);
	/*
	 *	Strips both leading and trailing whitespace. Returns str.
	 *	Note. Ifdef CHECHED_BUILD and str==NULL, default static buffer returned.
	 */
	char_p	V_GLOBAL	strStripLT(char_p str);
	/*
	 *	Optionally converts dos path to unix path and appends '/' at end
	 *	if no one. Result NEVER exceed _MAX_PATH.
	 */
	char_p	V_GLOBAL	strAppendSlash(char_p path_to_check);
	/*	Analog of strdup(), but allocates memory vie memAlloc(). */
	char_p	V_GLOBAL	strDup(char *src);
	/*	Returns original string if not NULL;
	 *	otherwise returns static trash */
	char_p	V_GLOBAL	strSafe(char_p string_which_can_be_NULL);
	/* Converts string to lower case using RTL tolower() call */
	char_p	V_GLOBAL	strLower(char *str);
	/* Replaces all chars 'ch' to chars 'replace_to' */
	vboolean V_GLOBAL	strReplaceChar(char *str,char ch,char replace_to);
	/* Convert string to signed / unsigned 32-bit integer */
	vboolean V_GLOBAL	strToInt(char *str,s32_t *ret_val);
	vboolean V_GLOBAL	strToUInt(char *str,u32_t *ret_val);
	/* Wrapper for strtod(), with more intuitive interface */
	vboolean V_GLOBAL	strToFloat(char *str,vec_t *ret_val);
	/* Same as strToInt(), but uses base 16 */
	vboolean V_GLOBAL	strToHex(char *str,u32_t *ret_val);
	/* Same as strToFloat, but uses 'dot_char' in place of '.' */
	vboolean V_GLOBAL	strToFloatEx(char *str,vec_t *ret_val,char dot_char);
	/* Safe version of sprintf(buf,"%g",x) */
	vboolean V_GLOBAL	floatToStrEx(char *dest,vsize_t dest_len,
		vec_t val,char dot_char);
#ifdef	__WATCOMC__
    int strcasecmp(const char *s1,const char *s2);
	int strncasecmp(const char *s1,const char *s2,size_t n);
#endif	/* __WATCOMC__ */
#ifdef	__cplusplus
}
#endif	/* __cplusplus */

#endif	/* V_STR_H */
