ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-UUlib/uulib/fptools.h
Revision: 1.11
Committed: Thu Feb 27 06:14:29 2020 UTC (4 years, 3 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: rel-1_71, rel-1_7
Changes since 1.10: +2 -16 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 /*
2 * fptools.c, some helper functions for getcgi.c and uu(en|de)view
3 *
4 * Distributed under the terms of the GNU General Public License.
5 * Use and be happy.
6 */
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 * $Id$
14 */
15
16 #ifndef FPTOOLS_H__
17 #define FPTOOLS_H__
18
19 #include <string.h>
20
21 typedef signed char schar;
22 typedef unsigned char uchar;
23
24 #include "ecb.h"
25
26 #ifndef TOOLEXPORT
27 #define TOOLEXPORT
28 #endif
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #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 #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
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 int TOOLEXPORT _FP_stricmp (const char *, const char *);
69 int TOOLEXPORT _FP_strnicmp (const char *, const char *, int);
70 char * TOOLEXPORT _FP_strrstr (char *, char *);
71 char * TOOLEXPORT _FP_stoupper (char *);
72 char * TOOLEXPORT _FP_stolower (char *);
73 int TOOLEXPORT _FP_strmatch (char *, char *);
74 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 #ifndef HAVE_MKSTEMP
83 char * TOOLEXPORT _FP_tempnam (char *, char *);
84 #endif /* HAVE_MKSTEMP */
85
86 #if 0 /* API differs too much between systems to make those replacements */
87 #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 #endif
99
100 #ifdef __cplusplus
101 }
102 #endif
103 #endif
104