Debian Codegraph @

upstream/mageia-cauldron/man3pm/B::Op_private.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "B::Op_private 3pm"
61 .TH B::Op_private 3pm 2025-06-24 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 B::Op_private \- OP op_private flag definitions
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& use B::Op_private;
72 \&
73 \& # flag details for bit 7 of OP_AELEM\*(Aqs op_private:
74 \& my $name = $B::Op_private::bits{aelem}{7}; # OPpLVAL_INTRO
75 \& my $value = $B::Op_private::defines{$name}; # 128
76 \& my $label = $B::Op_private::labels{$name}; # LVINTRO
77 \&
78 \& # the bit field at bits 5..6 of OP_AELEM\*(Aqs op_private:
79 \& my $bf = $B::Op_private::bits{aelem}{6};
80 \& my $mask = $bf\->{bitmask}; # etc
81 .Ve
82 .SH DESCRIPTION
83 .IX Header "DESCRIPTION"
84 This module provides four global hashes:
85 .PP
86 .Vb 4
87 \& %B::Op_private::bits
88 \& %B::Op_private::defines
89 \& %B::Op_private::labels
90 \& %B::Op_private::ops_using
91 .Ve
92 .PP
93 which contain information about the per\-op meanings of the bits in the
94 op_private field.
95 .ie n .SS %bits
96 .el .SS \f(CW%bits\fP
97 .IX Subsection "%bits"
98 This is indexed by op name and then bit number (0..7). For single bit flags,
99 it returns the name of the define (if any) for that bit:
100 .PP
101 .Vb 1
102 \& $B::Op_private::bits{aelem}{7} eq \*(AqOPpLVAL_INTRO\*(Aq;
103 .Ve
104 .PP
105 For bit fields, it returns a hash ref containing details about the field.
106 The same reference will be returned for all bit positions that make
107 up the bit field; so for example these both return the same hash ref:
108 .PP
109 .Vb 2
110 \& $bitfield = $B::Op_private::bits{aelem}{5};
111 \& $bitfield = $B::Op_private::bits{aelem}{6};
112 .Ve
113 .PP
114 The general format of this hash ref is
115 .PP
116 .Vb 5
117 \& {
118 \& # The bit range and mask; these are always present.
119 \& bitmin => 5,
120 \& bitmax => 6,
121 \& bitmask => 0x60,
122 \&
123 \& # (The remaining keys are optional)
124 \&
125 \& # The names of any defines that were requested:
126 \& mask_def => \*(AqOPpFOO_MASK\*(Aq,
127 \& baseshift_def => \*(AqOPpFOO_SHIFT\*(Aq,
128 \& bitcount_def => \*(AqOPpFOO_BITS\*(Aq,
129 \&
130 \& # If present, Concise etc will display the value with a \*(AqFOO=\*(Aq
131 \& # prefix. If it equals \*(Aq\-\*(Aq, then Concise will treat the bit
132 \& # field as raw bits and not try to interpret it.
133 \& label => \*(AqFOO\*(Aq,
134 \&
135 \& # If present, specifies the names of some defines and the
136 \& # display labels that are used to assign meaning to particu\-
137 \& # lar integer values within the bit field; e.g. 3 is dis\-
138 \& # played as \*(AqC\*(Aq.
139 \& enum => [ qw(
140 \& 1 OPpFOO_A A
141 \& 2 OPpFOO_B B
142 \& 3 OPpFOO_C C
143 \& )],
144 \&
145 \& };
146 .Ve
147 .ie n .SS %defines
148 .el .SS \f(CW%defines\fP
149 .IX Subsection "%defines"
150 This gives the value of every \f(CW\*(C`OPp\*(C'\fR define, e.g.
151 .PP
152 .Vb 1
153 \& $B::Op_private::defines{OPpLVAL_INTRO} == 128;
154 .Ve
155 .ie n .SS %labels
156 .el .SS \f(CW%labels\fP
157 .IX Subsection "%labels"
158 This gives the short display label for each define, as used by \f(CW\*(C`B::Concise\*(C'\fR
159 and \f(CW\*(C`perl \-Dx\*(C'\fR, e.g.
160 .PP
161 .Vb 1
162 \& $B::Op_private::labels{OPpLVAL_INTRO} eq \*(AqLVINTRO\*(Aq;
163 .Ve
164 .PP
165 If the label equals \*(Aq\-\*(Aq, then Concise will treat the bit as a raw bit and
166 not try to display it symbolically.
167 .ie n .SS %ops_using
168 .el .SS \f(CW%ops_using\fP
169 .IX Subsection "%ops_using"
170 For each define, this gives a reference to an array of op names that use
171 the flag.
172 .PP
173 .Vb 1
174 \& @ops_using_lvintro = @{ $B::Op_private::ops_using{OPp_LVAL_INTRO} };
175 .Ve