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 |
root |
1.11 |
#include "ecb.h" |
25 |
|
|
|
26 |
root |
1.1 |
#ifndef TOOLEXPORT |
27 |
|
|
#define TOOLEXPORT |
28 |
|
|
#endif |
29 |
|
|
|
30 |
|
|
#ifdef __cplusplus |
31 |
|
|
extern "C" { |
32 |
|
|
#endif |
33 |
root |
1.4 |
|
34 |
root |
1.6 |
#define _FP_free FP_free |
35 |
|
|
#define _FP_strdup FP_strdup |
36 |
|
|
#define _FP_strncpy FP_strncpy |
37 |
|
|
#define _FP_memdup FP_memdup |
38 |
|
|
#define _FP_stricmp FP_stricmp |
39 |
|
|
#define _FP_strnicmp FP_strnicmp |
40 |
|
|
#define _FP_strrstr FP_strrstr |
41 |
|
|
#define _FP_stoupper FP_stoupper |
42 |
|
|
#define _FP_stolower FP_stolower |
43 |
|
|
#define _FP_strmatch FP_strmatch |
44 |
|
|
#define _FP_strstr FP_strstr |
45 |
|
|
#define _FP_stristr FP_stristr |
46 |
|
|
#define _FP_strirstr FP_strirstr |
47 |
|
|
#define _FP_strrchr FP_strrchr |
48 |
|
|
#define _FP_fgets FP_fgets |
49 |
|
|
#define _FP_strpbrk FP_strpbrk |
50 |
|
|
#define _FP_strtok FP_strtok |
51 |
|
|
#define _FP_cutdir FP_cutdir |
52 |
|
|
#define _FP_strerror FP_strerror |
53 |
|
|
#define _FP_tempnam FP_tempnam |
54 |
root |
1.7 |
#define _FP_fgetc FP_fgetc |
55 |
|
|
|
56 |
|
|
#if HAVE_FGETC_UNLOCKED |
57 |
|
|
# define FP_fgetc(s) fgetc_unlocked (s) |
58 |
|
|
#else |
59 |
|
|
# define FP_fgetc(s) fgetc (s) |
60 |
|
|
#endif |
61 |
|
|
|
62 |
|
|
#define FP_strstr(a,b) strstr (a, b) |
63 |
root |
1.5 |
|
64 |
|
|
void TOOLEXPORT _FP_free (void *); |
65 |
|
|
char * TOOLEXPORT _FP_strdup (char *); |
66 |
|
|
char * TOOLEXPORT _FP_strncpy (char *, char *, int); |
67 |
|
|
void * TOOLEXPORT _FP_memdup (void *, int); |
68 |
root |
1.9 |
int TOOLEXPORT _FP_stricmp (const char *, const char *); |
69 |
|
|
int TOOLEXPORT _FP_strnicmp (const char *, const char *, int); |
70 |
root |
1.5 |
char * TOOLEXPORT _FP_strrstr (char *, char *); |
71 |
|
|
char * TOOLEXPORT _FP_stoupper (char *); |
72 |
|
|
char * TOOLEXPORT _FP_stolower (char *); |
73 |
root |
1.9 |
int TOOLEXPORT _FP_strmatch (char *, char *); |
74 |
root |
1.5 |
char * TOOLEXPORT _FP_stristr (char *, char *); |
75 |
|
|
char * TOOLEXPORT _FP_strirstr (char *, char *); |
76 |
|
|
char * TOOLEXPORT _FP_strrchr (char *, int); |
77 |
|
|
char * TOOLEXPORT _FP_fgets (char *, int, FILE *); |
78 |
|
|
char * TOOLEXPORT _FP_strpbrk (char *, char *); |
79 |
|
|
char * TOOLEXPORT _FP_strtok (char *, char *); |
80 |
|
|
char * TOOLEXPORT _FP_cutdir (char *); |
81 |
|
|
char * TOOLEXPORT _FP_strerror (int); |
82 |
root |
1.3 |
#ifndef HAVE_MKSTEMP |
83 |
root |
1.5 |
char * TOOLEXPORT _FP_tempnam (char *, char *); |
84 |
root |
1.3 |
#endif /* HAVE_MKSTEMP */ |
85 |
root |
1.1 |
|
86 |
root |
1.8 |
#if 0 /* API differs too much between systems to make those replacements */ |
87 |
root |
1.7 |
#if HAVE_STRCASECMP |
88 |
|
|
# define FP_stricmp(a,b) strcasecmp (a, b) |
89 |
|
|
#endif |
90 |
|
|
|
91 |
|
|
#if HAVE_STRNCASECMP |
92 |
|
|
# define FP_strnicmp(a,b,l) strncasecmp (a, b, l) |
93 |
|
|
#endif |
94 |
|
|
|
95 |
|
|
#if HAVE_STRCASESTR |
96 |
|
|
# define FP_stristr(a,b) strcasestr (a, b) |
97 |
|
|
#endif |
98 |
root |
1.8 |
#endif |
99 |
root |
1.7 |
|
100 |
root |
1.1 |
#ifdef __cplusplus |
101 |
|
|
} |
102 |
|
|
#endif |
103 |
|
|
#endif |
104 |
root |
1.5 |
|