3 const char *NullToEmpty(const char *Str)
5 return(Str==NULL ? "":Str);
9 const wchar *NullToEmpty(const wchar *Str)
11 return(Str==NULL ? L"":Str);
15 char *IntNameToExt(const char *Name)
17 static char OutName[NM];
18 IntToExt(Name,OutName);
23 void ExtToInt(const char *Src,char *Dest)
34 void IntToExt(const char *Src,char *Dest)
45 char* strlower(char *Str)
48 CharLower((LPTSTR)Str);
50 for (char *ChPtr=Str;*ChPtr;ChPtr++)
51 *ChPtr=(char)loctolower(*ChPtr);
57 char* strupper(char *Str)
60 CharUpper((LPTSTR)Str);
62 for (char *ChPtr=Str;*ChPtr;ChPtr++)
63 *ChPtr=(char)loctoupper(*ChPtr);
69 int stricomp(const char *Str1,const char *Str2)
71 char S1[NM*2],S2[NM*2];
72 strncpy(S1,Str1,sizeof(S1));
73 strncpy(S2,Str2,sizeof(S2));
74 return(strcmp(strupper(S1),strupper(S2)));
78 int strnicomp(const char *Str1,const char *Str2,int N)
81 strncpy(S1,Str1,sizeof(S1));
82 strncpy(S2,Str2,sizeof(S2));
83 return(strncmp(strupper(S1),strupper(S2),N));
87 char* RemoveEOL(char *Str)
89 for (int I=strlen(Str)-1;I>=0 && (Str[I]=='\r' || Str[I]=='\n' || Str[I]==' ' || Str[I]=='\t');I--)
95 char* RemoveLF(char *Str)
97 for (int I=strlen(Str)-1;I>=0 && (Str[I]=='\r' || Str[I]=='\n');I--)
103 unsigned int loctolower(byte ch)
106 return((int)CharLower((LPTSTR)ch));
113 unsigned int loctoupper(byte ch)
116 return((int)CharUpper((LPTSTR)ch));
126 bool LowAscii(const char *Str)
128 for (int I=0;Str[I]!=0;I++)
129 if ((byte)Str[I]<32 || (byte)Str[I]>127)
135 bool LowAscii(const wchar *Str)
137 for (int I=0;Str[I]!=0;I++)
138 if (Str[I]<32 || Str[I]>127)