File: fptools.h

package info (click to toggle)
libconvert-uulib-perl 1%3A1.4~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 652 kB
  • ctags: 505
  • sloc: ansic: 8,151; perl: 145; makefile: 51; awk: 13
file content (102 lines) | stat: -rw-r--r-- 2,615 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
 * fptools.c, some helper functions for getcgi.c and uu(en|de)view
 *
 * Distributed under the terms of the GNU General Public License.
 * Use and be happy.
 */

/*
 * Some handy, nonstandard functions. Note that the original may
 * be both faster and better. ``better'', if your compiler allows
 * cleaner use of such functions by proper use of ``const''.
 *
 * $Id$
 */

#ifndef FPTOOLS_H__
#define FPTOOLS_H__

#include <string.h>

typedef signed char schar;
typedef unsigned char uchar;

#ifndef TOOLEXPORT
#define TOOLEXPORT
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define _FP_free	FP_free
#define _FP_strdup	FP_strdup
#define _FP_strncpy	FP_strncpy
#define _FP_memdup	FP_memdup
#define _FP_stricmp	FP_stricmp
#define _FP_strnicmp	FP_strnicmp
#define _FP_strrstr	FP_strrstr
#define _FP_stoupper	FP_stoupper
#define _FP_stolower	FP_stolower
#define _FP_strmatch	FP_strmatch
#define _FP_strstr	FP_strstr
#define _FP_stristr	FP_stristr
#define _FP_strirstr	FP_strirstr
#define _FP_strrchr	FP_strrchr
#define _FP_fgets	FP_fgets
#define _FP_strpbrk	FP_strpbrk
#define _FP_strtok	FP_strtok
#define _FP_cutdir	FP_cutdir
#define _FP_strerror	FP_strerror
#define _FP_tempnam	FP_tempnam
#define _FP_fgetc	FP_fgetc

#if HAVE_FGETC_UNLOCKED
# define FP_fgetc(s) fgetc_unlocked (s)
#else
# define FP_fgetc(s) fgetc (s)
#endif

#define FP_strstr(a,b) strstr (a, b)

void	TOOLEXPORT	_FP_free	(void *);
char *	TOOLEXPORT	_FP_strdup	(char *);
char *	TOOLEXPORT	_FP_strncpy	(char *, char *, int);
void *	TOOLEXPORT	_FP_memdup	(void *, int);
int 	TOOLEXPORT	_FP_stricmp	(char *, char *);
int 	TOOLEXPORT	_FP_strnicmp	(char *, char *, int);
char *	TOOLEXPORT	_FP_strrstr	(char *, char *);
char *	TOOLEXPORT	_FP_stoupper	(char *);
char *	TOOLEXPORT	_FP_stolower	(char *);
int 	TOOLEXPORT	_FP_strmatch	(char *, char *);
char *	TOOLEXPORT	_FP_stristr	(char *, char *);
char *	TOOLEXPORT	_FP_strirstr	(char *, char *);
char *	TOOLEXPORT	_FP_strrchr	(char *, int);
char *	TOOLEXPORT	_FP_fgets	(char *, int, FILE *);
char *	TOOLEXPORT	_FP_strpbrk	(char *, char *);
char *	TOOLEXPORT	_FP_strtok	(char *, char *);
char *	TOOLEXPORT	_FP_cutdir	(char *);
char *	TOOLEXPORT	_FP_strerror	(int);
#ifndef HAVE_MKSTEMP
char *	TOOLEXPORT	_FP_tempnam	(char *, char *);
#endif /* HAVE_MKSTEMP */

#if 0 /* API differs too much between systems to make those replacements */
#if HAVE_STRCASECMP
# define FP_stricmp(a,b) strcasecmp (a, b)
#endif

#if HAVE_STRNCASECMP
# define FP_strnicmp(a,b,l) strncasecmp (a, b, l)
#endif

#if HAVE_STRCASESTR
# define FP_stristr(a,b) strcasestr (a, b)
#endif
#endif

#ifdef __cplusplus
}
#endif
#endif