home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Software / TemaCD / webclean / !!!python!!! / BeOpen-Python-2.0.exe / FUNCOBJECT.H < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-01  |  1.2 KB  |  42 lines

  1.  
  2. /* Function object interface */
  3.  
  4. #ifndef Py_FUNCOBJECT_H
  5. #define Py_FUNCOBJECT_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. typedef struct {
  11.     PyObject_HEAD
  12.     PyObject *func_code;
  13.     PyObject *func_globals;
  14.     PyObject *func_defaults;
  15.     PyObject *func_doc;
  16.     PyObject *func_name;
  17. } PyFunctionObject;
  18.  
  19. extern DL_IMPORT(PyTypeObject) PyFunction_Type;
  20.  
  21. #define PyFunction_Check(op) ((op)->ob_type == &PyFunction_Type)
  22.  
  23. extern DL_IMPORT(PyObject *) PyFunction_New(PyObject *, PyObject *);
  24. extern DL_IMPORT(PyObject *) PyFunction_GetCode(PyObject *);
  25. extern DL_IMPORT(PyObject *) PyFunction_GetGlobals(PyObject *);
  26. extern DL_IMPORT(PyObject *) PyFunction_GetDefaults(PyObject *);
  27. extern DL_IMPORT(int) PyFunction_SetDefaults(PyObject *, PyObject *);
  28.  
  29. /* Macros for direct access to these values. Type checks are *not*
  30.    done, so use with care. */
  31. #define PyFunction_GET_CODE(func) \
  32.         (((PyFunctionObject *)func) -> func_code)
  33. #define PyFunction_GET_GLOBALS(func) \
  34.     (((PyFunctionObject *)func) -> func_globals)
  35. #define PyFunction_GET_DEFAULTS(func) \
  36.     (((PyFunctionObject *)func) -> func_defaults)
  37.  
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #endif /* !Py_FUNCOBJECT_H */
  42.