/* this is Perl_av_unshift() it unshifts 'num' undef values to an array */ /* determine how much non-used spaced is left that's been allocated for this array */ i = AvARRAY(av) - AvALLOC(av); /* if there's room left... */ if (i) { /* if there's more room than we need, just use 'num' */ if (i > num) i = num; /* this will set 'num' to 0 if we had enough room */ /* 'num' is now how many new undef values we need added */ num -= i; AvMAX(av) += i; /* set the highest subscript??? */ AvFILLp(av) += i; /* add to highest subscript */ SvPVX(av) = (char*)(AvARRAY(av) - i); /* where Perl's array starts */ } /* if there wasn't enough room already... */ if (num) { i = AvFILLp(av); /* highest subscript */ av_extend(av, i + num); /* extend array to i+num elements */ AvFILLp(av) += num; /* add to highest subscript */ ary = AvARRAY(av); /* get at the array */ Move(ary, ary + num, i + 1, SV*); /* slide elements up */ do { ary[--num] = &PL_sv_undef; /* set new elements to undef */ } while (num); }