1 /* $RCSfile: gv.h,v $$Revision: 4.1 $$Date: 92/08/07 18:26:42 $
3 * Copyright (c) 1991, Larry Wall
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.
9 * Revision 4.1 92/08/07 18:26:42 lwall
11 * Revision 4.0.1.3 92/06/08 15:33:44 lwall
12 * patch20: fixed confusion between a *var's real name and its effective name
13 * patch20: ($<,$>) = ... didn't work on some architectures
15 * Revision 4.0.1.2 91/11/05 18:36:15 lwall
16 * patch11: length($x) was sometimes wrong for numeric $x
18 * Revision 4.0.1.1 91/06/07 11:56:35 lwall
19 * patch4: new copyright notice
20 * patch4: length($`), length($&), length($') now optimized to avoid string copy
22 * Revision 4.0 91/03/20 01:39:49 lwall
28 SV * gp_sv; /* scalar value */
29 U32 gp_refcnt; /* how many globs point to this? */
30 struct io * gp_io; /* filehandle value */
31 CV * gp_form; /* format value */
32 AV * gp_av; /* array value */
33 HV * gp_hv; /* associative array value */
34 GV * gp_egv; /* effective gv, if *glob */
35 CV * gp_cv; /* subroutine value */
36 I32 gp_lastexpr; /* used by nothing_in_common() */
37 line_t gp_line; /* line first declared at (for -w) */
41 #if defined(CRIPPLED_CC) && (defined(iAPX286) || defined(M_I286) || defined(I80286))
45 #define GvXPVGV(gv) ((XPVGV*)SvANY(gv))
47 #define GvMAGIC(gv) (GvGP(gv)->gp_magic)
48 #define GvSV(gv) (GvGP(gv)->gp_sv)
49 #define GvREFCNT(gv) (GvGP(gv)->gp_refcnt)
50 #define GvIO(gv) (GvGP(gv)->gp_io)
51 #define GvIOn(gv) (GvIO(gv) ? \
55 #define GvFORM(gv) (GvGP(gv)->gp_form)
56 #define GvAV(gv) (GvGP(gv)->gp_av)
58 #ifdef MICROPORT /* Microport 2.4 hack */
61 #define GvAVn(gv) (GvGP(gv)->gp_av ? \
63 GvGP(gv_AVadd(gv))->gp_av)
65 #define GvHV(gv) ((GvGP(gv))->gp_hv)
67 #ifdef MICROPORT /* Microport 2.4 hack */
70 #define GvHVn(gv) (GvGP(gv)->gp_hv ? \
72 GvGP(gv_HVadd(gv))->gp_hv)
73 #endif /* Microport 2.4 hack */
75 #define GvCV(gv) (GvGP(gv)->gp_cv)
77 #define GvLASTEXPR(gv) (GvGP(gv)->gp_lastexpr)
79 #define GvLINE(gv) (GvGP(gv)->gp_line)
81 #define GvFLAGS(gv) (GvGP(gv)->gp_flags)
83 #define GvEGV(gv) (GvGP(gv)->gp_egv)
85 #define GvGP(gv) (GvXPVGV(gv)->xgv_gp)
86 #define GvNAME(gv) (GvXPVGV(gv)->xgv_name)
87 #define GvNAMELEN(gv) (GvXPVGV(gv)->xgv_namelen)
88 #define GvENAME(gv) GvNAME(GvEGV(gv))
90 #define GvSTASH(gv) (GvXPVGV(gv)->xgv_stash)
91 #define GvESTASH(gv) GvSTASH(GvEGV(gv))
94 FILE * ifp; /* ifp and ofp are normally the same */
95 FILE * ofp; /* but sockets need separate streams */
97 DIR * dirp; /* for opendir, readdir, etc */
101 long page_len; /* $= */
102 long lines_left; /* $- */
103 char * top_name; /* $^ */
104 GV * top_gv; /* $^ */
105 char * fmt_name; /* $~ */
106 GV * fmt_gv; /* $~ */
107 short subprocess; /* -| or |- */
112 #define IOf_ARGV 1 /* this fp iterates over ARGV */
113 #define IOf_START 2 /* check for null ARGV and substitute '-' */
114 #define IOf_FLUSH 4 /* this fp wants a flush after write op */
116 #define Nullgv Null(GV*)
119 #define DM_RUID 0x001
120 #define DM_EUID 0x002
122 #define DM_RGID 0x010
123 #define DM_EGID 0x020
124 #define DM_DELAY 0x100