00001
00002
00003
00004
00005
00006 #include <windows.h>
00007 #include "common.h"
00008
00009 LPCSTR fsStrStrNoCase(LPCSTR pszIn, LPCSTR pszWhat)
00010 {
00011 UINT uLen = strlen (pszWhat);
00012
00013 if (pszIn == NULL)
00014 return NULL;
00015
00016 while (*pszIn)
00017 {
00018 if (strnicmp (pszIn, pszWhat, uLen) == 0)
00019 return pszIn;
00020 else
00021 pszIn++;
00022 }
00023
00024 return NULL;
00025 }
00026
00027 LPCSTR fsStrGetStrUpToChar (LPCSTR pszFrom, LPCSTR pszCharTo, LPSTR* ppszResult)
00028 {
00029
00030
00031
00032 int tolen = strcspn (pszFrom, pszCharTo);
00033
00034 *ppszResult = NULL;
00035
00036 if (pszFrom [tolen] == 0)
00037 {
00038
00039 return NULL;
00040 }
00041
00042 fsnew (*ppszResult, char, tolen + 1);
00043 CopyMemory (*ppszResult, pszFrom, tolen);
00044 (*ppszResult) [tolen] = 0;
00045
00046 return pszFrom + tolen + 1;
00047 }