ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-UUlib/uulib/fptools.h
Revision: 1.13
Committed: Fri Dec 11 20:27:00 2020 UTC (3 years, 5 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.12: +6 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
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.12 #if HAVE_GETC_UNLOCKED
35     # define FP_getc(s) getc_unlocked (s)
36     #else
37     # define FP_getc(s) getc (s)
38     #endif
39    
40     #if HAVE_FEOF_UNLOCKED
41     # define FP_feof(s) feof_unlocked (s)
42     #else
43     # define FP_feof(s) feof (s)
44     #endif
45 root 1.7
46 root 1.12 #if HAVE_FERROR_UNLOCKED
47     # define FP_ferror(s) ferror_unlocked (s)
48 root 1.7 #else
49 root 1.12 # define FP_ferror(s) ferror (s)
50 root 1.7 #endif
51    
52     #define FP_strstr(a,b) strstr (a, b)
53 root 1.5
54 root 1.12 void TOOLEXPORT FP_free (void *);
55     char * TOOLEXPORT FP_strdup (char *);
56     char * TOOLEXPORT FP_strncpy (char *, char *, int);
57 root 1.13 void * TOOLEXPORT FP_memdup (const void *, int);
58 root 1.12 int TOOLEXPORT FP_stricmp (const char *, const char *);
59     int TOOLEXPORT FP_strnicmp (const char *, const char *, int);
60     char * TOOLEXPORT FP_strrstr (char *, char *);
61     char * TOOLEXPORT FP_stoupper (char *);
62     char * TOOLEXPORT FP_stolower (char *);
63     int TOOLEXPORT FP_strmatch (char *, char *);
64     char * TOOLEXPORT FP_stristr (char *, char *);
65     char * TOOLEXPORT FP_strirstr (char *, char *);
66 root 1.13 char * TOOLEXPORT FP_strrchr (const char *, int);
67 root 1.12 char * TOOLEXPORT FP_fgets (char *, int, FILE *);
68     char * TOOLEXPORT FP_strpbrk (char *, char *);
69     char * TOOLEXPORT FP_strtok (char *, char *);
70     char * TOOLEXPORT FP_cutdir (char *);
71     char * TOOLEXPORT FP_strerror (int);
72 root 1.3 #ifndef HAVE_MKSTEMP
73 root 1.12 char * TOOLEXPORT FP_tempnam (char *, char *);
74 root 1.3 #endif /* HAVE_MKSTEMP */
75 root 1.1
76 root 1.13 /* like stgricmp, but only works when one of the strings is printable ascii */
77     /* not containing any of these characters: @`[\]^:_{|}~ */
78     int TOOLEXPORT FP_strnicmp_fast (const char *, const char *, int);
79    
80 root 1.8 #if 0 /* API differs too much between systems to make those replacements */
81 root 1.7 #if HAVE_STRCASECMP
82     # define FP_stricmp(a,b) strcasecmp (a, b)
83     #endif
84    
85     #if HAVE_STRNCASECMP
86     # define FP_strnicmp(a,b,l) strncasecmp (a, b, l)
87     #endif
88    
89     #if HAVE_STRCASESTR
90     # define FP_stristr(a,b) strcasestr (a, b)
91     #endif
92 root 1.8 #endif
93 root 1.7
94 root 1.1 #ifdef __cplusplus
95     }
96     #endif
97     #endif
98 root 1.5