From c5da35031084ef05a9f0d2fa402586a9ff531f06 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 10 Sep 1991 14:56:32 +0000 Subject: [PATCH] getlonglongargs --> getlonglongarg Added getlongobjectarg. --- Python/modsupport.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Python/modsupport.c b/Python/modsupport.c index 2f3fa4b2cca..5d56241e273 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -123,7 +123,7 @@ getlongarg(v, a) } int -getlonglongargs(v, a, b) +getlonglongarg(v, a, b) object *v; long *a, *b; { @@ -135,7 +135,25 @@ getlonglongargs(v, a, b) } int -getlonglongobjectargs(v, a, b, c) +getlongobjectarg(v, a, b) + object *v; + long *a; + object **b; +{ + if (v == NULL || !is_tupleobject(v) || gettuplesize(v) != 2) { + return err_badarg(); + } + if (getlongarg(gettupleitem(v, 0), a)) { + *b = gettupleitem(v, 1); + return 1; + } + else { + return err_badarg(); + } +} + +int +getlonglongobjectarg(v, a, b, c) object *v; long *a, *b; object **c;