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