jpayne@69
|
1 #ifndef Py_ODICTOBJECT_H
|
jpayne@69
|
2 #define Py_ODICTOBJECT_H
|
jpayne@69
|
3 #ifdef __cplusplus
|
jpayne@69
|
4 extern "C" {
|
jpayne@69
|
5 #endif
|
jpayne@69
|
6
|
jpayne@69
|
7
|
jpayne@69
|
8 /* OrderedDict */
|
jpayne@69
|
9 /* This API is optional and mostly redundant. */
|
jpayne@69
|
10
|
jpayne@69
|
11 #ifndef Py_LIMITED_API
|
jpayne@69
|
12
|
jpayne@69
|
13 typedef struct _odictobject PyODictObject;
|
jpayne@69
|
14
|
jpayne@69
|
15 PyAPI_DATA(PyTypeObject) PyODict_Type;
|
jpayne@69
|
16 PyAPI_DATA(PyTypeObject) PyODictIter_Type;
|
jpayne@69
|
17 PyAPI_DATA(PyTypeObject) PyODictKeys_Type;
|
jpayne@69
|
18 PyAPI_DATA(PyTypeObject) PyODictItems_Type;
|
jpayne@69
|
19 PyAPI_DATA(PyTypeObject) PyODictValues_Type;
|
jpayne@69
|
20
|
jpayne@69
|
21 #define PyODict_Check(op) PyObject_TypeCheck(op, &PyODict_Type)
|
jpayne@69
|
22 #define PyODict_CheckExact(op) (Py_TYPE(op) == &PyODict_Type)
|
jpayne@69
|
23 #define PyODict_SIZE(op) PyDict_GET_SIZE((op))
|
jpayne@69
|
24
|
jpayne@69
|
25 PyAPI_FUNC(PyObject *) PyODict_New(void);
|
jpayne@69
|
26 PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item);
|
jpayne@69
|
27 PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key);
|
jpayne@69
|
28
|
jpayne@69
|
29 /* wrappers around PyDict* functions */
|
jpayne@69
|
30 #define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), key)
|
jpayne@69
|
31 #define PyODict_GetItemWithError(od, key) \
|
jpayne@69
|
32 PyDict_GetItemWithError(_PyObject_CAST(od), key)
|
jpayne@69
|
33 #define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), key)
|
jpayne@69
|
34 #define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od))
|
jpayne@69
|
35 #define PyODict_GetItemString(od, key) \
|
jpayne@69
|
36 PyDict_GetItemString(_PyObject_CAST(od), key)
|
jpayne@69
|
37
|
jpayne@69
|
38 #endif
|
jpayne@69
|
39
|
jpayne@69
|
40 #ifdef __cplusplus
|
jpayne@69
|
41 }
|
jpayne@69
|
42 #endif
|
jpayne@69
|
43 #endif /* !Py_ODICTOBJECT_H */
|