#ifndef _CUPS_STRING_PRIVATE_H_
# define _CUPS_STRING_PRIVATE_H_
# include <stdio.h>
# include <stdlib.h>
# include <stdarg.h>
# include <ctype.h>
# include <errno.h>
# include <locale.h>
# include "config.h"
# ifdef HAVE_STRING_H
# include <string.h>
# endif
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
# ifdef HAVE_BSTRING_H
# include <bstring.h>
# endif
# ifdef __cplusplus
extern "C" {
# endif
# define _CUPS_STR_GUARD 0x12344321
typedef struct _cups_sp_item_s
{
# ifdef DEBUG_GUARDS
unsigned int guard;
# endif
unsigned int ref_count;
char str[1];
} _cups_sp_item_t;
# if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
# define _CUPS_INLINE static inline
# elif defined(_MSC_VER)
# define _CUPS_INLINE static __inline
# elif defined(_CUPS_STRING_C_)
# define _CUPS_INLINE
# endif
# ifdef _CUPS_INLINE
_CUPS_INLINE int
_cups_isalnum(int ch)
{
return ((ch >= '0' && ch <= '9') ||
(ch >= 'A' && ch <= 'Z') ||
(ch >= 'a' && ch <= 'z'));
}
_CUPS_INLINE int
_cups_isalpha(int ch)
{
return ((ch >= 'A' && ch <= 'Z') ||
(ch >= 'a' && ch <= 'z'));
}
_CUPS_INLINE int
_cups_islower(int ch)
{
return (ch >= 'a' && ch <= 'z');
}
_CUPS_INLINE int
_cups_isspace(int ch)
{
return (ch == ' ' || ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' ||
ch == '\v');
}
_CUPS_INLINE int
_cups_isupper(int ch)
{
return (ch >= 'A' && ch <= 'Z');
}
_CUPS_INLINE int
_cups_tolower(int ch)
{
return (_cups_isupper(ch) ? ch - 'A' + 'a' : ch);
}
_CUPS_INLINE int
_cups_toupper(int ch)
{
return (_cups_islower(ch) ? ch - 'a' + 'A' : ch);
}
# else
extern int _cups_isalnum(int ch);
extern int _cups_isalpha(int ch);
extern int _cups_islower(int ch);
extern int _cups_isspace(int ch);
extern int _cups_isupper(int ch);
extern int _cups_tolower(int ch);
extern int _cups_toupper(int ch);
# endif
extern void _cups_strcpy(char *dst, const char *src);
# ifndef HAVE_STRDUP
extern char *_cups_strdup(const char *);
# define strdup _cups_strdup
# endif
extern int _cups_strcasecmp(const char *, const char *);
extern int _cups_strncasecmp(const char *, const char *, size_t n);
# ifndef HAVE_STRLCAT
extern size_t _cups_strlcat(char *, const char *, size_t);
# define strlcat _cups_strlcat
# endif
# ifndef HAVE_STRLCPY
extern size_t _cups_strlcpy(char *, const char *, size_t);
# define strlcpy _cups_strlcpy
# endif
# ifndef HAVE_SNPRINTF
extern int _cups_snprintf(char *, size_t, const char *, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
# define snprintf _cups_snprintf
# endif
# ifndef HAVE_VSNPRINTF
extern int _cups_vsnprintf(char *, size_t, const char *, va_list);
# define vsnprintf _cups_vsnprintf
# endif
extern char *_cupsStrAlloc(const char *s);
extern void _cupsStrFlush(void);
extern void _cupsStrFree(const char *s);
extern char *_cupsStrRetain(const char *s);
extern size_t _cupsStrStatistics(size_t *alloc_bytes, size_t *total_bytes);
extern char *_cupsStrFormatd(char *buf, char *bufend, double number,
struct lconv *loc);
extern double _cupsStrScand(const char *buf, char **bufptr,
struct lconv *loc);
# ifdef __cplusplus
}
# endif
#endif