/*
* Copyright (C) 2005-2012 MaNGOS
*
* 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 option) 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
*/
#define _CRT_SECURE_NO_WARNINGS
#include "vmapexport.h"
#include "adtfile.h"
#include
#include
#ifdef WIN32
#define snprintf _snprintf
#endif
const char * GetPlainName(const char * FileName)
{
const char * szTemp;
if((szTemp = strrchr(FileName, '\\')) != NULL)
FileName = szTemp + 1;
return FileName;
}
char * GetPlainName(char * FileName)
{
char * szTemp;
if((szTemp = strrchr(FileName, '\\')) != NULL)
FileName = szTemp + 1;
return FileName;
}
void fixnamen(char *name, size_t len)
{
for (size_t i=0; i0 && name[i]>='A' && name[i]<='Z' && isalpha(name[i-1]))
{
name[i] |= 0x20;
} else if ((i==0 || !isalpha(name[i-1])) && name[i]>='a' && name[i]<='z')
{
name[i] &= ~0x20;
}
}
//extension in lowercase
for(size_t i=len-3; i