annotate Include/structseq.h @ 25051:cbee2ed6cd75 legacy-trunk

Note change in behavior from 1.5.2. The new argument to NameError is an error message and not just the missing name. Closes SF Bug 599869.
author Raymond Hettinger <python@rcn.com>
date Tue, 27 Aug 2002 23:53:23 +0000
parents c1eb668525e1
children 0bbea4dcd9be
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20539
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Tuple object interface */
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 #ifndef Py_STRUCTSEQ_H
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 #define Py_STRUCTSEQ_H
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 #ifdef __cplusplus
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 extern "C" {
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 #endif
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 typedef struct PyStructSequence_Field {
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 char *name;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 char *doc;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 } PyStructSequence_Field;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
14
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 typedef struct PyStructSequence_Desc {
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 char *name;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 char *doc;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 struct PyStructSequence_Field *fields;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 int n_in_sequence;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 } PyStructSequence_Desc;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
21
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 20539
diff changeset
22 PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
20539
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 PyStructSequence_Desc *desc);
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
24
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 20539
diff changeset
25 PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
20539
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
26
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 typedef struct {
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 PyObject_VAR_HEAD
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 PyObject *ob_item[1];
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 } PyStructSequence;
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
31
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 /* Macro, *only* to be used to fill in brand new objects */
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 #define PyStructSequence_SET_ITEM(op, i, v) \
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 (((PyStructSequence *)(op))->ob_item[i] = v)
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
35
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 #ifdef __cplusplus
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 }
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 #endif
2d599a36b67a SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 #endif /* !Py_STRUCTSEQ_H */