Mercurial > cpython-lru_cache-weakref
annotate Include/methodobject.h @ 24042:63fbbed10714 legacy-trunk
Simplify HTTPSConnection constructor.
See discussion in SF bug 458463.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Fri, 28 Jun 2002 23:38:14 +0000 |
| parents | ddc9543c76a0 |
| children | c1eb668525e1 |
| rev | line source |
|---|---|
| 145 | 1 |
| 6 | 2 /* Method object interface */ |
| 3 | |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
4 #ifndef Py_METHODOBJECT_H |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
5 #define Py_METHODOBJECT_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 |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2256
diff
changeset
|
10 extern DL_IMPORT(PyTypeObject) PyCFunction_Type; |
| 6 | 11 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2072
diff
changeset
|
12 #define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type) |
| 6 | 13 |
|
13447
a89f7f268de4
Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents:
13444
diff
changeset
|
14 typedef PyObject *(*PyCFunction)(PyObject *, PyObject *); |
|
a89f7f268de4
Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents:
13444
diff
changeset
|
15 typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *, |
|
a89f7f268de4
Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents:
13444
diff
changeset
|
16 PyObject *); |
|
19198
3c1c9948ff65
Remove much dead code from ceval.c
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
14375
diff
changeset
|
17 typedef PyObject *(*PyNoArgsFunction)(PyObject *); |
| 6 | 18 |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
19 extern DL_IMPORT(PyCFunction) PyCFunction_GetFunction(PyObject *); |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
20 extern DL_IMPORT(PyObject *) PyCFunction_GetSelf(PyObject *); |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
21 extern DL_IMPORT(int) PyCFunction_GetFlags(PyObject *); |
| 86 | 22 |
|
8656
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
23 /* Macros for direct access to these values. Type checks are *not* |
|
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
24 done, so use with care. */ |
|
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
25 #define PyCFunction_GET_FUNCTION(func) \ |
|
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
26 (((PyCFunctionObject *)func) -> m_ml -> ml_meth) |
|
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
27 #define PyCFunction_GET_SELF(func) \ |
|
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
28 (((PyCFunctionObject *)func) -> m_self) |
|
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
29 #define PyCFunction_GET_FLAGS(func) \ |
|
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
30 (((PyCFunctionObject *)func) -> m_ml -> ml_flags) |
|
19198
3c1c9948ff65
Remove much dead code from ceval.c
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
14375
diff
changeset
|
31 extern DL_IMPORT(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *); |
|
8656
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
32 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2072
diff
changeset
|
33 struct PyMethodDef { |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
34 char *ml_name; |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
35 PyCFunction ml_meth; |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
36 int ml_flags; |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
37 char *ml_doc; |
| 86 | 38 }; |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2072
diff
changeset
|
39 typedef struct PyMethodDef PyMethodDef; |
| 86 | 40 |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
41 extern DL_IMPORT(PyObject *) Py_FindMethod(PyMethodDef[], PyObject *, char *); |
|
2072
cf65a124fa4b
added ml_doc and changed newmethodlist interface
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
42 |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
43 extern DL_IMPORT(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *); |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
44 |
| 2058 | 45 /* Flag passed to newmethodobject */ |
|
13819
95eee868611e
Added #define for oldest version of argument calling
Andrew M. Kuchling <amk@amk.ca>
parents:
13447
diff
changeset
|
46 #define METH_OLDARGS 0x0000 |
| 2058 | 47 #define METH_VARARGS 0x0001 |
|
2863
10e007aef1cf
changes for keyword args to built-in functions and classes
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
48 #define METH_KEYWORDS 0x0002 |
|
22613
ddc9543c76a0
Introduce two new flag bits that can be set in a PyMethodDef method
Fred Drake <fdrake@acm.org>
parents:
19198
diff
changeset
|
49 /* METH_NOARGS and METH_O must not be combined with the flags above. */ |
|
19198
3c1c9948ff65
Remove much dead code from ceval.c
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
14375
diff
changeset
|
50 #define METH_NOARGS 0x0004 |
|
3c1c9948ff65
Remove much dead code from ceval.c
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
14375
diff
changeset
|
51 #define METH_O 0x0008 |
| 2058 | 52 |
|
22613
ddc9543c76a0
Introduce two new flag bits that can be set in a PyMethodDef method
Fred Drake <fdrake@acm.org>
parents:
19198
diff
changeset
|
53 /* METH_CLASS and METH_STATIC are a little different; these control |
|
ddc9543c76a0
Introduce two new flag bits that can be set in a PyMethodDef method
Fred Drake <fdrake@acm.org>
parents:
19198
diff
changeset
|
54 the construction of methods for a class. These cannot be used for |
|
ddc9543c76a0
Introduce two new flag bits that can be set in a PyMethodDef method
Fred Drake <fdrake@acm.org>
parents:
19198
diff
changeset
|
55 functions in modules. */ |
|
ddc9543c76a0
Introduce two new flag bits that can be set in a PyMethodDef method
Fred Drake <fdrake@acm.org>
parents:
19198
diff
changeset
|
56 #define METH_CLASS 0x0010 |
|
ddc9543c76a0
Introduce two new flag bits that can be set in a PyMethodDef method
Fred Drake <fdrake@acm.org>
parents:
19198
diff
changeset
|
57 #define METH_STATIC 0x0020 |
|
ddc9543c76a0
Introduce two new flag bits that can be set in a PyMethodDef method
Fred Drake <fdrake@acm.org>
parents:
19198
diff
changeset
|
58 |
|
2256
d091b246a3a7
added findmethodinchain and methodchain data types
Guido van Rossum <guido@python.org>
parents:
2129
diff
changeset
|
59 typedef struct PyMethodChain { |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
60 PyMethodDef *methods; /* Methods of this type */ |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
61 struct PyMethodChain *link; /* NULL or base type */ |
|
2256
d091b246a3a7
added findmethodinchain and methodchain data types
Guido van Rossum <guido@python.org>
parents:
2129
diff
changeset
|
62 } PyMethodChain; |
|
d091b246a3a7
added findmethodinchain and methodchain data types
Guido van Rossum <guido@python.org>
parents:
2129
diff
changeset
|
63 |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
64 extern DL_IMPORT(PyObject *) Py_FindMethodInChain(PyMethodChain *, PyObject *, |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
65 char *); |
|
2256
d091b246a3a7
added findmethodinchain and methodchain data types
Guido van Rossum <guido@python.org>
parents:
2129
diff
changeset
|
66 |
|
8656
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
67 typedef struct { |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
68 PyObject_HEAD |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
69 PyMethodDef *m_ml; |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
70 PyObject *m_self; |
|
8656
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
71 } PyCFunctionObject; |
|
9e536dd3dc97
Marc-Andre Lemburg's patch to move the typedef for PyCFunctionObject
Guido van Rossum <guido@python.org>
parents:
4503
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_METHODOBJECT_H */ |
