Mercurial > cpython-lru_cache-weakref
annotate Include/structmember.h @ 84007:dbfbdf2b5c19 3.3
Fix #17967: For ftp urls CWD to target instead of hopping to each directory
towards target. This fixes a bug where target is accessible, but parent
directories are restricted.
| author | Senthil Kumaran <senthil@uthcode.com> |
|---|---|
| date | Sat, 01 Jun 2013 08:27:06 -0700 |
| parents | c84f896e76e9 |
| children |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
1 #ifndef Py_STRUCTMEMBER_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
2 #define Py_STRUCTMEMBER_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
6 |
| 145 | 7 |
| 86 | 8 /* Interface to map C struct members to Python object attributes */ |
| 9 | |
| 1991 | 10 #include <stddef.h> /* For offsetof */ |
| 11 | |
|
42537
74a3c6826683
Remove support for __members__ and __methods__. There still might be
Neal Norwitz <nnorwitz@gmail.com>
parents:
42466
diff
changeset
|
12 /* An array of PyMemberDef structures defines the name, type and offset |
| 86 | 13 of selected members of a C structure. These can be read by |
|
42537
74a3c6826683
Remove support for __members__ and __methods__. There still might be
Neal Norwitz <nnorwitz@gmail.com>
parents:
42466
diff
changeset
|
14 PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY |
|
74a3c6826683
Remove support for __members__ and __methods__. There still might be
Neal Norwitz <nnorwitz@gmail.com>
parents:
42466
diff
changeset
|
15 flag is set). The array must be terminated with an entry whose name |
| 86 | 16 pointer is NULL. */ |
| 17 | |
|
20012
3faabf54b8b8
Add optional docstrings to member descriptors. For backwards
Guido van Rossum <guido@python.org>
parents:
19942
diff
changeset
|
18 typedef struct PyMemberDef { |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
19 char *name; |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
20 int type; |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
21 Py_ssize_t offset; |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
22 int flags; |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
23 char *doc; |
|
20012
3faabf54b8b8
Add optional docstrings to member descriptors. For backwards
Guido van Rossum <guido@python.org>
parents:
19942
diff
changeset
|
24 } PyMemberDef; |
|
3faabf54b8b8
Add optional docstrings to member descriptors. For backwards
Guido van Rossum <guido@python.org>
parents:
19942
diff
changeset
|
25 |
| 86 | 26 /* Types */ |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
27 #define T_SHORT 0 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
28 #define T_INT 1 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
29 #define T_LONG 2 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
30 #define T_FLOAT 3 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
31 #define T_DOUBLE 4 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
32 #define T_STRING 5 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
33 #define T_OBJECT 6 |
|
889
181409141a18
added BYTE, CHAR and unsigned variants
Guido van Rossum <guido@python.org>
parents:
790
diff
changeset
|
34 /* XXX the ordering here is weird for binary compatibility */ |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
35 #define T_CHAR 7 /* 1-character string */ |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
36 #define T_BYTE 8 /* 8-bit signed int */ |
|
889
181409141a18
added BYTE, CHAR and unsigned variants
Guido van Rossum <guido@python.org>
parents:
790
diff
changeset
|
37 /* unsigned variants: */ |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
38 #define T_UBYTE 9 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
39 #define T_USHORT 10 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
40 #define T_UINT 11 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
41 #define T_ULONG 12 |
| 86 | 42 |
|
2023
3d431a521132
- Added ability to get at strings embedded in the struct
Jack Jansen <jack.jansen@cwi.nl>
parents:
1991
diff
changeset
|
43 /* Added by Jack: strings contained in the structure */ |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
44 #define T_STRING_INPLACE 13 |
|
2023
3d431a521132
- Added ability to get at strings embedded in the struct
Jack Jansen <jack.jansen@cwi.nl>
parents:
1991
diff
changeset
|
45 |
|
44885
fefaa0e66fdd
Merged revisions 60176-60209 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
43893
diff
changeset
|
46 /* Added by Lillo: bools contained in the structure (assumed char) */ |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
47 #define T_BOOL 14 |
|
44885
fefaa0e66fdd
Merged revisions 60176-60209 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
43893
diff
changeset
|
48 |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
49 #define T_OBJECT_EX 16 /* Like T_OBJECT, but raises AttributeError |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
50 when the value is NULL, instead of |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
51 converting to None. */ |
|
34677
e9ffad6d8822
Patch #1115086: support PY_LONGLONG in structmember.
Martin v. Löwis <martin@v.loewis.de>
parents:
31504
diff
changeset
|
52 #ifdef HAVE_LONG_LONG |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
53 #define T_LONGLONG 17 |
|
39536
8f5b9982beba
Completely get rid of PyClass and PyInstance.
Guido van Rossum <guido@python.org>
parents:
36516
diff
changeset
|
54 #define T_ULONGLONG 18 |
|
34677
e9ffad6d8822
Patch #1115086: support PY_LONGLONG in structmember.
Martin v. Löwis <martin@v.loewis.de>
parents:
31504
diff
changeset
|
55 #endif /* HAVE_LONG_LONG */ |
|
21187
ef6f692c76e2
Fix SF bug #486144: Uninitialized __slot__ vrbl is None.
Guido van Rossum <guido@python.org>
parents:
20012
diff
changeset
|
56 |
|
42466
3fc3cedc49ca
Merged revisions 56753-56781 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
42110
diff
changeset
|
57 #define T_PYSSIZET 19 /* Py_ssize_t */ |
|
42110
e4f649c4f457
Merged revisions 55962-56019 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
39536
diff
changeset
|
58 #define T_NONE 20 /* Value is always None */ |
|
39536
8f5b9982beba
Completely get rid of PyClass and PyInstance.
Guido van Rossum <guido@python.org>
parents:
36516
diff
changeset
|
59 |
|
42466
3fc3cedc49ca
Merged revisions 56753-56781 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
42110
diff
changeset
|
60 |
|
19942
8522b022f80a
Add support for restricting access based on restricted execution mode.
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
61 /* Flags */ |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
62 #define READONLY 1 |
|
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
63 #define READ_RESTRICTED 2 |
|
43893
483e958d13c7
Fixed some build issues and updated docs.
Christian Heimes <christian@cheimes.de>
parents:
42537
diff
changeset
|
64 #define PY_WRITE_RESTRICTED 4 |
|
77112
c84f896e76e9
s/tabs/spaces, and clean trailing whitespace
Eli Bendersky <eliben@gmail.com>
parents:
75297
diff
changeset
|
65 #define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED) |
|
19942
8522b022f80a
Add support for restricting access based on restricted execution mode.
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
66 |
| 86 | 67 |
|
20012
3faabf54b8b8
Add optional docstrings to member descriptors. For backwards
Guido van Rossum <guido@python.org>
parents:
19942
diff
changeset
|
68 /* Current API, use this */ |
|
36114
e9a10f74cf88
const poisoning, spreading to fix new const warnings
Tim Peters <tim.peters@gmail.com>
parents:
34677
diff
changeset
|
69 PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, struct PyMemberDef *); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
21187
diff
changeset
|
70 PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *); |
|
20012
3faabf54b8b8
Add optional docstrings to member descriptors. For backwards
Guido van Rossum <guido@python.org>
parents:
19942
diff
changeset
|
71 |
|
3faabf54b8b8
Add optional docstrings to member descriptors. For backwards
Guido van Rossum <guido@python.org>
parents:
19942
diff
changeset
|
72 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
73 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
74 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
75 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
76 #endif /* !Py_STRUCTMEMBER_H */ |
