Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 1 | #ifndef Py_DICTOBJECT_H |
| 2 | #define Py_DICTOBJECT_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 7 | |
Guido van Rossum | 2ec9031 | 1997-05-13 21:23:32 +0000 | [diff] [blame] | 8 | /* Dictionary object type -- mapping from hashable object to object */ |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 9 | |
Guido van Rossum | 2ec9031 | 1997-05-13 21:23:32 +0000 | [diff] [blame] | 10 | extern DL_IMPORT(PyTypeObject) PyDict_Type; |
| 11 | |
| 12 | #define PyDict_Check(op) ((op)->ob_type == &PyDict_Type) |
| 13 | |
Tim Peters | 1f5871e | 2000-07-04 17:44:48 +0000 | [diff] [blame] | 14 | extern DL_IMPORT(PyObject *) PyDict_New(void); |
| 15 | extern DL_IMPORT(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key); |
| 16 | extern DL_IMPORT(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); |
| 17 | extern DL_IMPORT(int) PyDict_DelItem(PyObject *mp, PyObject *key); |
| 18 | extern DL_IMPORT(void) PyDict_Clear(PyObject *mp); |
Guido van Rossum | 43466ec | 1998-12-04 18:48:25 +0000 | [diff] [blame] | 19 | extern DL_IMPORT(int) PyDict_Next |
Tim Peters | 1f5871e | 2000-07-04 17:44:48 +0000 | [diff] [blame] | 20 | (PyObject *mp, int *pos, PyObject **key, PyObject **value); |
| 21 | extern DL_IMPORT(PyObject *) PyDict_Keys(PyObject *mp); |
| 22 | extern DL_IMPORT(PyObject *) PyDict_Values(PyObject *mp); |
| 23 | extern DL_IMPORT(PyObject *) PyDict_Items(PyObject *mp); |
| 24 | extern DL_IMPORT(int) PyDict_Size(PyObject *mp); |
| 25 | extern DL_IMPORT(PyObject *) PyDict_Copy(PyObject *mp); |
Jeremy Hylton | a12c7a7 | 2000-03-30 22:27:31 +0000 | [diff] [blame] | 26 | |
Guido van Rossum | 2ec9031 | 1997-05-13 21:23:32 +0000 | [diff] [blame] | 27 | |
Tim Peters | 1f5871e | 2000-07-04 17:44:48 +0000 | [diff] [blame] | 28 | extern DL_IMPORT(PyObject *) PyDict_GetItemString(PyObject *dp, char *key); |
| 29 | extern DL_IMPORT(int) PyDict_SetItemString(PyObject *dp, char *key, PyObject *item); |
| 30 | extern DL_IMPORT(int) PyDict_DelItemString(PyObject *dp, char *key); |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 31 | |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 32 | #ifdef __cplusplus |
| 33 | } |
| 34 | #endif |
| 35 | #endif /* !Py_DICTOBJECT_H */ |