]> 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/*
4400e98d 2 * "$Id: string.h 5047 2006-02-02 05:14:15Z 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>
39
40# ifdef HAVE_STRING_H
41# include <string.h>
42# endif /* HAVE_STRING_H */
43
44# ifdef HAVE_STRINGS_H
45# include <strings.h>
46# endif /* HAVE_STRINGS_H */
47
48# ifdef HAVE_BSTRING_H
49# include <bstring.h>
50# endif /* HAVE_BSTRING_H */
51
52
53/*
54 * Stuff for WIN32 and OS/2...
55 */
56
57# if defined(WIN32) || defined(__EMX__)
58# define strcasecmp stricmp
59# define strncasecmp strnicmp
60# endif /* WIN32 || __EMX__ */
61
62
63/*
64 * C++ magic...
65 */
66
67# ifdef __cplusplus
68extern "C" {
69# endif /* __cplusplus */
70
71
4400e98d 72/*
73 * String pool structures...
74 */
75
76typedef struct _cups_sp_item_s /**** String Pool Item ****/
77{
78 char *str; /* String */
79 unsigned int ref_count; /* Reference count */
80} _cups_sp_item_t;
81
82
ef416fc2 83/*
84 * Prototypes...
85 */
86
87extern void _cups_strcpy(char *dst, const char *src);
88
89# ifndef HAVE_STRDUP
90extern char *_cups_strdup(const char *);
91# define strdup _cups_strdup
92# endif /* !HAVE_STRDUP */
93
94# ifndef HAVE_STRCASECMP
95extern int _cups_strcasecmp(const char *, const char *);
96# define strcasecmp _cups_strcasecmp
97# endif /* !HAVE_STRCASECMP */
98
99# ifndef HAVE_STRNCASECMP
100extern int _cups_strncasecmp(const char *, const char *, size_t n);
101# define strncasecmp _cups_strncasecmp
102# endif /* !HAVE_STRNCASECMP */
103
104# ifndef HAVE_STRLCAT
105extern size_t _cups_strlcat(char *, const char *, size_t);
106# define strlcat _cups_strlcat
107# endif /* !HAVE_STRLCAT */
108
109# ifndef HAVE_STRLCPY
110extern size_t _cups_strlcpy(char *, const char *, size_t);
111# define strlcpy _cups_strlcpy
112# endif /* !HAVE_STRLCPY */
113
114# ifndef HAVE_SNPRINTF
115extern int _cups_snprintf(char *, size_t, const char *, ...)
116# ifdef __GNUC__
117__attribute__ ((__format__ (__printf__, 3, 4)))
118# endif /* __GNUC__ */
119;
120# define snprintf _cups_snprintf
121# endif /* !HAVE_SNPRINTF */
122
123# ifndef HAVE_VSNPRINTF
124extern int _cups_vsnprintf(char *, size_t, const char *, va_list);
125# define vsnprintf _cups_vsnprintf
126# endif /* !HAVE_VSNPRINTF */
127
4400e98d 128/*
129 * String pool functions...
130 */
131
132extern char *_cups_sp_alloc(const char *s);
133extern void _cups_sp_free(const char *s);
134extern size_t _cups_sp_statistics(size_t *alloc_bytes, size_t *total_bytes);
135
ef416fc2 136
137/*
138 * C++ magic...
139 */
140
141# ifdef __cplusplus
142}
143# endif /* __cplusplus */
144
145#endif /* !_CUPS_STRING_H_ */
146
147/*
4400e98d 148 * End of "$Id: string.h 5047 2006-02-02 05:14:15Z mike $".
ef416fc2 149 */