1 /* $Id: strutil.c,v 1.8 2003-02-18 20:35:35 btb Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
28 // string compare without regard to case
30 int stricmp( char *s1, char *s2 )
33 if ( tolower(*s1) != tolower(*s2) ) return 1;
37 if ( *s1 || *s2 ) return 1;
41 int strnicmp( char *s1, char *s2, int n )
43 while( *s1 && *s2 && n) {
44 if ( tolower(*s1) != tolower(*s2) ) return 1;
56 void strlwr( char *s1 )
64 void strupr( char *s1 )
74 void strrev( char *s1 )
78 t = s1 + strlen(s1) - 1;
87 void _splitpath(char *name, char *drive, char *path, char *base, char *ext)
105 s = strrchr(p, '\\');
142 char drive[10], path[50], name[16], ext[5];
144 drive[0] = path[0] = name[0] = ext[0] = '\0';
145 _splitpath("f:\\tmp\\x.out", drive, path, name, ext);
146 drive[0] = path[0] = name[0] = ext[0] = '\0';
147 _splitpath("tmp\\x.out", drive, path, name, ext);
148 drive[0] = path[0] = name[0] = ext[0] = '\0';
149 _splitpath("f:\\tmp\\a.out", NULL, NULL, name, NULL);
150 drive[0] = path[0] = name[0] = ext[0] = '\0';
151 _splitpath("tmp\\*.dem", drive, path, NULL, NULL);
152 drive[0] = path[0] = name[0] = ext[0] = '\0';
153 _splitpath(".\\tmp\\*.dem", drive, path, NULL, NULL);