perl 5.0 alpha 9
[p5sagit/p5-mst-13.2.git] / av.h
CommitLineData
79072805 1/* $RCSfile: array.h,v $$Revision: 4.1 $$Date: 92/08/07 17:18:24 $
2 *
3 * Copyright (c) 1991, Larry Wall
4 *
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
7 *
8 * $Log: array.h,v $
9 * Revision 4.1 92/08/07 17:18:24 lwall
10 * Stage 6 Snapshot
11 *
12 * Revision 4.0.1.2 92/06/08 11:45:57 lwall
13 * patch20: removed implicit int declarations on funcions
14 *
15 * Revision 4.0.1.1 91/06/07 10:19:20 lwall
16 * patch4: new copyright notice
17 *
18 * Revision 4.0 91/03/20 01:03:44 lwall
19 * 4.0 baseline.
20 *
21 */
22
23struct xpvav {
463ee0b2 24 char * xav_array; /* pointer to malloced string */
25 int xav_fill;
26 int xav_max;
27 int xof_off; /* ptr is incremented by offset */
79072805 28 double xnv_nv; /* numeric value, if any */
29 MAGIC* xmg_magic; /* magic for scalar array */
30 HV* xmg_stash; /* class package */
31
79072805 32 SV** xav_alloc;
33 SV* xav_arylen;
79072805 34 U8 xav_flags;
35};
36
37#define AVf_REAL 1 /* free old entries */
38
39#define Nullav Null(AV*)
40
463ee0b2 41#define AvARRAY(av) ((SV**)((XPVAV*) SvANY(av))->xav_array)
79072805 42#define AvALLOC(av) ((XPVAV*) SvANY(av))->xav_alloc
43#define AvMAX(av) ((XPVAV*) SvANY(av))->xav_max
44#define AvFILL(av) ((XPVAV*) SvANY(av))->xav_fill
45#define AvARYLEN(av) ((XPVAV*) SvANY(av))->xav_arylen
46#define AvFLAGS(av) ((XPVAV*) SvANY(av))->xav_flags
47
48#define AvREAL(av) (((XPVAV*) SvANY(av))->xav_flags & AVf_REAL)
49#define AvREAL_on(av) (((XPVAV*) SvANY(av))->xav_flags |= AVf_REAL)
50#define AvREAL_off(av) (((XPVAV*) SvANY(av))->xav_flags &= ~AVf_REAL)