]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/string.h
Load cups into easysw/current.
[thirdparty/cups.git] / cups / string.h
CommitLineData
ef416fc2 1/*
757d2cad 2 * "$Id: string.h 5238 2006-03-07 04:41:42Z 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
34# include <config.h>
35
36# include <stdio.h>
37# include <stdarg.h>
38# include <ctype.h>
757d2cad 39# include <locale.h>
ef416fc2 40
41# ifdef HAVE_STRING_H
42# include <string.h>
43# endif /* HAVE_STRING_H */
44
45# ifdef HAVE_STRINGS_H
46# include <strings.h>
47# endif /* HAVE_STRINGS_H */
48
49# ifdef HAVE_BSTRING_H
50# include <bstring.h>
51# endif /* HAVE_BSTRING_H */
52
53
54/*
55 * Stuff for WIN32 and OS/2...
56 */
57
58# if defined(WIN32) || defined(__EMX__)
59# define strcasecmp stricmp
60# define strncasecmp strnicmp
61# endif /* WIN32 || __EMX__ */
62
63
64/*
65 * C++ magic...
66 */
67
68# ifdef __cplusplus
69extern "C" {
70# endif /* __cplusplus */
71
72
4400e98d 73/*
74 * String pool structures...
75 */
76
77typedef struct _cups_sp_item_s /**** String Pool Item ****/
78{
79 char *str; /* String */
80 unsigned int ref_count; /* Reference count */
81} _cups_sp_item_t;
82
83
ef416fc2 84/*
85 * Prototypes...
86 */
87
88extern void _cups_strcpy(char *dst, const char *src);
89
90# ifndef HAVE_STRDUP
91extern char *_cups_strdup(const char *);
92# define strdup _cups_strdup
93# endif /* !HAVE_STRDUP */
94
95# ifndef HAVE_STRCASECMP
96extern int _cups_strcasecmp(const char *, const char *);
97# define strcasecmp _cups_strcasecmp
98# endif /* !HAVE_STRCASECMP */
99
100# ifndef HAVE_STRNCASECMP
101extern int _cups_strncasecmp(const char *, const char *, size_t n);
102# define strncasecmp _cups_strncasecmp
103# endif /* !HAVE_STRNCASECMP */
104
105# ifndef HAVE_STRLCAT
106extern size_t _cups_strlcat(char *, const char *, size_t);
107# define strlcat _cups_strlcat
108# endif /* !HAVE_STRLCAT */
109
110# ifndef HAVE_STRLCPY
111extern size_t _cups_strlcpy(char *, const char *, size_t);
112# define strlcpy _cups_strlcpy
113# endif /* !HAVE_STRLCPY */
114
115# ifndef HAVE_SNPRINTF
116extern int _cups_snprintf(char *, size_t, const char *, ...)
117# ifdef __GNUC__
118__attribute__ ((__format__ (__printf__, 3, 4)))
119# endif /* __GNUC__ */
120;
121# define snprintf _cups_snprintf
122# endif /* !HAVE_SNPRINTF */
123
124# ifndef HAVE_VSNPRINTF
125extern int _cups_vsnprintf(char *, size_t, const char *, va_list);
126# define vsnprintf _cups_vsnprintf
127# endif /* !HAVE_VSNPRINTF */
128
4400e98d 129/*
130 * String pool functions...
131 */
132
757d2cad 133extern char *_cupsStrAlloc(const char *s);
134extern void _cupsStrFree(const char *s);
135extern size_t _cupsStrStatistics(size_t *alloc_bytes, size_t *total_bytes);
136
137
138/*
139 * Floating point number functions...
140 */
141
142extern char *_cupsStrFormatd(char *buf, char *bufend, double number,
143 struct lconv *loc);
144extern double _cupsStrScand(const char *buf, char **bufptr,
145 struct lconv *loc);
4400e98d 146
ef416fc2 147
148/*
149 * C++ magic...
150 */
151
152# ifdef __cplusplus
153}
154# endif /* __cplusplus */
155
156#endif /* !_CUPS_STRING_H_ */
157
158/*
757d2cad 159 * End of "$Id: string.h 5238 2006-03-07 04:41:42Z mike $".
ef416fc2 160 */