diff options
-rw-r--r-- | Include/tupleobject.h | 1 | ||||
-rw-r--r-- | Objects/tupleobject.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Include/tupleobject.h b/Include/tupleobject.h index abdf1ea..5a84ef2 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -51,6 +51,7 @@ extern object *newtupleobject PROTO((int size)); extern int gettuplesize PROTO((object *)); extern object *gettupleitem PROTO((object *, int)); extern int settupleitem PROTO((object *, int, object *)); +extern object *gettupleslice PROTO((object *, int, int)); /* Macro, trading safety for speed */ #define GETTUPLEITEM(op, i) ((op)->ob_item[i]) diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index bce7fdf..ab2cf18 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -228,6 +228,18 @@ tupleslice(a, ilow, ihigh) return (object *)np; } +object * +gettupleslice(op, i, j) + object *op; + int i, j; +{ + if (op == NULL || !is_tupleobject(op)) { + err_badcall(); + return NULL; + } + return tupleslice((tupleobject *)op, i, j); +} + static object * tupleconcat(a, bb) register tupleobject *a; |