annotate Include/funcobject.h @ 27281:5a050200f736 legacy-trunk

When time.localtime() is passed a tick count the platform C localtime() function can't handle, don't raise IOError -- that doesn't make sense. Raise ValueError instead. Bugfix candidate.
author Tim Peters <tim.peters@gmail.com>
date Fri, 17 Jan 2003 20:08:54 +0000
parents c1eb668525e1
children faabd9867fb8
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
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
22 PyAPI_DATA(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
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
26 PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
27 PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
28 PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
29 PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
30 PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
31 PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
32 PyAPI_FUNC(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
18933
09df3254b49d Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents: 17169
diff changeset
45 /* The classmethod and staticmethod types lives here, too */
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
46 PyAPI_DATA(PyTypeObject) PyClassMethod_Type;
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
47 PyAPI_DATA(PyTypeObject) PyStaticMethod_Type;
18933
09df3254b49d Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents: 17169
diff changeset
48
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
49 PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 18933
diff changeset
50 PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *);
18933
09df3254b49d Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents: 17169
diff changeset
51
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
52 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
53 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
54 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
55 #endif /* !Py_FUNCOBJECT_H */