ppport.html
来自「perl教程」· HTML 代码 · 共 958 行 · 第 1/2 页
HTML
958 行
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>Devel::PPPort - Perl/Pollution/Portability</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<script>writelinks('__top__',2);</script>
<h1><a>Devel::PPPort - Perl/Pollution/Portability</a></h1>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#why_use_ppport_h">Why use ppport.h?</a></li>
<li><a href="#how_to_use_ppport_h">How to use ppport.h</a></li>
<li><a href="#running_ppport_h">Running ppport.h</a></li>
</ul>
<li><a href="#functions">FUNCTIONS</a></li>
<ul>
<li><a href="#writefile">WriteFile</a></li>
</ul>
<li><a href="#compatibility">COMPATIBILITY</a></li>
<ul>
<li><a href="#provided_perl_compatibility_api">Provided Perl compatibility API</a></li>
<li><a href="#perl_api_not_supported_by_ppport_h">Perl API not supported by ppport.h</a></li>
</ul>
<li><a href="#bugs">BUGS</a></li>
<li><a href="#authors">AUTHORS</a></li>
<li><a href="#copyright">COPYRIGHT</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Devel::PPPort - Perl/Pollution/Portability</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
<span class="variable">Devel::PPPort::WriteFile</span><span class="operator">();</span> <span class="comment"># defaults to ./ppport.h</span>
<span class="variable">Devel::PPPort::WriteFile</span><span class="operator">(</span><span class="string">'someheader.h'</span><span class="operator">);</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>Perl's API has changed over time, gaining new features, new functions,
increasing its flexibility, and reducing the impact on the C namespace
environment (reduced pollution). The header file written by this module,
typically <em>ppport.h</em>, attempts to bring some of the newer Perl API
features to older versions of Perl, so that you can worry less about
keeping track of old releases, but users can still reap the benefit.</p>
<p><code>Devel::PPPort</code> contains a single function, called <code>WriteFile</code>. Its
only purpose is to write the <em>ppport.h</em> C header file. This file
contains a series of macros and, if explicitly requested, functions that
allow XS modules to be built using older versions of Perl. Currently,
Perl versions from 5.003 to 5.9.3 are supported.</p>
<p>This module is used by <code>h2xs</code> to write the file <em>ppport.h</em>.</p>
<p>
</p>
<h2><a name="why_use_ppport_h">Why use ppport.h?</a></h2>
<p>You should use <em>ppport.h</em> in modern code so that your code will work
with the widest range of Perl interpreters possible, without significant
additional work.</p>
<p>You should attempt older code to fully use <em>ppport.h</em>, because the
reduced pollution of newer Perl versions is an important thing. It's so
important that the old polluting ways of original Perl modules will not be
supported very far into the future, and your module will almost certainly
break! By adapting to it now, you'll gain compatibility and a sense of
having done the electronic ecology some good.</p>
<p>
</p>
<h2><a name="how_to_use_ppport_h">How to use ppport.h</a></h2>
<p>Don't direct the users of your module to download <code>Devel::PPPort</code>.
They are most probably no XS writers. Also, don't make <em>ppport.h</em>
optional. Rather, just take the most recent copy of <em>ppport.h</em> that
you can find (e.g. by generating it with the latest <code>Devel::PPPort</code>
release from CPAN), copy it into your project, adjust your project to
use it, and distribute the header along with your module.</p>
<p>
</p>
<h2><a name="running_ppport_h">Running ppport.h</a></h2>
<p>But <em>ppport.h</em> is more than just a C header. It's also a Perl script
that can check your source code. It will suggest hints and portability
notes, and can even make suggestions on how to change your code. You
can run it like any other Perl program:</p>
<pre>
perl ppport.h [options] [files]</pre>
<p>It also has embedded documentation, so you can use</p>
<pre>
<a href="../../lib/Pod/perldoc.html">perldoc</a> ppport.h</pre>
<p>to find out more about how to use it.</p>
<p>
</p>
<hr />
<h1><a name="functions">FUNCTIONS</a></h1>
<p>
</p>
<h2><a name="writefile">WriteFile</a></h2>
<p><code>WriteFile</code> takes one optional argument. When called with one
argument, it expects to be passed a filename. When called with
no arguments, it defaults to the filename <em>ppport.h</em>.</p>
<p>The function returns a true value if the file was written successfully.
Otherwise it returns a false value.</p>
<p>
</p>
<hr />
<h1><a name="compatibility">COMPATIBILITY</a></h1>
<p><em>ppport.h</em> supports Perl versions from 5.003 to 5.9.3
in threaded and non-threaded configurations.</p>
<p>
</p>
<h2><a name="provided_perl_compatibility_api">Provided Perl compatibility API</a></h2>
<p>The header file written by this module, typically <em>ppport.h</em>, provides
access to the following elements of the Perl API that is not available
in older Perl releases:</p>
<pre>
_aMY_CXT
_pMY_CXT
aMY_CXT
aMY_CXT_
aTHX
aTHX_
AvFILLp
boolSV
call_argv
call_method
call_pv
call_sv
CopFILE
CopFILE_set
CopFILEAV
CopFILEGV
CopFILEGV_set
CopFILESV
CopSTASH
CopSTASH_eq
CopSTASH_set
CopSTASHPV
CopSTASHPV_set
CopyD
dAX
DEFSV
dITEMS
dMY_CXT
dMY_CXT_SV
dNOOP
dTHR
dTHX
dTHXa
dTHXoa
dUNDERBAR
dXCPT
dXSTARG
END_EXTERN_C
ERRSV
eval_pv
eval_sv
EXTERN_C
get_av
get_cv
get_hv
get_sv
grok_bin
grok_hex
grok_number
GROK_NUMERIC_RADIX
grok_numeric_radix
grok_oct
gv_stashpvn
IN_LOCALE
IN_LOCALE_COMPILETIME
IN_LOCALE_RUNTIME
IN_PERL_COMPILETIME
INT2PTR
IS_NUMBER_GREATER_THAN_UV_MAX
IS_NUMBER_IN_UV
IS_NUMBER_INFINITY
IS_NUMBER_NAN
IS_NUMBER_NEG
IS_NUMBER_NOT_INT
IVdf
IVSIZE
IVTYPE
memEQ
memNE
MoveD
mPUSHi
mPUSHn
mPUSHp
mPUSHu
mXPUSHi
mXPUSHn
mXPUSHp
mXPUSHu
MY_CXT
MY_CXT_CLONE
MY_CXT_INIT
newCONSTSUB
newRV_inc
newRV_noinc
newSVpvn
newSVuv
NOOP
NUM2PTR
NVef
NVff
NVgf
NVTYPE
PERL_BCDVERSION
PERL_GCC_BRACE_GROUPS_FORBIDDEN
PERL_INT_MAX
PERL_INT_MIN
PERL_LONG_MAX
PERL_LONG_MIN
PERL_MAGIC_arylen
PERL_MAGIC_backref
PERL_MAGIC_bm
PERL_MAGIC_collxfrm
PERL_MAGIC_dbfile
PERL_MAGIC_dbline
PERL_MAGIC_defelem
PERL_MAGIC_env
PERL_MAGIC_envelem
PERL_MAGIC_ext
PERL_MAGIC_fm
PERL_MAGIC_glob
PERL_MAGIC_isa
PERL_MAGIC_isaelem
PERL_MAGIC_mutex
PERL_MAGIC_nkeys
PERL_MAGIC_overload
PERL_MAGIC_overload_elem
PERL_MAGIC_overload_table
PERL_MAGIC_pos
PERL_MAGIC_qr
PERL_MAGIC_regdata
PERL_MAGIC_regdatum
PERL_MAGIC_regex_global
PERL_MAGIC_shared
PERL_MAGIC_shared_scalar
PERL_MAGIC_sig
PERL_MAGIC_sigelem
PERL_MAGIC_substr
PERL_MAGIC_sv
PERL_MAGIC_taint
PERL_MAGIC_tied
PERL_MAGIC_tiedelem
PERL_MAGIC_tiedscalar
PERL_MAGIC_utf8
PERL_MAGIC_uvar
PERL_MAGIC_uvar_elem
PERL_MAGIC_vec
PERL_MAGIC_vstring
PERL_QUAD_MAX
PERL_QUAD_MIN
PERL_REVISION
PERL_SCAN_ALLOW_UNDERSCORES
PERL_SCAN_DISALLOW_PREFIX
PERL_SCAN_GREATER_THAN_UV_MAX
PERL_SCAN_SILENT_ILLDIGIT
PERL_SHORT_MAX
PERL_SHORT_MIN
PERL_SUBVERSION
PERL_UCHAR_MAX
PERL_UCHAR_MIN
PERL_UINT_MAX
PERL_UINT_MIN
PERL_ULONG_MAX
PERL_ULONG_MIN
PERL_UNUSED_DECL
PERL_UQUAD_MAX
PERL_UQUAD_MIN
PERL_USHORT_MAX
PERL_USHORT_MIN
PERL_VERSION
PL_compiling
PL_copline
PL_curcop
PL_curstash
PL_DBsingle
PL_DBsub
PL_debstash
PL_defgv
PL_diehook
PL_dirty
PL_dowarn
PL_errgv
PL_hexdigit
PL_hints
PL_na
PL_no_modify
PL_perl_destruct_level
PL_perldb
PL_ppaddr
PL_rsfp
PL_rsfp_filters
PL_stack_base
PL_stack_sp
PL_stdingv
PL_Sv
PL_sv_arenaroot
PL_sv_no
PL_sv_undef
PL_sv_yes
PL_tainted
PL_tainting
pMY_CXT
pMY_CXT_
Poison
pTHX
pTHX_
PTR2IV
PTR2NV
PTR2ul
PTR2UV
PTRV
PUSHmortal
PUSHu
SAVE_DEFSV
START_EXTERN_C
START_MY_CXT
STMT_END
STMT_START
sv_2pv_nolen
sv_2pvbyte
sv_2uv
sv_catpv_mg
sv_catpvf_mg
sv_catpvf_mg_nocontext
sv_catpvn_mg
sv_catpvn_nomg
sv_catsv_mg
sv_catsv_nomg
sv_pvn
sv_pvn_force
sv_pvn_nomg
sv_setiv_mg
sv_setnv_mg
sv_setpv_mg
sv_setpvf_mg
sv_setpvf_mg_nocontext
sv_setpvn_mg
sv_setsv_mg
sv_setsv_nomg
sv_setuv
sv_setuv_mg
sv_usepvn_mg
sv_uv
sv_vcatpvf
sv_vcatpvf_mg
sv_vsetpvf
sv_vsetpvf_mg
SvGETMAGIC
SvIV_nomg
SvPV_force_nomg
SvPV_nolen
SvPV_nomg
SvPVbyte
SvUV
SvUV_nomg
SvUVX
SvUVx
SvUVXx
UNDERBAR
UVof
UVSIZE
UVTYPE
UVuf
UVXf
UVxf
vnewSVpvf
XCPT_CATCH
XCPT_RETHROW
XCPT_TRY_END
XCPT_TRY_START
XPUSHmortal
XPUSHu
XSRETURN_UV
XST_mUV
ZeroD</pre>
<p>
</p>
<h2><a name="perl_api_not_supported_by_ppport_h">Perl API not supported by ppport.h</a></h2>
<p>There is still a big part of the API not supported by <em>ppport.h</em>.
Either because it doesn't make sense to back-port that part of the API,
or simply because it hasn't been implemented yet. Patches welcome!</p>
<p>Here's a list of the currently unsupported API, and also the version of
Perl below which it is unsupported:</p>
<dl>
<dt><strong><a name="item_perl_5_2e9_2e3">perl 5.9.3</a></strong>
<dd>
<pre>
SvMAGIC_set
SvRV_set
SvSTASH_set
SvUV_set
av_arylen_p
dAXMARK
hv_eiter_p
hv_eiter_set
hv_name_set
hv_placeholders_get
hv_placeholders_p
hv_placeholders_set
hv_riter_p
hv_riter_set
is_utf8_string_loclen
newSVhek
newWHILEOP
stashpv_hvname_match</pre>
</dd>
<dt><strong><a name="item_perl_5_2e9_2e2">perl 5.9.2</a></strong>
<dd>
<pre>
SvPVbyte_force
find_rundefsvoffset
gv_fetchpvn_flags
gv_fetchsv
op_refcnt_lock
op_refcnt_unlock
savesvpv
vnormal</pre>
</dd>
<dt><strong><a name="item_perl_5_2e9_2e1">perl 5.9.1</a></strong>
<dd>
<pre>
hv_assert
hv_clear_placeholders
hv_scalar
scan_version
sv_2iv_flags
sv_2uv_flags</pre>
</dd>
<dt><strong><a name="item_perl_5_2e9_2e0">perl 5.9.0</a></strong>
<dd>
<pre>
new_version
save_set_svflags
upg_version
vcmp
vnumify
vstringify</pre>
</dd>
<dt><strong><a name="item_perl_5_2e8_2e3">perl 5.8.3</a></strong>
<dd>
<pre>
SvIsCOW
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?