… | |
… | |
8 | /* |
8 | /* |
9 | * Some handy, nonstandard functions. Note that the original may |
9 | * Some handy, nonstandard functions. Note that the original may |
10 | * be both faster and better. ``better'', if your compiler allows |
10 | * be both faster and better. ``better'', if your compiler allows |
11 | * cleaner use of such functions by proper use of ``const''. |
11 | * cleaner use of such functions by proper use of ``const''. |
12 | * |
12 | * |
13 | * $Id: fptools.h,v 1.14 2020/12/11 21:59:30 root Exp $ |
13 | * $Id: fptools.h,v 1.15 2020/12/12 03:55:00 root Exp $ |
14 | */ |
14 | */ |
15 | |
15 | |
16 | #ifndef FPTOOLS_H__ |
16 | #ifndef FPTOOLS_H__ |
17 | #define FPTOOLS_H__ |
17 | #define FPTOOLS_H__ |
18 | |
18 | |
… | |
… | |
47 | # define FP_ferror(s) ferror_unlocked (s) |
47 | # define FP_ferror(s) ferror_unlocked (s) |
48 | #else |
48 | #else |
49 | # define FP_ferror(s) ferror (s) |
49 | # define FP_ferror(s) ferror (s) |
50 | #endif |
50 | #endif |
51 | |
51 | |
|
|
52 | #if HAVE_FLOCKFILE |
|
|
53 | # define FP_flockfile(s) flockfile (s) |
|
|
54 | #else |
|
|
55 | # define FP_flockfile(s) ((void *)0) |
|
|
56 | #endif |
|
|
57 | |
52 | #define FP_strstr(a,b) strstr (a, b) |
58 | #define FP_strstr(a,b) strstr (a, b) |
|
|
59 | #define FP_strerror(a) strerror (a) |
53 | |
60 | |
54 | void TOOLEXPORT FP_free (void *); |
61 | void TOOLEXPORT FP_free (void *); |
55 | char * TOOLEXPORT FP_strdup (char *); |
62 | char * TOOLEXPORT FP_strdup (char *); |
56 | char * TOOLEXPORT FP_strncpy (char *, char *, int); |
63 | char * TOOLEXPORT FP_strncpy (char *, char *, int); |
57 | void * TOOLEXPORT FP_memdup (const void *, int); |
64 | void * TOOLEXPORT FP_memdup (const void *, int); |
… | |
… | |
66 | char * TOOLEXPORT FP_strrchr (const char *, int); |
73 | char * TOOLEXPORT FP_strrchr (const char *, int); |
67 | char * TOOLEXPORT FP_fgets (char *, int, FILE *); |
74 | char * TOOLEXPORT FP_fgets (char *, int, FILE *); |
68 | char * TOOLEXPORT FP_strpbrk (char *, char *); |
75 | char * TOOLEXPORT FP_strpbrk (char *, char *); |
69 | char * TOOLEXPORT FP_strtok (char *, char *); |
76 | char * TOOLEXPORT FP_strtok (char *, char *); |
70 | char * TOOLEXPORT FP_cutdir (char *); |
77 | char * TOOLEXPORT FP_cutdir (char *); |
71 | char * TOOLEXPORT FP_strerror (int); |
|
|
72 | #ifndef HAVE_MKSTEMP |
|
|
73 | char * TOOLEXPORT FP_tempnam (char *, char *); |
|
|
74 | #endif /* HAVE_MKSTEMP */ |
|
|
75 | |
78 | |
76 | /* like stgricmp, but only works when one of the strings is printable ascii */ |
79 | /* like stgricmp, but only works when one of the strings is printable ascii */ |
77 | /* not containing any of these characters: @`[\]^:_{|}~ */ |
80 | /* not containing any of these characters: @`[\]^:_{|}~ */ |
78 | int TOOLEXPORT FP_strnicmp_fast (const char *, const char *, int); |
81 | int TOOLEXPORT FP_strnicmp_fast (const char *, const char *, int); |
79 | |
82 | |