packing I32 with L is not nice, need l; from Wolfgang Laun.
[p5sagit/p5-mst-13.2.git] / ext / B / ramblings / magic
CommitLineData
a8a597b2 1sv_magic()
2----------
3av.c
4av_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
10gv.c
11gv_init()
12 Initialising gv assigns '*' magic to it with obj = gv, name =
13 GvNAME and namlen = GvNAMELEN.
14gv_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).
19Gv_AMupdate()
20 Stashes for overload magic seem to get 'c' magic with obj = 0,
21 name = &amt and namlen = sizeof(amt).
22hv_magic(hv, gv, how)
23 Gives magic how to hv with obj = gv and zero name and namlen.
24
25mg.c
26mg_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.
30magic_setpos()
31 LvTARG of a PVLV gets 'g' magic with obj = name = 0 and namlen = pos.
32
33op.c
34mod()
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
39perl.c
40magicname(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.
43init_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
48pp.c
49pp_av2arylen()
50 $#foo gives '#' magic to the new SV with obj = av and
51 name = namlen = 0.
52pp_study()
53 SV gets 'g' magic with obj = name = namlen = 0.
54pp_substr()
55 PVLV gets 'x' magic with obj = name = namlen = 0.
56pp_vec()
57 PVLV gets 'x' magic with obj = name = namlen = 0.
58
59pp_hot.c
60pp_match()
61 m//g gets 'g' magic with obj = name = namlen = 0.
62
63pp_sys.c
64pp_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.
67pp_dbmopen()
68 'P' magic for the HV just as with pp_tie().
69pp_sysread()
70 If tainting, the buffer SV gets 't' magic with
71 obj = name = namlen = 0.
72
73sv.c
74sv_setsv()
75 Doing sv_setsv(dstr, gv) gives '*' magic to dstr with
76 obj = dstr, name = GvNAME, namlen = GvNAMELEN.
77
78util.c
79fbm_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
84hv_magic()
85----------
86
87gv.c
88gv_fetchfile()
89 With perldb, the HV of a gvfile gv gets 'L' magic with obj = gv.
90gv_fetchpv()
91 %SIG gets 'S' magic with obj = siggv.
92init_postdump_symbols()
93 %ENV gets 'E' magic with obj = envgv.