Kaydet (Commit) ba0d0611 authored tarafından Guido van Rossum's avatar Guido van Rossum

Add macros for direct access to the members of CFunction objects.

üst d4ba73c7
......@@ -56,6 +56,15 @@ extern PyObject *PyFunction_GetGlobals Py_PROTO((PyObject *));
extern PyObject *PyFunction_GetDefaults Py_PROTO((PyObject *));
extern int PyFunction_SetDefaults Py_PROTO((PyObject *, PyObject *));
/* Macros for direct access to these values. Type checks are *not*
done, so use with care. */
#define PyFunction_GET_CODE(func) \
(((PyFunctionObject *)func) -> func_code)
#define PyFunction_GET_GLOBALS(func) \
(((PyFunctionObject *)func) -> func_globals)
#define PyFunction_GET_DEFAULTS(func) \
(((PyFunctionObject *)func) -> func_defaults)
#ifdef __cplusplus
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment