]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/string.h
2 * "$Id: string.h 6649 2007-07-11 21:46:42Z mike $"
4 * String definitions for the Common UNIX Printing System (CUPS).
6 * Copyright 2007 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_H_
19 # define _CUPS_STRING_H_
22 * Include necessary headers...
35 # endif /* HAVE_STRING_H */
37 # ifdef HAVE_STRINGS_H
39 # endif /* HAVE_STRINGS_H */
41 # ifdef HAVE_BSTRING_H
43 # endif /* HAVE_BSTRING_H */
47 * Stuff for WIN32 and OS/2...
50 # if defined(WIN32) || defined(__EMX__)
51 # define strcasecmp stricmp
52 # define strncasecmp strnicmp
53 # endif /* WIN32 || __EMX__ */
62 # endif /* __cplusplus */
66 * String pool structures...
69 typedef struct _cups_sp_item_s
/**** String Pool Item ****/
71 char *str
; /* String */
72 unsigned int ref_count
; /* Reference count */
80 extern void _cups_strcpy(char *dst
, const char *src
);
83 extern char *_cups_strdup(const char *);
84 # define strdup _cups_strdup
85 # endif /* !HAVE_STRDUP */
87 # ifndef HAVE_STRCASECMP
88 extern int _cups_strcasecmp(const char *, const char *);
89 # define strcasecmp _cups_strcasecmp
90 # endif /* !HAVE_STRCASECMP */
92 # ifndef HAVE_STRNCASECMP
93 extern int _cups_strncasecmp(const char *, const char *, size_t n
);
94 # define strncasecmp _cups_strncasecmp
95 # endif /* !HAVE_STRNCASECMP */
98 extern size_t _cups_strlcat(char *, const char *, size_t);
99 # define strlcat _cups_strlcat
100 # endif /* !HAVE_STRLCAT */
102 # ifndef HAVE_STRLCPY
103 extern size_t _cups_strlcpy(char *, const char *, size_t);
104 # define strlcpy _cups_strlcpy
105 # endif /* !HAVE_STRLCPY */
107 # ifndef HAVE_SNPRINTF
108 extern int _cups_snprintf(char *, size_t, const char *, ...)
110 __attribute__ ((__format__ (__printf__
, 3, 4)))
111 # endif /* __GNUC__ */
113 # define snprintf _cups_snprintf
114 # endif /* !HAVE_SNPRINTF */
116 # ifndef HAVE_VSNPRINTF
117 extern int _cups_vsnprintf(char *, size_t, const char *, va_list);
118 # define vsnprintf _cups_vsnprintf
119 # endif /* !HAVE_VSNPRINTF */
122 * String pool functions...
125 extern char *_cupsStrAlloc(const char *s
);
126 extern void _cupsStrFlush(void);
127 extern void _cupsStrFree(const char *s
);
128 extern size_t _cupsStrStatistics(size_t *alloc_bytes
, size_t *total_bytes
);
132 * Floating point number functions...
135 extern char *_cupsStrFormatd(char *buf
, char *bufend
, double number
,
137 extern double _cupsStrScand(const char *buf
, char **bufptr
,
147 # endif /* __cplusplus */
149 #endif /* !_CUPS_STRING_H_ */
152 * End of "$Id: string.h 6649 2007-07-11 21:46:42Z mike $".