This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 2
[perl5.git] / av.h
CommitLineData
79072805
LW
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 {
24 char * xpv_pv; /* pointer to malloced string */
25 STRLEN xpv_cur; /* length of xp_pv as a C string */
26 STRLEN xpv_len; /* allocated size */
27 STRLEN xof_off; /* ptr is incremented by offset */
28 double xnv_nv; /* numeric value, if any */
29 MAGIC* xmg_magic; /* magic for scalar array */
30 HV* xmg_stash; /* class package */
31
32 MAGIC* xav_magic; /* magic for elements */
33
34 SV** xav_array;
35 SV** xav_alloc;
36 SV* xav_arylen;
37 I32 xav_max;
38 I32 xav_fill;
39 U8 xav_flags;
40};
41
42#define AVf_REAL 1 /* free old entries */
43
44#define Nullav Null(AV*)
45
46#define AvMAGIC(av) ((XPVAV*) SvANY(av))->xav_magic
47#define AvARRAY(av) ((XPVAV*) SvANY(av))->xav_array
48#define AvALLOC(av) ((XPVAV*) SvANY(av))->xav_alloc
49#define AvMAX(av) ((XPVAV*) SvANY(av))->xav_max
50#define AvFILL(av) ((XPVAV*) SvANY(av))->xav_fill
51#define AvARYLEN(av) ((XPVAV*) SvANY(av))->xav_arylen
52#define AvFLAGS(av) ((XPVAV*) SvANY(av))->xav_flags
53
54#define AvREAL(av) (((XPVAV*) SvANY(av))->xav_flags & AVf_REAL)
55#define AvREAL_on(av) (((XPVAV*) SvANY(av))->xav_flags |= AVf_REAL)
56#define AvREAL_off(av) (((XPVAV*) SvANY(av))->xav_flags &= ~AVf_REAL)