… | |
… | |
8 | /* |
8 | /* |
9 | * Some handy, nonstandard functions. Note that the original may |
9 | * Some handy, nonstandard functions. Note that the original may |
10 | * be both faster and better. ``better'', if your compiler allows |
10 | * be both faster and better. ``better'', if your compiler allows |
11 | * cleaner use of such functions by proper use of ``const''. |
11 | * cleaner use of such functions by proper use of ``const''. |
12 | * |
12 | * |
13 | * $Id: fptools.h,v 1.6 2002/03/31 22:11:58 root Exp $ |
13 | * $Id: fptools.h,v 1.7 2009/08/24 06:15:00 root Exp $ |
14 | */ |
14 | */ |
15 | |
15 | |
16 | #ifndef FPTOOLS_H__ |
16 | #ifndef FPTOOLS_H__ |
17 | #define FPTOOLS_H__ |
17 | #define FPTOOLS_H__ |
|
|
18 | |
|
|
19 | #include <string.h> |
18 | |
20 | |
19 | typedef signed char schar; |
21 | typedef signed char schar; |
20 | typedef unsigned char uchar; |
22 | typedef unsigned char uchar; |
21 | |
23 | |
22 | #ifndef TOOLEXPORT |
24 | #ifndef TOOLEXPORT |
… | |
… | |
45 | #define _FP_strpbrk FP_strpbrk |
47 | #define _FP_strpbrk FP_strpbrk |
46 | #define _FP_strtok FP_strtok |
48 | #define _FP_strtok FP_strtok |
47 | #define _FP_cutdir FP_cutdir |
49 | #define _FP_cutdir FP_cutdir |
48 | #define _FP_strerror FP_strerror |
50 | #define _FP_strerror FP_strerror |
49 | #define _FP_tempnam FP_tempnam |
51 | #define _FP_tempnam FP_tempnam |
|
|
52 | #define _FP_fgetc FP_fgetc |
|
|
53 | |
|
|
54 | #if HAVE_FGETC_UNLOCKED |
|
|
55 | # define FP_fgetc(s) fgetc_unlocked (s) |
|
|
56 | #else |
|
|
57 | # define FP_fgetc(s) fgetc (s) |
|
|
58 | #endif |
|
|
59 | |
|
|
60 | #define FP_strstr(a,b) strstr (a, b) |
50 | |
61 | |
51 | void TOOLEXPORT _FP_free (void *); |
62 | void TOOLEXPORT _FP_free (void *); |
52 | char * TOOLEXPORT _FP_strdup (char *); |
63 | char * TOOLEXPORT _FP_strdup (char *); |
53 | char * TOOLEXPORT _FP_strncpy (char *, char *, int); |
64 | char * TOOLEXPORT _FP_strncpy (char *, char *, int); |
54 | void * TOOLEXPORT _FP_memdup (void *, int); |
65 | void * TOOLEXPORT _FP_memdup (void *, int); |
… | |
… | |
56 | int TOOLEXPORT _FP_strnicmp (char *, char *, int); |
67 | int TOOLEXPORT _FP_strnicmp (char *, char *, int); |
57 | char * TOOLEXPORT _FP_strrstr (char *, char *); |
68 | char * TOOLEXPORT _FP_strrstr (char *, char *); |
58 | char * TOOLEXPORT _FP_stoupper (char *); |
69 | char * TOOLEXPORT _FP_stoupper (char *); |
59 | char * TOOLEXPORT _FP_stolower (char *); |
70 | char * TOOLEXPORT _FP_stolower (char *); |
60 | int TOOLEXPORT _FP_strmatch (char *, char *); |
71 | int TOOLEXPORT _FP_strmatch (char *, char *); |
61 | char * TOOLEXPORT _FP_strstr (char *, char *); |
|
|
62 | char * TOOLEXPORT _FP_stristr (char *, char *); |
72 | char * TOOLEXPORT _FP_stristr (char *, char *); |
63 | char * TOOLEXPORT _FP_strirstr (char *, char *); |
73 | char * TOOLEXPORT _FP_strirstr (char *, char *); |
64 | char * TOOLEXPORT _FP_strrchr (char *, int); |
74 | char * TOOLEXPORT _FP_strrchr (char *, int); |
65 | char * TOOLEXPORT _FP_fgets (char *, int, FILE *); |
75 | char * TOOLEXPORT _FP_fgets (char *, int, FILE *); |
66 | char * TOOLEXPORT _FP_strpbrk (char *, char *); |
76 | char * TOOLEXPORT _FP_strpbrk (char *, char *); |
… | |
… | |
69 | char * TOOLEXPORT _FP_strerror (int); |
79 | char * TOOLEXPORT _FP_strerror (int); |
70 | #ifndef HAVE_MKSTEMP |
80 | #ifndef HAVE_MKSTEMP |
71 | char * TOOLEXPORT _FP_tempnam (char *, char *); |
81 | char * TOOLEXPORT _FP_tempnam (char *, char *); |
72 | #endif /* HAVE_MKSTEMP */ |
82 | #endif /* HAVE_MKSTEMP */ |
73 | |
83 | |
|
|
84 | #if HAVE_STRCASECMP |
|
|
85 | # define FP_stricmp(a,b) strcasecmp (a, b) |
|
|
86 | #endif |
|
|
87 | |
|
|
88 | #if HAVE_STRNCASECMP |
|
|
89 | # define FP_strnicmp(a,b,l) strncasecmp (a, b, l) |
|
|
90 | #endif |
|
|
91 | |
|
|
92 | #if HAVE_STRCASESTR |
|
|
93 | # define FP_stristr(a,b) strcasestr (a, b) |
|
|
94 | #endif |
|
|
95 | |
74 | #ifdef __cplusplus |
96 | #ifdef __cplusplus |
75 | } |
97 | } |
76 | #endif |
98 | #endif |
77 | #endif |
99 | #endif |
78 | |
100 | |