Mercurial > cpython-lru_cache-weakref
annotate Include/bytes_methods.h @ 49258:25f809123df6 legacy-trunk
Issue #3925: Ignores shutil.rmtree error on cygwin too.
Reviewed by Benjamin Peterson.
| author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> |
|---|---|
| date | Sun, 21 Sep 2008 20:48:41 +0000 |
| parents | 848160d10780 |
| children | 4bdd847b57c2 96b34263e448 |
| rev | line source |
|---|---|
|
43576
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
1 #ifndef Py_BYTES_CTYPE_H |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
2 #define Py_BYTES_CTYPE_H |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
3 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
4 /* |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
5 * The internal implementation behind PyString (bytes) and PyBytes (buffer) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
6 * methods of the given names, they operate on ASCII byte strings. |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
7 */ |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
8 extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
9 extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
10 extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
11 extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
12 extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
13 extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
14 extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
15 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
16 /* These store their len sized answer in the given preallocated *result arg. */ |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
17 extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
18 extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
19 extern void _Py_bytes_title(char *result, char *s, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
20 extern void _Py_bytes_capitalize(char *result, char *s, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
21 extern void _Py_bytes_swapcase(char *result, char *s, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
22 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
23 /* Shared __doc__ strings. */ |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
24 extern const char _Py_isspace__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
25 extern const char _Py_isalpha__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
26 extern const char _Py_isalnum__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
27 extern const char _Py_isdigit__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
28 extern const char _Py_islower__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
29 extern const char _Py_isupper__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
30 extern const char _Py_istitle__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
31 extern const char _Py_lower__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
32 extern const char _Py_upper__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
33 extern const char _Py_title__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
34 extern const char _Py_capitalize__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
35 extern const char _Py_swapcase__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
36 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
37 #define FLAG_LOWER 0x01 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
38 #define FLAG_UPPER 0x02 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
39 #define FLAG_ALPHA (FLAG_LOWER|FLAG_UPPER) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
40 #define FLAG_DIGIT 0x04 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
41 #define FLAG_ALNUM (FLAG_ALPHA|FLAG_DIGIT) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
42 #define FLAG_SPACE 0x08 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
43 #define FLAG_XDIGIT 0x10 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
44 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
45 extern const unsigned int _Py_ctype_table[256]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
46 |
|
46161
848160d10780
Merged revisions 61981,61984-61987,61992-61993,61997-62000 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46145
diff
changeset
|
47 #define ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_LOWER) |
|
848160d10780
Merged revisions 61981,61984-61987,61992-61993,61997-62000 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46145
diff
changeset
|
48 #define ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_UPPER) |
|
848160d10780
Merged revisions 61981,61984-61987,61992-61993,61997-62000 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46145
diff
changeset
|
49 #define ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_ALPHA) |
|
848160d10780
Merged revisions 61981,61984-61987,61992-61993,61997-62000 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46145
diff
changeset
|
50 #define ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_DIGIT) |
|
848160d10780
Merged revisions 61981,61984-61987,61992-61993,61997-62000 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46145
diff
changeset
|
51 #define ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_XDIGIT) |
|
848160d10780
Merged revisions 61981,61984-61987,61992-61993,61997-62000 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46145
diff
changeset
|
52 #define ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_ALNUM) |
|
848160d10780
Merged revisions 61981,61984-61987,61992-61993,61997-62000 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46145
diff
changeset
|
53 #define ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_SPACE) |
|
43576
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
54 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
55 #undef islower |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
56 #define islower(c) undefined_islower(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
57 #undef isupper |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
58 #define isupper(c) undefined_isupper(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
59 #undef isalpha |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
60 #define isalpha(c) undefined_isalpha(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
61 #undef isdigit |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
62 #define isdigit(c) undefined_isdigit(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
63 #undef isxdigit |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
64 #define isxdigit(c) undefined_isxdigit(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
65 #undef isalnum |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
66 #define isalnum(c) undefined_isalnum(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
67 #undef isspace |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
68 #define isspace(c) undefined_isspace(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
69 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
70 extern const unsigned char _Py_ctype_tolower[256]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
71 extern const unsigned char _Py_ctype_toupper[256]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
72 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
73 #define TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
74 #define TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
75 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
76 #undef tolower |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
77 #define tolower(c) undefined_tolower(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
78 #undef toupper |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
79 #define toupper(c) undefined_toupper(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
80 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
81 /* this is needed because some docs are shared from the .o, not static */ |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
82 #define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
83 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
84 #endif /* !Py_BYTES_CTYPE_H */ |
