1 |
root |
1.1 |
/* |
2 |
|
|
* fptools.c, some helper functions for getcgi.c and uu(en|de)view |
3 |
|
|
* |
4 |
root |
1.2 |
* Distributed under the terms of the GNU General Public License. |
5 |
|
|
* Use and be happy. |
6 |
root |
1.1 |
*/ |
7 |
|
|
|
8 |
|
|
/* |
9 |
|
|
* Some handy, nonstandard functions. Note that the original may |
10 |
|
|
* be both faster and better. ``better'', if your compiler allows |
11 |
|
|
* cleaner use of such functions by proper use of ``const''. |
12 |
|
|
* |
13 |
root |
1.7 |
* $Id$ |
14 |
root |
1.1 |
*/ |
15 |
|
|
|
16 |
|
|
#ifndef FPTOOLS_H__ |
17 |
|
|
#define FPTOOLS_H__ |
18 |
|
|
|
19 |
root |
1.7 |
#include <string.h> |
20 |
|
|
|
21 |
root |
1.1 |
typedef signed char schar; |
22 |
|
|
typedef unsigned char uchar; |
23 |
|
|
|
24 |
|
|
#ifndef TOOLEXPORT |
25 |
|
|
#define TOOLEXPORT |
26 |
|
|
#endif |
27 |
|
|
|
28 |
|
|
#ifdef __cplusplus |
29 |
|
|
extern "C" { |
30 |
|
|
#endif |
31 |
root |
1.4 |
|
32 |
root |
1.6 |
#define _FP_free FP_free |
33 |
|
|
#define _FP_strdup FP_strdup |
34 |
|
|
#define _FP_strncpy FP_strncpy |
35 |
|
|
#define _FP_memdup FP_memdup |
36 |
|
|
#define _FP_stricmp FP_stricmp |
37 |
|
|
#define _FP_strnicmp FP_strnicmp |
38 |
|
|
#define _FP_strrstr FP_strrstr |
39 |
|
|
#define _FP_stoupper FP_stoupper |
40 |
|
|
#define _FP_stolower FP_stolower |
41 |
|
|
#define _FP_strmatch FP_strmatch |
42 |
|
|
#define _FP_strstr FP_strstr |
43 |
|
|
#define _FP_stristr FP_stristr |
44 |
|
|
#define _FP_strirstr FP_strirstr |
45 |
|
|
#define _FP_strrchr FP_strrchr |
46 |
|
|
#define _FP_fgets FP_fgets |
47 |
|
|
#define _FP_strpbrk FP_strpbrk |
48 |
|
|
#define _FP_strtok FP_strtok |
49 |
|
|
#define _FP_cutdir FP_cutdir |
50 |
|
|
#define _FP_strerror FP_strerror |
51 |
|
|
#define _FP_tempnam FP_tempnam |
52 |
root |
1.7 |
#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) |
61 |
root |
1.5 |
|
62 |
|
|
void TOOLEXPORT _FP_free (void *); |
63 |
|
|
char * TOOLEXPORT _FP_strdup (char *); |
64 |
|
|
char * TOOLEXPORT _FP_strncpy (char *, char *, int); |
65 |
|
|
void * TOOLEXPORT _FP_memdup (void *, int); |
66 |
|
|
int TOOLEXPORT _FP_stricmp (char *, char *); |
67 |
|
|
int TOOLEXPORT _FP_strnicmp (char *, char *, int); |
68 |
|
|
char * TOOLEXPORT _FP_strrstr (char *, char *); |
69 |
|
|
char * TOOLEXPORT _FP_stoupper (char *); |
70 |
|
|
char * TOOLEXPORT _FP_stolower (char *); |
71 |
|
|
int TOOLEXPORT _FP_strmatch (char *, char *); |
72 |
|
|
char * TOOLEXPORT _FP_stristr (char *, char *); |
73 |
|
|
char * TOOLEXPORT _FP_strirstr (char *, char *); |
74 |
|
|
char * TOOLEXPORT _FP_strrchr (char *, int); |
75 |
|
|
char * TOOLEXPORT _FP_fgets (char *, int, FILE *); |
76 |
|
|
char * TOOLEXPORT _FP_strpbrk (char *, char *); |
77 |
|
|
char * TOOLEXPORT _FP_strtok (char *, char *); |
78 |
|
|
char * TOOLEXPORT _FP_cutdir (char *); |
79 |
|
|
char * TOOLEXPORT _FP_strerror (int); |
80 |
root |
1.3 |
#ifndef HAVE_MKSTEMP |
81 |
root |
1.5 |
char * TOOLEXPORT _FP_tempnam (char *, char *); |
82 |
root |
1.3 |
#endif /* HAVE_MKSTEMP */ |
83 |
root |
1.1 |
|
84 |
root |
1.7 |
#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 |
|
|
|
96 |
root |
1.1 |
#ifdef __cplusplus |
97 |
|
|
} |
98 |
|
|
#endif |
99 |
|
|
#endif |
100 |
root |
1.5 |
|