… | |
… | |
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.12 2020/12/11 20:09:23 root Exp $ |
13 | * $Id: fptools.h,v 1.13 2020/12/11 20:27: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 | |
… | |
… | |
52 | #define FP_strstr(a,b) strstr (a, b) |
52 | #define FP_strstr(a,b) strstr (a, b) |
53 | |
53 | |
54 | void TOOLEXPORT FP_free (void *); |
54 | void TOOLEXPORT FP_free (void *); |
55 | char * TOOLEXPORT FP_strdup (char *); |
55 | char * TOOLEXPORT FP_strdup (char *); |
56 | char * TOOLEXPORT FP_strncpy (char *, char *, int); |
56 | char * TOOLEXPORT FP_strncpy (char *, char *, int); |
57 | void * TOOLEXPORT FP_memdup (void *, int); |
57 | void * TOOLEXPORT FP_memdup (const void *, int); |
58 | int TOOLEXPORT FP_stricmp (const char *, const char *); |
58 | int TOOLEXPORT FP_stricmp (const char *, const char *); |
59 | int TOOLEXPORT FP_strnicmp (const char *, const char *, int); |
59 | int TOOLEXPORT FP_strnicmp (const char *, const char *, int); |
60 | char * TOOLEXPORT FP_strrstr (char *, char *); |
60 | char * TOOLEXPORT FP_strrstr (char *, char *); |
61 | char * TOOLEXPORT FP_stoupper (char *); |
61 | char * TOOLEXPORT FP_stoupper (char *); |
62 | char * TOOLEXPORT FP_stolower (char *); |
62 | char * TOOLEXPORT FP_stolower (char *); |
63 | int TOOLEXPORT FP_strmatch (char *, char *); |
63 | int TOOLEXPORT FP_strmatch (char *, char *); |
64 | char * TOOLEXPORT FP_stristr (char *, char *); |
64 | char * TOOLEXPORT FP_stristr (char *, char *); |
65 | char * TOOLEXPORT FP_strirstr (char *, char *); |
65 | char * TOOLEXPORT FP_strirstr (char *, char *); |
66 | char * TOOLEXPORT FP_strrchr (char *, int); |
66 | char * TOOLEXPORT FP_strrchr (const char *, int); |
67 | char * TOOLEXPORT FP_fgets (char *, int, FILE *); |
67 | char * TOOLEXPORT FP_fgets (char *, int, FILE *); |
68 | char * TOOLEXPORT FP_strpbrk (char *, char *); |
68 | char * TOOLEXPORT FP_strpbrk (char *, char *); |
69 | char * TOOLEXPORT FP_strtok (char *, char *); |
69 | char * TOOLEXPORT FP_strtok (char *, char *); |
70 | char * TOOLEXPORT FP_cutdir (char *); |
70 | char * TOOLEXPORT FP_cutdir (char *); |
71 | char * TOOLEXPORT FP_strerror (int); |
71 | char * TOOLEXPORT FP_strerror (int); |
72 | #ifndef HAVE_MKSTEMP |
72 | #ifndef HAVE_MKSTEMP |
73 | char * TOOLEXPORT FP_tempnam (char *, char *); |
73 | char * TOOLEXPORT FP_tempnam (char *, char *); |
74 | #endif /* HAVE_MKSTEMP */ |
74 | #endif /* HAVE_MKSTEMP */ |
|
|
75 | |
|
|
76 | /* 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); |
75 | |
79 | |
76 | #if 0 /* API differs too much between systems to make those replacements */ |
80 | #if 0 /* API differs too much between systems to make those replacements */ |
77 | #if HAVE_STRCASECMP |
81 | #if HAVE_STRCASECMP |
78 | # define FP_stricmp(a,b) strcasecmp (a, b) |
82 | # define FP_stricmp(a,b) strcasecmp (a, b) |
79 | #endif |
83 | #endif |