#ifndef _KVI_WSTRING_EXTERNAL_H_
#define _KVI_WSTRING_EXTERNAL_H_

//=============================================================================
//
//   File : kvi_wstring_external.h
//   Creation date : Wed 04 Dec 2002 19:38:00 by Szymon Stefanek
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
//=============================================================================

#include "kvi_wstring_config.h"
#include "kvi_wstring_wchar.h"

#ifdef WSTRINGCONFIG_USE_KVIMALLOC
	#include "kvi_malloc.h"

	#define _WSTRING_WMALLOC(_wcharcount) (kvi_wchar_t *)kvi_malloc(sizeof(kvi_wchar_t) * (_wcharcount))
	#define _WSTRING_WREALLOC(_ptr,_wcharcount) (kvi_wchar_t *)kvi_realloc((void *)(_ptr),sizeof(kvi_wchar_t) * (_wcharcount))
	#define _WSTRING_WFREE(_ptr) kvi_free((void *)_ptr)
#else // !WSTRINGCONFIG_USE_KVIMALLOC
	#include <stdlib.h>

	#define _WSTRING_WMALLOC(_wcharcount) (kvi_wchar_t *)malloc(sizeof(kvi_wchar_t) * (_wcharcount))
	#define _WSTRING_WREALLOC(_ptr,_wcharcount) (kvi_wchar_t*)realloc((void *)(_ptr),sizeof(kvi_wchar_t) * (_wcharcount));
	#define _WSTRING_WFREE(_ptr) free((void *)_ptr)
#endif // !WSTRINGCONFIG_USE_KVIMALLOC


#ifdef WSTRINGCONFIG_USE_KVIMEMMOVE
	#include "kvi_memmove.h"

	#define _WSTRING_WMEMMOVE(_dst,_src,_len) kvi_memmoveodd((void *)(_dst),(const void *)(_src),sizeof(kvi_wchar_t) * (_len))
	#define _WSTRING_WMEMCPY(_dst,_src,_len) kvi_fastmoveodd((void *)(_dst),(const void *)(_src),sizeof(kvi_wchar_t) * (_len))
#else // !WSTRINGCONFIG_USE_KVIMEMMOVE
	#include <string.h>

	#define _WSTRING_WMEMMOVE(_dst,_src,_len) memmove((void *)(_dst),(const void *)(_src),sizeof(kvi_wchar_t) * (_len))
	#define _WSTRING_WMEMCPY(_dst,_src,_len) memcpy((void *)(_dst),(const void *)(_src),sizeof(kvi_wchar_t) * (_len))
#endif // !WSTRINGCONFIG_USE_KVIMEMMOVE

#ifdef WSTRINGCONFIG_USE_KVISTRLEN
	#include "kvi_string.h"

	#define _WSTRING_STRLEN(_str) kvi_strLen(_str)
#else // !WSTRINGCONFIG_USE_KVISTRLEN
	#include <string.h>

	#define _WSTRING_STRLEN(_str) strlen(_str)
#endif // !WSTRINGCONFIG_USE_KVISTRLEN


#endif // _KVI_WSTRING_EXTERNAL_H_
