Initial import from FreeBSD RELENG_4:
[games.git] / contrib / perl5 / ext / B / ramblings / magic
1 sv_magic()
2 ----------
3 av.c
4 av_store()
5         Storing a non-undef element into an SMAGICAL array, av,
6         assigns the equivalent lowercase form of magic (of the first
7         MAGIC in the chain) to the value (with obj = av, name = 0 and
8         namlen = array index).
9
10 gv.c
11 gv_init()
12         Initialising gv assigns '*' magic to it with obj = gv, name =
13         GvNAME and namlen = GvNAMELEN.
14 gv_fetchpv()
15         @ISA gets 'I' magic with obj = gv, zero name and namlen.
16         %OVERLOAD gets 'A' magic with obj = gv, zero name and namlen.
17         $1 to $9, $&, $`, $', $+ get '\0' magic with obj = gv,
18         name = GvNAME and namlen = len ( = 1 presumably).
19 Gv_AMupdate()
20         Stashes for overload magic seem to get 'c' magic with obj = 0,
21         name = &amt and namlen = sizeof(amt).
22 hv_magic(hv, gv, how)
23         Gives magic how to hv with obj = gv and zero name and namlen.
24
25 mg.c
26 mg_copy(sv, nsv, key, klen)
27         Traverses the magic chain of sv. Upper case forms of magic
28         (only) are copied across to nsv, preserving obj but using
29         name = key and namlen = klen.
30 magic_setpos()
31         LvTARG of a PVLV gets 'g' magic with obj = name = 0 and namlen = pos.
32
33 op.c
34 mod()
35         PVLV operators give magic to their targs with
36         obj = name = namlen = 0. OP_POS gives '.', OP_VEC gives 'v'
37         and OP_SUBSTR gives 'x'.
38
39 perl.c
40 magicname(sym, name, namlen)
41         Fetches/creates a GV with name sym and gives it '\0' magic
42         with obj = gv, name and namlen as passed.
43 init_postdump_symbols()
44         Elements of the environment get given SVs with 'e' magic.
45         obj = sv and name and namlen point to the actual string
46         within env.
47
48 pp.c
49 pp_av2arylen()
50         $#foo gives '#' magic to the new SV with obj = av and
51         name = namlen = 0.
52 pp_study()
53         SV gets 'g' magic with obj = name = namlen = 0.
54 pp_substr()
55         PVLV gets 'x' magic with obj = name = namlen = 0.
56 pp_vec()
57         PVLV gets 'x' magic with obj = name = namlen = 0.
58
59 pp_hot.c
60 pp_match()
61         m//g gets 'g' magic with obj = name = namlen = 0.
62
63 pp_sys.c
64 pp_tie()
65         sv gets magic with obj = sv and name = namlen = 0.
66         If an HV or an AV, it gets 'P' magic, otherwise 'q' magic.
67 pp_dbmopen()
68         'P' magic for the HV just as with pp_tie().
69 pp_sysread()
70         If tainting, the buffer SV gets 't' magic with
71         obj = name = namlen = 0.
72
73 sv.c
74 sv_setsv()
75         Doing sv_setsv(dstr, gv) gives '*' magic to dstr with
76         obj = dstr, name = GvNAME, namlen = GvNAMELEN.
77
78 util.c
79 fbm_compile()
80         The PVBM gets 'B' magic with obj = name = namlen = 0 and SvVALID
81         is set to indicate that the Boyer-Moore table is valid.
82         magic_setbm() just clears the SvVALID flag.
83
84 hv_magic()
85 ----------
86
87 gv.c
88 gv_fetchfile()
89         With perldb, the HV of a gvfile gv gets 'L' magic with obj = gv.
90 gv_fetchpv()
91         %SIG gets 'S' magic with obj = siggv.
92 init_postdump_symbols()
93         %ENV gets 'E' magic with obj = envgv.