mirror of https://github.com/python/cpython.git
Added getmappingsize(). (Needed by previous checkin of posixmodule.c)
This commit is contained in:
parent
32be3a7a88
commit
4199facacd
|
@ -44,6 +44,7 @@ extern int mappinggetnext
|
|||
extern object *getmappingkeys PROTO((object *mp));
|
||||
extern object *getmappingvalues PROTO((object *mp));
|
||||
extern object *getmappingitems PROTO((object *mp));
|
||||
extern int getmappingsize PROTO((object *mp));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue