]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/string.h
Add strlcat() and strlcpy() checks and emulation functions.
[thirdparty/cups.git] / cups / string.h
CommitLineData
3b960317 1/*
17438bf4 2 * "$Id: string.h,v 1.13 2002/05/16 13:44:54 mike Exp $"
3b960317 3 *
4 * String definitions for the Common UNIX Printing System (CUPS).
5 *
efb2f309 6 * Copyright 1997-2002 by Easy Software Products.
3b960317 7 *
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
8784b6a6 17 * 44141 Airport View Drive, Suite 204
3b960317 18 * Hollywood, Maryland 20636-3111 USA
19 *
20 * Voice: (301) 373-9603
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
34410ef2 23 *
24 * This file is subject to the Apple OS-Developed Software exception.
3b960317 25 */
26
27#ifndef _CUPS_STRING_H_
28# define _CUPS_STRING_H_
29
30/*
31 * Include necessary headers...
32 */
33
3620d932 34# include <config.h>
35
3095105a 36# include <stdio.h>
37# include <stdarg.h>
3620d932 38# include <ctype.h>
f5cca6ca 39
40# ifdef HAVE_STRING_H
41# include <string.h>
42# endif /* HAVE_STRING_H */
43
44# ifdef HAVE_STRINGS_H
45# include <strings.h>
46# endif /* HAVE_STRINGS_H */
3b960317 47
48
49/*
50 * Stuff for WIN32 and OS/2...
51 */
52
53# if defined(WIN32) || defined(__EMX__)
54# define strcasecmp stricmp
55# define strncasecmp strnicmp
56# endif /* WIN32 || __EMX__ */
57
58
5d14f780 59/*
60 * C++ magic...
61 */
62
63# ifdef __cplusplus
64extern "C" {
65# endif /* __cplusplus */
66
67
3b960317 68/*
69 * Prototypes...
70 */
71
72# ifndef HAVE_STRDUP
17438bf4 73extern char *cups_strdup(const char *);
74# define strdup cups_strdup
3b960317 75# endif /* !HAVE_STRDUP */
76
77# ifndef HAVE_STRCASECMP
17438bf4 78extern int cups_strcasecmp(const char *, const char *);
79# define strcasecmp cups_strcasecmp
3b960317 80# endif /* !HAVE_STRCASECMP */
81
82# ifndef HAVE_STRNCASECMP
17438bf4 83extern int cups_strncasecmp(const char *, const char *, size_t n);
84# define strncasecmp cups_strncasecmp
3b960317 85# endif /* !HAVE_STRNCASECMP */
86
17438bf4 87# ifndef HAVE_STRLCAT
88extern size_t cups_strlcat(char *, const char *, size_t);
89# define strlcat cups_strlcat
90# endif /* !HAVE_STRLCAT */
91
92# ifndef HAVE_STRLCPY
93extern size_t cups_strlcpy(char *, const char *, size_t);
94# define strlcpy cups_strlcpy
95# endif /* !HAVE_STRLCPY */
96
3095105a 97# ifndef HAVE_SNPRINTF
17438bf4 98extern int cups_snprintf(char *, size_t, const char *, ...)
1a90a168 99# ifdef __GNUC__
100__attribute__ ((__format__ (__printf__, 3, 4)))
101# endif /* __GNUC__ */
102;
17438bf4 103# define snprintf cups_snprintf
3095105a 104# endif /* !HAVE_SNPRINTF */
105
106# ifndef HAVE_VSNPRINTF
17438bf4 107extern int cups_vsnprintf(char *, size_t, const char *, va_list);
108# define vsnprintf cups_vsnprintf
3095105a 109# endif /* !HAVE_VSNPRINTF */
110
5d14f780 111
112/*
113 * C++ magic...
114 */
115
116# ifdef __cplusplus
117}
118# endif /* __cplusplus */
119
3b960317 120#endif /* !_CUPS_STRING_H_ */
121
122/*
17438bf4 123 * End of "$Id: string.h,v 1.13 2002/05/16 13:44:54 mike Exp $".
3b960317 124 */