/HTML/S/540.html
HTML | 113 lines | 113 code | 0 blank | 0 comment | 0 complexity | 209172bbf226d32645e396edd2a8799a MD5 | raw file
- <html>
- <head>
- <title>Include/methodobject.h</title>
- <meta name='robots' content='noindex,nofollow'>
- <meta name='generator' content='GLOBAL-5.8.1'>
- </head>
- <body text='#191970' bgcolor='#f5f5dc' vlink='gray'>
- <a name='TOP'><h2><a href='../mains.html'>root</a>/<a href='../files/3349.html'>Include</a>/methodobject.h</h2>
- <i><font color='green'>/* [<][>]<a href='#L23'>[^]</a><a href='#L49'>[v]</a>[top]<a href='#BOTTOM'>[bottom]</a><a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</font></i>
- <hr>
- <h2><a href='570.html#L88' title='Included from 88 in Include/Python.h.'>INCLUDED FROM</a></h2>
- <hr>
- <h2>DEFINITIONS</h2>
- This source file includes following definitions.
- <ol>
- <li><a href='#L23' title='Defined at 23.'>PyAPI_FUNC</a>
- <li><a href='#L49' title='Defined at 49.'>PyAPI_FUNC</a>
- </ol>
- <hr>
- <pre>
- <a name='L1'>
- <a name='L2'><i><font color='green'>/* Method object interface */</font></i>
- <a name='L3'>
- <a name='L4'><font color='darkred'>#ifndef</font> <a href='../S/540.html#L5' title='Defined at 5 in Include/methodobject.h.'>Py_METHODOBJECT_H</a>
- <a name='L5'><font color='darkred'>#define</font> <a href='../S/540.html#L4' title='Refered from 4 in Include/methodobject.h.'>Py_METHODOBJECT_H</a>
- <a name='L6'><font color='darkred'>#ifdef</font> __cplusplus
- <a name='L7'><b>extern</b> "C" <font color='red'>{</font>
- <a name='L8'><font color='darkred'>#endif</font>
- <a name='L9'>
- <a name='L10'><i><font color='green'>/* This is about the type 'builtin_function_or_method',</font></i>
- <a name='L11'><i><font color='green'> not Python methods in user-defined classes. See classobject.h</font></i>
- <a name='L12'><i><font color='green'> for the latter. */</font></i>
- <a name='L13'>
- <a name='L14'><a href='../D/2715.html' title='Multiple defined in 8 places.'>PyAPI_DATA</a>(PyTypeObject) PyCFunction_Type;
- <a name='L15'>
- <a name='L16'><font color='darkred'>#define</font> PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type)
- <a name='L17'>
- <a name='L18'><b>typedef</b> <a href='../D/3593.html' title='Multiple defined in 2 places.'>PyObject</a> *(*PyCFunction)(PyObject *, PyObject *);
- <a name='L19'><b>typedef</b> <a href='../D/3593.html' title='Multiple defined in 2 places.'>PyObject</a> *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
- <a name='L20'> PyObject *);
- <a name='L21'><b>typedef</b> <a href='../D/3593.html' title='Multiple defined in 2 places.'>PyObject</a> *(*PyNoArgsFunction)(PyObject *);
- <a name='L22'>
- <a name='L23'><a href='../R/2475.html' title='Multiple refered from 87 places.'>PyAPI_FUNC</a>(PyCFunction) PyCFunction_GetFunction(PyObject *);
- <a name='L24'>PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *);
- <a name='L25'>PyAPI_FUNC(<b>int</b>) PyCFunction_GetFlags(PyObject *);
- <a name='L26'>
- <a name='L27'><i><font color='green'>/* Macros for direct access to these values. Type checks are *not*</font></i>
- <a name='L28'><i><font color='green'> done, so use with care. */</font></i>
- <a name='L29'><font color='darkred'>#ifndef</font> Py_LIMITED_API
- <a name='L30'><font color='darkred'>#define</font> PyCFunction_GET_FUNCTION(func) \
- <a name='L31'> (((PyCFunctionObject *)func) -> m_ml -> ml_meth)
- <a name='L32'><font color='darkred'>#define</font> PyCFunction_GET_SELF(func) \
- <a name='L33'> (((PyCFunctionObject *)func) -> m_self)
- <a name='L34'><font color='darkred'>#define</font> PyCFunction_GET_FLAGS(func) \
- <a name='L35'> (((PyCFunctionObject *)func) -> m_ml -> ml_flags)
- <a name='L36'><font color='darkred'>#endif</font>
- <a name='L37'>PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
- <a name='L38'>
- <a name='L39'><b>struct</b> PyMethodDef <font color='red'>{</font>
- <a name='L40'> <b>const</b> <b>char</b> *ml_name; <i><font color='green'>/* The name of the built-in function/method */</font></i>
- <a name='L41'> PyCFunction ml_meth; <i><font color='green'>/* The C function that implements it */</font></i>
- <a name='L42'> <b>int</b> ml_flags; <i><font color='green'>/* Combination of METH_xxx flags, which mostly</font></i>
- <a name='L43'><i><font color='green'> describe the args expected by the C func */</font></i>
- <a name='L44'> <b>const</b> <b>char</b> *ml_doc; <i><font color='green'>/* The __doc__ attribute, or NULL */</font></i>
- <a name='L45'><font color='red'>}</font>;
- <a name='L46'><b>typedef</b> <b>struct</b> <a href='../D/3525.html' title='Multiple defined in 3 places.'>PyMethodDef</a> <a href='../R/3180.html' title='Multiple refered from 255 places.'>PyMethodDef</a>;
- <a name='L47'>
- <a name='L48'><font color='darkred'>#define</font> <a href='../R/2605.html' title='Multiple refered from 13 places.'>PyCFunction_New</a>(ML, SELF) <a href='../S/2801.html#L17' title='Defined at 17 in Objects/methodobject.c.'>PyCFunction_NewEx</a>((ML), (SELF), <a href='../S/2891.html#L5' title='Defined at 5 in PC/os2emx/dllentry.c.'>NULL</a>)
- <a name='L49'><a href='../R/2475.html' title='Multiple refered from 87 places.'>PyAPI_FUNC</a>(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *,
- <a name='L50'> PyObject *);
- <a name='L51'>
- <a name='L52'><i><font color='green'>/* Flag passed to newmethodobject */</font></i>
- <a name='L53'><i><font color='green'>/* #define METH_OLDARGS 0x0000 -- unsupported now */</font></i>
- <a name='L54'><font color='darkred'>#define</font> <a href='../S/2858.html#L633' title='Defined at 633 in PC/bdist_wininst/install.c.'>METH_VARARGS</a> 0x0001
- <a name='L55'><font color='darkred'>#define</font> METH_KEYWORDS 0x0002
- <a name='L56'><i><font color='green'>/* METH_NOARGS and METH_O must not be combined with the flags above. */</font></i>
- <a name='L57'><font color='darkred'>#define</font> <a href='../S/2858.html#L634' title='Defined at 634 in PC/bdist_wininst/install.c.'>METH_NOARGS</a> 0x0004
- <a name='L58'><font color='darkred'>#define</font> METH_O 0x0008
- <a name='L59'>
- <a name='L60'><i><font color='green'>/* METH_CLASS and METH_STATIC are a little different; these control</font></i>
- <a name='L61'><i><font color='green'> the construction of methods for a class. These cannot be used for</font></i>
- <a name='L62'><i><font color='green'> functions in modules. */</font></i>
- <a name='L63'><font color='darkred'>#define</font> METH_CLASS 0x0010
- <a name='L64'><font color='darkred'>#define</font> METH_STATIC 0x0020
- <a name='L65'>
- <a name='L66'><i><font color='green'>/* METH_COEXIST allows a method to be entered even though a slot has</font></i>
- <a name='L67'><i><font color='green'> already filled the entry. When defined, the flag allows a separate</font></i>
- <a name='L68'><i><font color='green'> method, "__contains__" for example, to coexist with a defined </font></i>
- <a name='L69'><i><font color='green'> slot like sq_contains. */</font></i>
- <a name='L70'>
- <a name='L71'><font color='darkred'>#define</font> METH_COEXIST 0x0040
- <a name='L72'>
- <a name='L73'><font color='darkred'>#ifndef</font> Py_LIMITED_API
- <a name='L74'><b>typedef</b> <b>struct</b> <font color='red'>{</font>
- <a name='L75'> <a href='../S/544.html#L82' title='Defined at 82 in Include/object.h.'>PyObject_HEAD</a>
- <a name='L76'> <a href='../D/3525.html' title='Multiple defined in 3 places.'>PyMethodDef</a> *m_ml; <i><font color='green'>/* Description of the C function to call */</font></i>
- <a name='L77'> <a href='../D/3593.html' title='Multiple defined in 2 places.'>PyObject</a> *m_self; <i><font color='green'>/* Passed as 'self' arg to the C func, can be NULL */</font></i>
- <a name='L78'> <a href='../D/3593.html' title='Multiple defined in 2 places.'>PyObject</a> *m_module; <i><font color='green'>/* The __module__ attribute, can be anything */</font></i>
- <a name='L79'><font color='red'>}</font> PyCFunctionObject;
- <a name='L80'><font color='darkred'>#endif</font>
- <a name='L81'>
- <a name='L82'><a href='../D/2716.html' title='Multiple defined in 45 places.'>PyAPI_FUNC</a>(<b>int</b>) PyCFunction_ClearFreeList(<b>void</b>);
- <a name='L83'>
- <a name='L84'><font color='darkred'>#ifdef</font> __cplusplus
- <a name='L85'><font color='red'>}</font>
- <a name='L86'><font color='darkred'>#endif</font>
- <a name='L87'><font color='darkred'>#endif</font> <i><font color='green'>/* !Py_METHODOBJECT_H */</font></i>
- </pre>
- <hr>
- <a name='BOTTOM'>
- <i><font color='green'>/* [<][>]<a href='#L23'>[^]</a><a href='#L49'>[v]</a><a href='#TOP'>[top]</a>[bottom]<a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</font></i>
- </body>
- </html>