blob: 412566621292eb0c521de6ca9353c0ef512e07e3 [file] [log] [blame]
Christian Heimes1a6387e2008-03-26 12:49:49 +00001#ifndef Py_BYTES_CTYPE_H
2#define Py_BYTES_CTYPE_H
3
4/*
5 * The internal implementation behind PyString (bytes) and PyBytes (buffer)
6 * methods of the given names, they operate on ASCII byte strings.
7 */
8extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len);
9extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len);
10extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len);
11extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len);
12extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len);
13extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len);
14extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len);
15
16/* These store their len sized answer in the given preallocated *result arg. */
17extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len);
18extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len);
19extern void _Py_bytes_title(char *result, char *s, Py_ssize_t len);
20extern void _Py_bytes_capitalize(char *result, char *s, Py_ssize_t len);
21extern void _Py_bytes_swapcase(char *result, char *s, Py_ssize_t len);
22
23/* Shared __doc__ strings. */
24extern const char _Py_isspace__doc__[];
25extern const char _Py_isalpha__doc__[];
26extern const char _Py_isalnum__doc__[];
27extern const char _Py_isdigit__doc__[];
28extern const char _Py_islower__doc__[];
29extern const char _Py_isupper__doc__[];
30extern const char _Py_istitle__doc__[];
31extern const char _Py_lower__doc__[];
32extern const char _Py_upper__doc__[];
33extern const char _Py_title__doc__[];
34extern const char _Py_capitalize__doc__[];
35extern const char _Py_swapcase__doc__[];
36
Eric Smithcac7af62009-04-27 19:04:37 +000037/* These are left in for backward compatibility and will be removed
38 in 2.8/3.2 */
39#define ISLOWER(c) Py_ISLOWER(c)
40#define ISUPPER(c) Py_ISUPPER(c)
41#define ISALPHA(c) Py_ISALPHA(c)
42#define ISDIGIT(c) Py_ISDIGIT(c)
43#define ISXDIGIT(c) Py_ISXDIGIT(c)
44#define ISALNUM(c) Py_ISALNUM(c)
45#define ISSPACE(c) Py_ISSPACE(c)
Christian Heimes1a6387e2008-03-26 12:49:49 +000046
47#undef islower
48#define islower(c) undefined_islower(c)
49#undef isupper
50#define isupper(c) undefined_isupper(c)
51#undef isalpha
52#define isalpha(c) undefined_isalpha(c)
53#undef isdigit
54#define isdigit(c) undefined_isdigit(c)
55#undef isxdigit
56#define isxdigit(c) undefined_isxdigit(c)
57#undef isalnum
58#define isalnum(c) undefined_isalnum(c)
59#undef isspace
60#define isspace(c) undefined_isspace(c)
61
Eric Smithcac7af62009-04-27 19:04:37 +000062/* These are left in for backward compatibility and will be removed
63 in 2.8/3.2 */
64#define TOLOWER(c) Py_TOLOWER(c)
65#define TOUPPER(c) Py_TOUPPER(c)
Christian Heimes1a6387e2008-03-26 12:49:49 +000066
67#undef tolower
68#define tolower(c) undefined_tolower(c)
69#undef toupper
70#define toupper(c) undefined_toupper(c)
71
72/* this is needed because some docs are shared from the .o, not static */
73#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str)
74
75#endif /* !Py_BYTES_CTYPE_H */