annotate Include/funcobject.h @ 17581:c1937faabb23 2.1

Added support for optional explanation parameter to the \versionadded macro. Refactored do_cmd_versionadded() and do_cmd_versionchanged() to do most of the work in a helper function, with the do_cmd_*() wrappers just supplying a portion of the replacement text.
author Fred Drake <fdrake@acm.org>
date Wed, 18 Apr 2001 17:29:14 +0000
parents d807488dfc7a
children 09df3254b49d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
853b736a6a9e Added copyright notice.
Guido van Rossum <guido@python.org>
parents: 85
diff changeset
1
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Function object interface */
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
13444
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
4 #ifndef Py_FUNCOBJECT_H
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
5 #define Py_FUNCOBJECT_H
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
6 #ifdef __cplusplus
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
7 extern "C" {
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
8 #endif
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
9
1288
9fed5726a36d Several changes in one:
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
10 typedef struct {
13444
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
11 PyObject_HEAD
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
12 PyObject *func_code;
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
13 PyObject *func_globals;
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
14 PyObject *func_defaults;
16257
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15894
diff changeset
15 PyObject *func_closure;
13444
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
16 PyObject *func_doc;
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
17 PyObject *func_name;
15894
1c6b0d3a58ea Committing PEP 232, function attribute feature, approved by Guido.
Barry Warsaw <barry@python.org>
parents: 14375
diff changeset
18 PyObject *func_dict;
17169
d807488dfc7a Add the necessary field for weak reference support to the function and
Fred Drake <fdrake@acm.org>
parents: 16257
diff changeset
19 PyObject *func_weakreflist;
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 2073
diff changeset
20 } PyFunctionObject;
1288
9fed5726a36d Several changes in one:
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
21
2436
fa98dda07877 make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents: 2146
diff changeset
22 extern DL_IMPORT(PyTypeObject) PyFunction_Type;
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
23
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 2073
diff changeset
24 #define PyFunction_Check(op) ((op)->ob_type == &PyFunction_Type)
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
25
13444
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
26 extern DL_IMPORT(PyObject *) PyFunction_New(PyObject *, PyObject *);
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
27 extern DL_IMPORT(PyObject *) PyFunction_GetCode(PyObject *);
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
28 extern DL_IMPORT(PyObject *) PyFunction_GetGlobals(PyObject *);
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
29 extern DL_IMPORT(PyObject *) PyFunction_GetDefaults(PyObject *);
5709ddba423c ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
30 extern DL_IMPORT(int) PyFunction_SetDefaults(PyObject *, PyObject *);
16257
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15894
diff changeset
31 extern DL_IMPORT(PyObject *) PyFunction_GetClosure(PyObject *);
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15894
diff changeset
32 extern DL_IMPORT(int) PyFunction_SetClosure(PyObject *, PyObject *);
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
33
8658
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
34 /* Macros for direct access to these values. Type checks are *not*
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
35 done, so use with care. */
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
36 #define PyFunction_GET_CODE(func) \
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
37 (((PyFunctionObject *)func) -> func_code)
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
38 #define PyFunction_GET_GLOBALS(func) \
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
39 (((PyFunctionObject *)func) -> func_globals)
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
40 #define PyFunction_GET_DEFAULTS(func) \
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
41 (((PyFunctionObject *)func) -> func_defaults)
16257
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15894
diff changeset
42 #define PyFunction_GET_CLOSURE(func) \
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15894
diff changeset
43 (((PyFunctionObject *)func) -> func_closure)
8658
1e93fa021405 Add macros for direct access to the members of CFunction objects.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
44
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
45 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
46 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
47 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
48 #endif /* !Py_FUNCOBJECT_H */