Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Acquisition.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*****************************************************************************
  2. Copyright (c) 1996-2002 Zope Foundation and Contributors.
  3. All Rights Reserved.
  4. This software is subject to the provisions of the Zope Public License,
  5. Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
  6. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
  7. WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  8. WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
  9. FOR A PARTICULAR PURPOSE
  10. ****************************************************************************/
  11. #ifndef __ACQUISITION_H_
  12. #define __ACQUISITION_H_
  13. typedef struct {
  14. PyObject *(*AQ_Acquire) (PyObject *obj, PyObject *name, PyObject *filter,
  15. PyObject *extra, int explicit, PyObject *deflt,
  16. int containment);
  17. PyObject *(*AQ_Get) (PyObject *obj, PyObject *name, PyObject *deflt,
  18. int containment);
  19. int (*AQ_IsWrapper) (PyObject *obj);
  20. PyObject *(*AQ_Base) (PyObject *obj);
  21. PyObject *(*AQ_Parent) (PyObject *obj);
  22. PyObject *(*AQ_Self) (PyObject *obj);
  23. PyObject *(*AQ_Inner) (PyObject *obj);
  24. PyObject *(*AQ_Chain) (PyObject *obj, int containment);
  25. } ACQUISITIONCAPI;
  26. #ifndef _IN_ACQUISITION_C
  27. #define aq_Acquire(obj, name, filter, extra, explicit, deflt, containment ) (AcquisitionCAPI == NULL ? NULL : (AcquisitionCAPI->AQ_Acquire(obj, name, filter, extra, explicit, deflt, containment)))
  28. #define aq_acquire(obj, name) (AcquisitionCAPI == NULL ? NULL : (AcquisitionCAPI->AQ_Acquire(obj, name, NULL, NULL, 1, NULL, 0)))
  29. #define aq_get(obj, name, deflt, containment) (AcquisitionCAPI == NULL ? NULL : (AcquisitionCAPI->AQ_Get(obj, name, deflt, containment)))
  30. #define aq_isWrapper(obj) (AcquisitionCAPI == NULL ? -1 : (AcquisitionCAPI->AQ_IsWrapper(obj)))
  31. #define aq_base(obj) (AcquisitionCAPI == NULL ? NULL : (AcquisitionCAPI->AQ_Base(obj)))
  32. #define aq_parent(obj) (AcquisitionCAPI == NULL ? NULL : (AcquisitionCAPI->AQ_Parent(obj)))
  33. #define aq_self(obj) (AcquisitionCAPI == NULL ? NULL : (AcquisitionCAPI->AQ_Self(obj)))
  34. #define aq_inner(obj) (AcquisitionCAPI == NULL ? NULL : (AcquisitionCAPI->AQ_Inner(obj)))
  35. #define aq_chain(obj, containment) (AcquisitionCAPI == NULL ? NULL : (AcquisitionCAPI->AQ_CHain(obj, containment)))
  36. static ACQUISITIONCAPI *AcquisitionCAPI = NULL;
  37. #define aq_init() { \
  38. AcquisitionCAPI = PyCapsule_Import("Acquisition.AcquisitionCAPI", 0); \
  39. }
  40. #endif
  41. #endif