]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/string-private.h
4 * Private string definitions for CUPS.
6 * Copyright 2007-2010 by Apple Inc.
7 * Copyright 1997-2006 by Easy Software Products.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
15 * This file is subject to the Apple OS-Developed Software exception.
18 #ifndef _CUPS_STRING_PRIVATE_H_
19 # define _CUPS_STRING_PRIVATE_H_
22 * Include necessary headers...
36 # endif /* HAVE_STRING_H */
38 # ifdef HAVE_STRINGS_H
40 # endif /* HAVE_STRINGS_H */
42 # ifdef HAVE_BSTRING_H
44 # endif /* HAVE_BSTRING_H */
48 * Stuff for WIN32 and OS/2...
51 # if defined(WIN32) || defined(__EMX__)
52 # define strcasecmp _stricmp
53 # define strncasecmp _strnicmp
54 # endif /* WIN32 || __EMX__ */
63 # endif /* __cplusplus */
67 * String pool structures...
70 # define _CUPS_STR_GUARD 0x12344321
72 typedef struct _cups_sp_item_s
/**** String Pool Item ****/
75 unsigned int guard
; /* Guard word */
76 # endif /* DEBUG_GUARDS */
77 unsigned int ref_count
; /* Reference count */
78 char str
[1]; /* String */
86 extern void _cups_strcpy(char *dst
, const char *src
);
89 extern char *_cups_strdup(const char *);
90 # define strdup _cups_strdup
91 # endif /* !HAVE_STRDUP */
93 # ifndef HAVE_STRCASECMP
94 extern int _cups_strcasecmp(const char *, const char *);
95 # define strcasecmp _cups_strcasecmp
96 # endif /* !HAVE_STRCASECMP */
98 # ifndef HAVE_STRNCASECMP
99 extern int _cups_strncasecmp(const char *, const char *, size_t n
);
100 # define strncasecmp _cups_strncasecmp
101 # endif /* !HAVE_STRNCASECMP */
103 # ifndef HAVE_STRLCAT
104 extern size_t _cups_strlcat(char *, const char *, size_t);
105 # define strlcat _cups_strlcat
106 # endif /* !HAVE_STRLCAT */
108 # ifndef HAVE_STRLCPY
109 extern size_t _cups_strlcpy(char *, const char *, size_t);
110 # define strlcpy _cups_strlcpy
111 # endif /* !HAVE_STRLCPY */
113 # ifndef HAVE_SNPRINTF
114 extern int _cups_snprintf(char *, size_t, const char *, ...)
116 __attribute__ ((__format__ (__printf__
, 3, 4)))
117 # endif /* __GNUC__ */
119 # define snprintf _cups_snprintf
120 # endif /* !HAVE_SNPRINTF */
122 # ifndef HAVE_VSNPRINTF
123 extern int _cups_vsnprintf(char *, size_t, const char *, va_list);
124 # define vsnprintf _cups_vsnprintf
125 # endif /* !HAVE_VSNPRINTF */
128 * String pool functions...
131 extern char *_cupsStrAlloc(const char *s
);
132 extern void _cupsStrFlush(void);
133 extern void _cupsStrFree(const char *s
);
134 extern char *_cupsStrRetain(const char *s
);
135 extern size_t _cupsStrStatistics(size_t *alloc_bytes
, size_t *total_bytes
);
139 * Floating point number functions...
142 extern char *_cupsStrFormatd(char *buf
, char *bufend
, double number
,
144 extern double _cupsStrScand(const char *buf
, char **bufptr
,
154 # endif /* __cplusplus */
156 #endif /* !_CUPS_STRING_H_ */