]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/string.h
2 * "$Id: string.h 177 2006-06-21 00:20:03Z jlovell $"
4 * String definitions for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-2006 by Easy Software Products.
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
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * This file is subject to the Apple OS-Developed Software exception.
27 #ifndef _CUPS_STRING_H_
28 # define _CUPS_STRING_H_
31 * Include necessary headers...
44 # endif /* HAVE_STRING_H */
46 # ifdef HAVE_STRINGS_H
48 # endif /* HAVE_STRINGS_H */
50 # ifdef HAVE_BSTRING_H
52 # endif /* HAVE_BSTRING_H */
56 * Stuff for WIN32 and OS/2...
59 # if defined(WIN32) || defined(__EMX__)
60 # define strcasecmp stricmp
61 # define strncasecmp strnicmp
62 # endif /* WIN32 || __EMX__ */
71 # endif /* __cplusplus */
75 * String pool structures...
78 typedef struct _cups_sp_item_s
/**** String Pool Item ****/
80 char *str
; /* String */
81 unsigned int ref_count
; /* Reference count */
89 extern void _cups_strcpy(char *dst
, const char *src
);
92 extern char *_cups_strdup(const char *);
93 # define strdup _cups_strdup
94 # endif /* !HAVE_STRDUP */
96 # ifndef HAVE_STRCASECMP
97 extern int _cups_strcasecmp(const char *, const char *);
98 # define strcasecmp _cups_strcasecmp
99 # endif /* !HAVE_STRCASECMP */
101 # ifndef HAVE_STRNCASECMP
102 extern int _cups_strncasecmp(const char *, const char *, size_t n
);
103 # define strncasecmp _cups_strncasecmp
104 # endif /* !HAVE_STRNCASECMP */
106 # ifndef HAVE_STRLCAT
107 extern size_t _cups_strlcat(char *, const char *, size_t);
108 # define strlcat _cups_strlcat
109 # endif /* !HAVE_STRLCAT */
111 # ifndef HAVE_STRLCPY
112 extern size_t _cups_strlcpy(char *, const char *, size_t);
113 # define strlcpy _cups_strlcpy
114 # endif /* !HAVE_STRLCPY */
116 # ifndef HAVE_SNPRINTF
117 extern int _cups_snprintf(char *, size_t, const char *, ...)
119 __attribute__ ((__format__ (__printf__
, 3, 4)))
120 # endif /* __GNUC__ */
122 # define snprintf _cups_snprintf
123 # endif /* !HAVE_SNPRINTF */
125 # ifndef HAVE_VSNPRINTF
126 extern int _cups_vsnprintf(char *, size_t, const char *, va_list);
127 # define vsnprintf _cups_vsnprintf
128 # endif /* !HAVE_VSNPRINTF */
131 * String pool functions...
134 extern char *_cupsStrAlloc(const char *s
);
135 extern void _cupsStrFlush(void);
136 extern void _cupsStrFree(const char *s
);
137 extern size_t _cupsStrStatistics(size_t *alloc_bytes
, size_t *total_bytes
);
141 * Floating point number functions...
144 extern char *_cupsStrFormatd(char *buf
, char *bufend
, double number
,
146 extern double _cupsStrScand(const char *buf
, char **bufptr
,
156 # endif /* __cplusplus */
158 #endif /* !_CUPS_STRING_H_ */
161 * End of "$Id: string.h 177 2006-06-21 00:20:03Z jlovell $".