summaryrefslogtreecommitdiff
path: root/do/unshift
blob: 26a3c7897eb04da5144fe5afc8c6695b7c8577a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void
do_unshift(ary,arglast)
register ARRAY *ary;
int *arglast;
{
    register STR **st = stack->ary_array;
    register int sp = arglast[1];
    register int items = arglast[2] - sp;
    register STR *TARG;
    register int i;

    aunshift(ary,items);
    i = 0;
    for (st += ++sp; i < items; i++,st++) {
	TARG = Str_new(27,0);
	str_sset(TARG,*st);
	(void)astore(ary,i,TARG);
    }
}