Skip to content

Commit a3bd1cd

Browse files
committed
Move pod from mathoms.c to respective files
The documentation belongs where the implementing macro is #defined
1 parent 876fe29 commit a3bd1cd

File tree

2 files changed

+50
-62
lines changed

2 files changed

+50
-62
lines changed

mathoms.c

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,6 @@ Perl_sv_unref(pTHX_ SV *sv)
9090
sv_unref_flags(sv, 0);
9191
}
9292

93-
/*
94-
=for apidoc_section $tainting
95-
=for apidoc sv_taint
96-
97-
Taint an SV. Use C<SvTAINTED_on> instead.
98-
99-
=cut
100-
*/
101-
10293
void
10394
Perl_sv_taint(pTHX_ SV *sv)
10495
{
@@ -154,35 +145,13 @@ Perl_sv_2pv(pTHX_ SV *sv, STRLEN *lp)
154145
return sv_2pv_flags(sv, lp, SV_GMAGIC);
155146
}
156147

157-
/*
158-
=for apidoc_section $SV
159-
=for apidoc sv_2pv_nolen
160-
161-
Like C<sv_2pv()>, but doesn't return the length too. You should usually
162-
use the macro wrapper C<SvPV_nolen(sv)> instead.
163-
164-
=cut
165-
*/
166-
167148
char *
168149
Perl_sv_2pv_nolen(pTHX_ SV *sv)
169150
{
170151
PERL_ARGS_ASSERT_SV_2PV_NOLEN;
171152
return sv_2pv(sv, NULL);
172153
}
173154

174-
/*
175-
=for apidoc_section $SV
176-
=for apidoc sv_2pvbyte_nolen
177-
178-
Return a pointer to the byte-encoded representation of the SV.
179-
May cause the SV to be downgraded from UTF-8 as a side-effect.
180-
181-
Usually accessed via the C<SvPVbyte_nolen> macro.
182-
183-
=cut
184-
*/
185-
186155
char *
187156
Perl_sv_2pvbyte_nolen(pTHX_ SV *sv)
188157
{
@@ -191,18 +160,6 @@ Perl_sv_2pvbyte_nolen(pTHX_ SV *sv)
191160
return sv_2pvbyte(sv, NULL);
192161
}
193162

194-
/*
195-
=for apidoc_section $SV
196-
=for apidoc sv_2pvutf8_nolen
197-
198-
Return a pointer to the UTF-8-encoded representation of the SV.
199-
May cause the SV to be upgraded to UTF-8 as a side-effect.
200-
201-
Usually accessed via the C<SvPVutf8_nolen> macro.
202-
203-
=cut
204-
*/
205-
206163
char *
207164
Perl_sv_2pvutf8_nolen(pTHX_ SV *sv)
208165
{
@@ -320,25 +277,6 @@ Perl_sv_pvbyte(pTHX_ SV *sv)
320277
return sv_pv(sv);
321278
}
322279

323-
/*
324-
=for apidoc_section $SV
325-
=for apidoc sv_pvbyte
326-
327-
Use C<SvPVbyte_nolen> instead.
328-
329-
=cut
330-
*/
331-
332-
/*
333-
=for apidoc_section $SV
334-
=for apidoc sv_pvutf8
335-
336-
Use the C<SvPVutf8_nolen> macro instead
337-
338-
=cut
339-
*/
340-
341-
342280
char *
343281
Perl_sv_pvutf8(pTHX_ SV *sv)
344282
{

sv.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,9 @@ inputs such as locale settings. C<SvTAINT> propagates that taintedness to
17211721
the outputs of an expression in a pessimistic fashion; i.e., without paying
17221722
attention to precisely which outputs are influenced by which inputs.
17231723
1724+
=for apidoc sv_taint
1725+
Taint an SV. Use C<SvTAINTED_on> instead.
1726+
17241727
=cut
17251728
*/
17261729

@@ -2212,7 +2215,23 @@ immediately written again.
22122215
/* all these 'functions' are now just macros */
22132216

22142217
#define sv_pv(sv) SvPV_nolen(sv)
2218+
2219+
/*
2220+
=for apidoc sv_pvutf8
2221+
2222+
Use the C<SvPVutf8_nolen> macro instead
2223+
2224+
=cut
2225+
*/
22152226
#define sv_pvutf8(sv) SvPVutf8_nolen(sv)
2227+
2228+
/*
2229+
=for apidoc sv_pvbyte
2230+
2231+
Use C<SvPVbyte_nolen> instead.
2232+
2233+
=cut
2234+
*/
22162235
#define sv_pvbyte(sv) SvPVbyte_nolen(sv)
22172236

22182237
#define sv_pvn_force_nomg(sv, lp) sv_pvn_force_flags(sv, lp, 0)
@@ -2246,10 +2265,41 @@ immediately written again.
22462265
#define sv_copypv(dsv, ssv) sv_copypv_flags(dsv, ssv, SV_GMAGIC)
22472266
#define sv_copypv_nomg(dsv, ssv) sv_copypv_flags(dsv, ssv, 0)
22482267
#define sv_2pv(sv, lp) sv_2pv_flags(sv, lp, SV_GMAGIC)
2268+
2269+
/*
2270+
=for apidoc sv_2pv_nolen
2271+
2272+
Like C<sv_2pv()>, but doesn't return the length too. You should usually
2273+
use the macro wrapper C<SvPV_nolen(sv)> instead.
2274+
2275+
=cut
2276+
*/
22492277
#define sv_2pv_nolen(sv) sv_2pv(sv, 0)
22502278
#define sv_2pvbyte(sv, lp) sv_2pvbyte_flags(sv, lp, SV_GMAGIC)
2279+
2280+
/*
2281+
=for apidoc sv_2pvbyte_nolen
2282+
2283+
Return a pointer to the byte-encoded representation of the SV.
2284+
May cause the SV to be downgraded from UTF-8 as a side-effect.
2285+
2286+
Usually accessed via the C<SvPVbyte_nolen> macro.
2287+
2288+
=cut
2289+
*/
22512290
#define sv_2pvbyte_nolen(sv) sv_2pvbyte(sv, 0)
22522291
#define sv_2pvutf8(sv, lp) sv_2pvutf8_flags(sv, lp, SV_GMAGIC)
2292+
2293+
/*
2294+
=for apidoc sv_2pvutf8_nolen
2295+
2296+
Return a pointer to the UTF-8-encoded representation of the SV.
2297+
May cause the SV to be upgraded to UTF-8 as a side-effect.
2298+
2299+
Usually accessed via the C<SvPVutf8_nolen> macro.
2300+
2301+
=cut
2302+
*/
22532303
#define sv_2pvutf8_nolen(sv) sv_2pvutf8(sv, 0)
22542304
#define sv_2pv_nomg(sv, lp) sv_2pv_flags(sv, lp, 0)
22552305
#define sv_pvn_force(sv, lp) sv_pvn_force_flags(sv, lp, SV_GMAGIC)

0 commit comments

Comments
 (0)