/* * Copyright (C) * Copyright (C) * * 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, see . */ #include "vmapexport.h" #include "adtfile.h" #include #include #ifdef WIN32 #define snprintf _snprintf #endif char const* GetPlainName(char const* 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; i < len-3; i++) { if (i > 0 && 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 < len; i++) name[i] |= 0x20; } void fixname2(char* name, size_t len) { for (size_t i=0; i