diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 1998-01-13 20:52:38 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 1998-01-13 20:52:38 +0000 |
commit | 93965878572d85daec78ce5ce1926f613d93803b (patch) | |
tree | aec5117a48c78f3e9a90cdbc74ac94a96d1e18d5 /av.h | |
parent | 65d0515c139c3d74c5955ce897f62cd229f1bcce (diff) | |
download | perl-93965878572d85daec78ce5ce1926f613d93803b.tar.gz |
tie array changes to core and tests
p4raw-id: //depot/ansiperl@418
Diffstat (limited to 'av.h')
-rw-r--r-- | av.h | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,6 +1,6 @@ /* av.h * - * Copyright (c) 1991-1997, Larry Wall + * Copyright (c) 1991-1998, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -9,8 +9,8 @@ struct xpvav { char* xav_array; /* pointer to first array element */ - SSize_t xav_fill; - SSize_t xav_max; + SSize_t xav_fill; /* Index of last element present */ + SSize_t xav_max; /* Number of elements for which array has space */ IV xof_off; /* ptr is incremented by offset */ double xnv_nv; /* numeric value, if any */ MAGIC* xmg_magic; /* magic for scalar array */ @@ -30,7 +30,7 @@ struct xpvav { #define AvARRAY(av) ((SV**)((XPVAV*) SvANY(av))->xav_array) #define AvALLOC(av) ((XPVAV*) SvANY(av))->xav_alloc #define AvMAX(av) ((XPVAV*) SvANY(av))->xav_max -#define AvFILL(av) ((XPVAV*) SvANY(av))->xav_fill +#define AvFILLp(av) ((XPVAV*) SvANY(av))->xav_fill #define AvARYLEN(av) ((XPVAV*) SvANY(av))->xav_arylen #define AvFLAGS(av) ((XPVAV*) SvANY(av))->xav_flags @@ -45,4 +45,8 @@ struct xpvav { #define AvREUSED_off(av) (AvFLAGS(av) &= ~AVf_REUSED) #define AvREALISH(av) (AvFLAGS(av) & (AVf_REAL|AVf_REIFY)) + +#define AvFILL(av) ((SvRMAGICAL((SV *) (av))) \ + ? mg_size((SV *) av) \ + : AvFILLp(av)) |