2 * "$Id: flstring.h 7913 2010-11-29 18:18:27Z greg.ercolano $"
4 * Common string header file for the Fast Light Tool Kit (FLTK).
6 * Copyright 1998-2010 by Bill Spitzak and others.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * Please report all bugs and problems on the following page:
25 * http://www.fltk.org/str.php
31 # include <FL/Fl_Export.H>
36 # ifdef HAVE_STRINGS_H
38 # endif /* HAVE_STRINGS_H */
42 * Apparently Unixware defines "index" to strchr (!) rather than
43 * providing a proper entry point or not providing the (obsolete)
44 * BSD function. Make sure index is not defined...
51 # if defined(WIN32) && !defined(__CYGWIN__)
52 # define strcasecmp(s,t) _stricmp((s), (t))
53 # define strncasecmp(s,t,n) _strnicmp((s), (t), (n))
54 /* Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs
55 * on Windows, which is supposed to be POSIX compliant... Some of these
56 * functions are also defined in ISO C99...
59 # define strdup _strdup
60 # define unlink _unlink
61 # endif /* !__WATCOMC__ */
62 # elif defined(__EMX__)
63 # define strcasecmp(s,t) stricmp((s), (t))
64 # define strncasecmp(s,t,n) strnicmp((s), (t), (n))
69 # endif /* __cplusplus */
71 FL_EXPORT
extern int fl_snprintf(char *, size_t, const char *, ...);
73 # define snprintf fl_snprintf
74 # endif /* !HAVE_SNPRINTF */
76 FL_EXPORT
extern int fl_vsnprintf(char *, size_t, const char *, va_list ap
);
78 # define vsnprintf fl_vsnprintf
79 # endif /* !HAVE_VSNPRINTF */
82 * strlcpy() and strlcat() are some really useful BSD string functions
83 * that work the way strncpy() and strncat() *should* have worked.
86 FL_EXPORT
extern size_t fl_strlcat(char *, const char *, size_t);
88 # define strlcat fl_strlcat
89 # endif /* !HAVE_STRLCAT */
91 FL_EXPORT
extern size_t fl_strlcpy(char *, const char *, size_t);
93 # define strlcpy fl_strlcpy
94 # endif /* !HAVE_STRLCPY */
98 # endif /* __cplusplus */
99 #endif /* !flstring_h */
103 * End of "$Id: flstring.h 7913 2010-11-29 18:18:27Z greg.ercolano $".