summaryrefslogtreecommitdiffstats
path: root/fltk/fltk/string.h.in
blob: d5bda20d11afafd0f03886966223acff0e8b9ef1 (plain) (blame)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* "$Id: string.h.in 4115 2005-03-14 04:48:51Z spitzak $"
 *
 * Copyright 1998-2005 by Bill Spitzak and others.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 * Please report all bugs and problems to "fltk-bugs@fltk.org".
 */

/* This file was produced by the fltk configure script, and is thus
   platform-specific. You may be able to use the unmodified string.h
   included in the fltk source instead, it has different #if statements
   to make it portable to the most popular platforms.
*/

#ifndef fltk_string_h
#define fltk_string_h

#undef HAVE_STRING_H
#undef HAVE_STRINGS_H

#undef HAVE_VSNPRINTF
#undef HAVE_SNPRINTF
#undef HAVE_STRCASECMP
#undef HAVE_STRLCAT
#undef HAVE_STRLCPY
#undef HAVE_STRNCASECMP

#include "FL_API.h"

#ifdef HAVE_STRING_H
# include <string.h>
#elif defined(HAVE_STRINGS_H)
# include <strings.h>
#endif

#if 1 /* for va_list */
# include <stdarg.h>
#endif

#if 1 /* for sprintf, vsprintf, snprintf and vsnprintf */
# include <stdio.h>
#endif

#if 0
# include <stdlib.h>
#endif

#if 0
# include <ctype.h>
/* Unixware defines these macros in above header for the obsolete BSD
   functions, get rid of them as it prevents you making a variable
   named "index"! */
# ifdef index
#  undef index
# endif
# ifdef rindex
#  undef rindex
# endif
#endif

#if 0 /*defined(__MWERKS__)*/
/* MetroWerks' CodeWarrior put some functions in <extras.h> but that
   file does not play well with others, so we don't include it. */
# include <extras.h>
#endif

/* Windows has equivalent functions, but being Microsoft they added
   gratuitoius changes to the names to stop code from being portable: */
#if (defined(_WIN32) && !defined(__CYGWIN__)) || defined(__EMX__)
# define strcasecmp(s,t)	stricmp(s, t)
# define strncasecmp(s,t,n)	strnicmp(s, t, n)
# define vsnprintf		_vsnprintf
# define snprintf		_snprintf
#endif

/*! \addtogroup utilities
  \{ */

#ifdef __cplusplus
extern "C" {
#endif

FL_API extern const char* newstring(const char *);

#if defined(DOXYGEN) || !defined(HAVE_STRCASECMP)
FL_API extern int strcasecmp(const char *, const char *);
#endif

#if defined(DOXYGEN) || !defined(HAVE_STRNCASECMP)
FL_API extern int strncasecmp(const char *, const char *, size_t);
#endif

#if defined(DOXYGEN) || !defined(HAVE_SNPRINTF)
FL_API extern int snprintf(char *, size_t, const char *, ...);
#endif

#if defined(DOXYGEN) || !defined(HAVE_VSNPRINTF)
FL_API extern int vsnprintf(char *, size_t, const char *, va_list ap);
#endif

#if defined(DOXYGEN) || !defined(HAVE_STRLCAT)
FL_API extern size_t strlcat(char *, const char *, size_t);
#endif

#if defined(DOXYGEN) || !defined(HAVE_STRLCPY)
FL_API extern size_t strlcpy(char *, const char *, size_t);
#endif

#ifdef __cplusplus
}
#endif

/*! \} */

#endif

/*
 * End of "$Id: string.h.in 4115 2005-03-14 04:48:51Z spitzak $".
 */