summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-17 19:28:08 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-17 19:28:08 (GMT)
commitc299fc16f2a8572780d2130ab9e55a6f22a93279 (patch)
tree6087eb98f0bc194027bf913662f960f9a68ad545 /Include
parentbf80a033ee76487de30ea272a8c79346d26536ff (diff)
downloadcpython-c299fc16f2a8572780d2130ab9e55a6f22a93279.zip
cpython-c299fc16f2a8572780d2130ab9e55a6f22a93279.tar.gz
cpython-c299fc16f2a8572780d2130ab9e55a6f22a93279.tar.bz2
Add support for restricting access based on restricted execution mode.
Renamed the 'readonly' field to 'flags' and defined some new flag bits: READ_RESTRICTED and WRITE_RESTRICTED, as well as a shortcut RESTRICTED that means both.
Diffstat (limited to 'Include')
-rw-r--r--Include/structmember.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Include/structmember.h b/Include/structmember.h
index 09e62cf..cd35fdb 100644
--- a/Include/structmember.h
+++ b/Include/structmember.h
@@ -31,7 +31,7 @@ struct memberlist {
char *name;
int type;
int offset;
- int readonly;
+ int flags;
};
/* Types */
@@ -58,9 +58,13 @@ struct memberlist {
#define T_PSTRING_INPLACE 15
#endif /* macintosh */
-/* Readonly flag */
+/* Flags */
#define READONLY 1
#define RO READONLY /* Shorthand */
+#define READ_RESTRICTED 2
+#define WRITE_RESTRICTED 4
+#define RESTRICTED (READ_RESTRICTED | WRITE_RESTRICTED)
+
DL_IMPORT(PyObject *) PyMember_Get(char *, struct memberlist *, char *);
DL_IMPORT(int) PyMember_Set(char *, struct memberlist *, char *, PyObject *);