]> icculus.org git repositories - btb/d2x.git/blob - include/strutil.h
implement removeext, use it in dsload instead of splitpath
[btb/d2x.git] / include / strutil.h
1 /* $Id: strutil.h,v 1.14 2004-12-20 07:12:25 btb Exp $ */
2 /*
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.
13 */
14
15 #ifndef _STRUTILS_H
16 #define _STRUTILS_H
17
18 #if defined(macintosh)
19  extern int stricmp(const char *str1, const char *str2);
20  extern int strnicmp(const char *str1, const char *str2, int n);
21 #elif !defined(_WIN32)
22 # include <string.h>
23 # define stricmp(a,b) strcasecmp(a,b)
24 # define strnicmp(a,b,c) strncasecmp(a,b,c)
25 #endif
26
27 #ifdef _WIN32_WCE
28 # define stricmp _stricmp
29 # define strnicmp _strnicmp
30 # define strlwr _strlwr
31 # define strrev _strrev
32 #endif
33
34 #ifndef _WIN32
35 #ifndef __DJGPP__
36 void strupr( char *s1 );
37 void strlwr( char *s1 );
38 #endif
39
40 void strrev( char *s1 );
41 #endif
42
43 // remove extension from filename, doesn't work with paths.
44 void removeext(const char *filename, char *out);
45
46 #if !defined(__MSDOS__) && !(defined(_WIN32) && !defined(_WIN32_WCE))
47 void _splitpath(char *name, char *drive, char *path, char *base, char *ext);
48 #endif
49
50 #endif /* _STRUTILS_H */