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