]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
f7faf1f5 | 2 | * "$Id: string.h 5466 2006-04-26 19:52:27Z mike $" |
ef416fc2 | 3 | * |
4 | * String definitions for the Common UNIX Printing System (CUPS). | |
5 | * | |
4400e98d | 6 | * Copyright 1997-2006 by Easy Software Products. |
ef416fc2 | 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 | |
17 | * 44141 Airport View Drive, Suite 204 | |
18 | * Hollywood, Maryland 20636 USA | |
19 | * | |
20 | * Voice: (301) 373-9600 | |
21 | * EMail: cups-info@cups.org | |
22 | * WWW: http://www.cups.org | |
23 | * | |
24 | * This file is subject to the Apple OS-Developed Software exception. | |
25 | */ | |
26 | ||
27 | #ifndef _CUPS_STRING_H_ | |
28 | # define _CUPS_STRING_H_ | |
29 | ||
30 | /* | |
31 | * Include necessary headers... | |
32 | */ | |
33 | ||
ef416fc2 | 34 | # include <stdio.h> |
a74454a7 | 35 | # include <stdlib.h> |
ef416fc2 | 36 | # include <stdarg.h> |
37 | # include <ctype.h> | |
757d2cad | 38 | # include <locale.h> |
ef416fc2 | 39 | |
a74454a7 | 40 | # include <config.h> |
41 | ||
ef416fc2 | 42 | # ifdef HAVE_STRING_H |
43 | # include <string.h> | |
44 | # endif /* HAVE_STRING_H */ | |
45 | ||
46 | # ifdef HAVE_STRINGS_H | |
47 | # include <strings.h> | |
48 | # endif /* HAVE_STRINGS_H */ | |
49 | ||
50 | # ifdef HAVE_BSTRING_H | |
51 | # include <bstring.h> | |
52 | # endif /* HAVE_BSTRING_H */ | |
53 | ||
54 | ||
55 | /* | |
56 | * Stuff for WIN32 and OS/2... | |
57 | */ | |
58 | ||
59 | # if defined(WIN32) || defined(__EMX__) | |
60 | # define strcasecmp stricmp | |
61 | # define strncasecmp strnicmp | |
62 | # endif /* WIN32 || __EMX__ */ | |
63 | ||
64 | ||
65 | /* | |
66 | * C++ magic... | |
67 | */ | |
68 | ||
69 | # ifdef __cplusplus | |
70 | extern "C" { | |
71 | # endif /* __cplusplus */ | |
72 | ||
73 | ||
4400e98d | 74 | /* |
75 | * String pool structures... | |
76 | */ | |
77 | ||
78 | typedef struct _cups_sp_item_s /**** String Pool Item ****/ | |
79 | { | |
80 | char *str; /* String */ | |
81 | unsigned int ref_count; /* Reference count */ | |
82 | } _cups_sp_item_t; | |
83 | ||
84 | ||
ef416fc2 | 85 | /* |
86 | * Prototypes... | |
87 | */ | |
88 | ||
89 | extern void _cups_strcpy(char *dst, const char *src); | |
90 | ||
91 | # ifndef HAVE_STRDUP | |
92 | extern char *_cups_strdup(const char *); | |
93 | # define strdup _cups_strdup | |
94 | # endif /* !HAVE_STRDUP */ | |
95 | ||
96 | # ifndef HAVE_STRCASECMP | |
97 | extern int _cups_strcasecmp(const char *, const char *); | |
98 | # define strcasecmp _cups_strcasecmp | |
99 | # endif /* !HAVE_STRCASECMP */ | |
100 | ||
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 */ | |
105 | ||
106 | # ifndef HAVE_STRLCAT | |
107 | extern size_t _cups_strlcat(char *, const char *, size_t); | |
108 | # define strlcat _cups_strlcat | |
109 | # endif /* !HAVE_STRLCAT */ | |
110 | ||
111 | # ifndef HAVE_STRLCPY | |
112 | extern size_t _cups_strlcpy(char *, const char *, size_t); | |
113 | # define strlcpy _cups_strlcpy | |
114 | # endif /* !HAVE_STRLCPY */ | |
115 | ||
116 | # ifndef HAVE_SNPRINTF | |
117 | extern int _cups_snprintf(char *, size_t, const char *, ...) | |
118 | # ifdef __GNUC__ | |
119 | __attribute__ ((__format__ (__printf__, 3, 4))) | |
120 | # endif /* __GNUC__ */ | |
121 | ; | |
122 | # define snprintf _cups_snprintf | |
123 | # endif /* !HAVE_SNPRINTF */ | |
124 | ||
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 */ | |
129 | ||
4400e98d | 130 | /* |
131 | * String pool functions... | |
132 | */ | |
133 | ||
757d2cad | 134 | extern char *_cupsStrAlloc(const char *s); |
d6ae789d | 135 | extern void _cupsStrFlush(void); |
757d2cad | 136 | extern void _cupsStrFree(const char *s); |
137 | extern size_t _cupsStrStatistics(size_t *alloc_bytes, size_t *total_bytes); | |
138 | ||
139 | ||
140 | /* | |
141 | * Floating point number functions... | |
142 | */ | |
143 | ||
144 | extern char *_cupsStrFormatd(char *buf, char *bufend, double number, | |
145 | struct lconv *loc); | |
146 | extern double _cupsStrScand(const char *buf, char **bufptr, | |
147 | struct lconv *loc); | |
4400e98d | 148 | |
ef416fc2 | 149 | |
150 | /* | |
151 | * C++ magic... | |
152 | */ | |
153 | ||
154 | # ifdef __cplusplus | |
155 | } | |
156 | # endif /* __cplusplus */ | |
157 | ||
158 | #endif /* !_CUPS_STRING_H_ */ | |
159 | ||
160 | /* | |
f7faf1f5 | 161 | * End of "$Id: string.h 5466 2006-04-26 19:52:27Z mike $". |
ef416fc2 | 162 | */ |