blob: 4f5f94a115c5f055bcd026fac6f3f41b49d460a2 [file] [log] [blame]
Guido van Rossuma3309961993-07-28 09:05:47 +00001#ifndef Py_DICTOBJECT_H
2#define Py_DICTOBJECT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
Guido van Rossumf70e43a1991-02-19 12:39:46 +00007
Guido van Rossum2ec90311997-05-13 21:23:32 +00008/* Dictionary object type -- mapping from hashable object to object */
Guido van Rossum85a5fbb1990-10-14 12:07:46 +00009
Guido van Rossum2ec90311997-05-13 21:23:32 +000010extern DL_IMPORT(PyTypeObject) PyDict_Type;
11
12#define PyDict_Check(op) ((op)->ob_type == &PyDict_Type)
13
Tim Peters1f5871e2000-07-04 17:44:48 +000014extern DL_IMPORT(PyObject *) PyDict_New(void);
15extern DL_IMPORT(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
16extern DL_IMPORT(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
17extern DL_IMPORT(int) PyDict_DelItem(PyObject *mp, PyObject *key);
18extern DL_IMPORT(void) PyDict_Clear(PyObject *mp);
Guido van Rossum43466ec1998-12-04 18:48:25 +000019extern DL_IMPORT(int) PyDict_Next
Tim Peters1f5871e2000-07-04 17:44:48 +000020 (PyObject *mp, int *pos, PyObject **key, PyObject **value);
21extern DL_IMPORT(PyObject *) PyDict_Keys(PyObject *mp);
22extern DL_IMPORT(PyObject *) PyDict_Values(PyObject *mp);
23extern DL_IMPORT(PyObject *) PyDict_Items(PyObject *mp);
24extern DL_IMPORT(int) PyDict_Size(PyObject *mp);
25extern DL_IMPORT(PyObject *) PyDict_Copy(PyObject *mp);
Jeremy Hyltona12c7a72000-03-30 22:27:31 +000026
Guido van Rossum2ec90311997-05-13 21:23:32 +000027
Tim Peters1f5871e2000-07-04 17:44:48 +000028extern DL_IMPORT(PyObject *) PyDict_GetItemString(PyObject *dp, char *key);
29extern DL_IMPORT(int) PyDict_SetItemString(PyObject *dp, char *key, PyObject *item);
30extern DL_IMPORT(int) PyDict_DelItemString(PyObject *dp, char *key);
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000031
Guido van Rossuma3309961993-07-28 09:05:47 +000032#ifdef __cplusplus
33}
34#endif
35#endif /* !Py_DICTOBJECT_H */