diff options
author | Guido van Rossum <guido@python.org> | 1993-11-05 10:18:44 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-11-05 10:18:44 (GMT) |
commit | 4199facacd002fdaa2aa9c00d3bc81f9b8569862 (patch) | |
tree | 59b9e00b2773130a636f683a6c00c09a82110bf0 /Objects | |
parent | 32be3a7a88fd2aae37cdd250f547c0687312c152 (diff) | |
download | cpython-4199facacd002fdaa2aa9c00d3bc81f9b8569862.zip cpython-4199facacd002fdaa2aa9c00d3bc81f9b8569862.tar.gz cpython-4199facacd002fdaa2aa9c00d3bc81f9b8569862.tar.bz2 |
Added getmappingsize(). (Needed by previous checkin of posixmodule.c)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 11 | ||||
-rw-r--r-- | Objects/mappingobject.c | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 2a51d51..b89b7b2 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -566,6 +566,17 @@ mapping_items(mp, args) return v; } +int +getmappingsize(mp) + object *mp; +{ + if (mp == NULL || !is_mappingobject(mp)) { + err_badcall(); + return NULL; + } + return ((mappingobject *)mp)->ma_used; +} + object * getmappingkeys(mp) object *mp; diff --git a/Objects/mappingobject.c b/Objects/mappingobject.c index 2a51d51..b89b7b2 100644 --- a/Objects/mappingobject.c +++ b/Objects/mappingobject.c @@ -566,6 +566,17 @@ mapping_items(mp, args) return v; } +int +getmappingsize(mp) + object *mp; +{ + if (mp == NULL || !is_mappingobject(mp)) { + err_badcall(); + return NULL; + } + return ((mappingobject *)mp)->ma_used; +} + object * getmappingkeys(mp) object *mp; |