]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/string.h
Add missing files for test.
[thirdparty/cups.git] / cups / string.h
CommitLineData
ef416fc2 1/*
bc44d920 2 * "$Id: string.h 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3 *
4 * String definitions for the Common UNIX Printing System (CUPS).
5 *
bc44d920 6 * Copyright 2007 by Apple Inc.
4400e98d 7 * Copyright 1997-2006 by Easy Software Products.
ef416fc2 8 *
9 * These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 14 *
15 * This file is subject to the Apple OS-Developed Software exception.
16 */
17
18#ifndef _CUPS_STRING_H_
19# define _CUPS_STRING_H_
20
21/*
22 * Include necessary headers...
23 */
24
ef416fc2 25# include <stdio.h>
a74454a7 26# include <stdlib.h>
ef416fc2 27# include <stdarg.h>
28# include <ctype.h>
757d2cad 29# include <locale.h>
ef416fc2 30
a74454a7 31# include <config.h>
32
ef416fc2 33# ifdef HAVE_STRING_H
34# include <string.h>
35# endif /* HAVE_STRING_H */
36
37# ifdef HAVE_STRINGS_H
38# include <strings.h>
39# endif /* HAVE_STRINGS_H */
40
41# ifdef HAVE_BSTRING_H
42# include <bstring.h>
43# endif /* HAVE_BSTRING_H */
44
45
46/*
47 * Stuff for WIN32 and OS/2...
48 */
49
50# if defined(WIN32) || defined(__EMX__)
51# define strcasecmp stricmp
52# define strncasecmp strnicmp
53# endif /* WIN32 || __EMX__ */
54
55
56/*
57 * C++ magic...
58 */
59
60# ifdef __cplusplus
61extern "C" {
62# endif /* __cplusplus */
63
64
4400e98d 65/*
66 * String pool structures...
67 */
68
69typedef struct _cups_sp_item_s /**** String Pool Item ****/
70{
71 char *str; /* String */
72 unsigned int ref_count; /* Reference count */
73} _cups_sp_item_t;
74
75
ef416fc2 76/*
77 * Prototypes...
78 */
79
80extern void _cups_strcpy(char *dst, const char *src);
81
82# ifndef HAVE_STRDUP
83extern char *_cups_strdup(const char *);
84# define strdup _cups_strdup
85# endif /* !HAVE_STRDUP */
86
87# ifndef HAVE_STRCASECMP
88extern int _cups_strcasecmp(const char *, const char *);
89# define strcasecmp _cups_strcasecmp
90# endif /* !HAVE_STRCASECMP */
91
92# ifndef HAVE_STRNCASECMP
93extern int _cups_strncasecmp(const char *, const char *, size_t n);
94# define strncasecmp _cups_strncasecmp
95# endif /* !HAVE_STRNCASECMP */
96
97# ifndef HAVE_STRLCAT
98extern size_t _cups_strlcat(char *, const char *, size_t);
99# define strlcat _cups_strlcat
100# endif /* !HAVE_STRLCAT */
101
102# ifndef HAVE_STRLCPY
103extern size_t _cups_strlcpy(char *, const char *, size_t);
104# define strlcpy _cups_strlcpy
105# endif /* !HAVE_STRLCPY */
106
107# ifndef HAVE_SNPRINTF
108extern int _cups_snprintf(char *, size_t, const char *, ...)
109# ifdef __GNUC__
110__attribute__ ((__format__ (__printf__, 3, 4)))
111# endif /* __GNUC__ */
112;
113# define snprintf _cups_snprintf
114# endif /* !HAVE_SNPRINTF */
115
116# ifndef HAVE_VSNPRINTF
117extern int _cups_vsnprintf(char *, size_t, const char *, va_list);
118# define vsnprintf _cups_vsnprintf
119# endif /* !HAVE_VSNPRINTF */
120
4400e98d 121/*
122 * String pool functions...
123 */
124
757d2cad 125extern char *_cupsStrAlloc(const char *s);
d6ae789d 126extern void _cupsStrFlush(void);
757d2cad 127extern void _cupsStrFree(const char *s);
128extern size_t _cupsStrStatistics(size_t *alloc_bytes, size_t *total_bytes);
129
130
131/*
132 * Floating point number functions...
133 */
134
135extern char *_cupsStrFormatd(char *buf, char *bufend, double number,
136 struct lconv *loc);
137extern double _cupsStrScand(const char *buf, char **bufptr,
138 struct lconv *loc);
4400e98d 139
ef416fc2 140
141/*
142 * C++ magic...
143 */
144
145# ifdef __cplusplus
146}
147# endif /* __cplusplus */
148
149#endif /* !_CUPS_STRING_H_ */
150
151/*
bc44d920 152 * End of "$Id: string.h 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 153 */