Perl version

Modules

  • ABCDE
  • FGHIL
  • MNOPS
  • TUX

Devel::PPPort

Perl 5 version 8.8 documentation
Recently read

Devel::PPPort

NAME

Devel::PPPort - Perl/Pollution/Portability

SYNOPSIS

  1. Devel::PPPort::WriteFile(); # defaults to ./ppport.h
  2. Devel::PPPort::WriteFile('someheader.h');

DESCRIPTION

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 ppport.h, 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.

Devel::PPPort contains a single function, called WriteFile . Its only purpose is to write the ppport.h 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.

This module is used by h2xs to write the file ppport.h.

Why use ppport.h?

You should use ppport.h in modern code so that your code will work with the widest range of Perl interpreters possible, without significant additional work.

You should attempt older code to fully use ppport.h, 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.

How to use ppport.h

Don't direct the users of your module to download Devel::PPPort . They are most probably no XS writers. Also, don't make ppport.h optional. Rather, just take the most recent copy of ppport.h that you can find (e.g. by generating it with the latest Devel::PPPort release from CPAN), copy it into your project, adjust your project to use it, and distribute the header along with your module.

Running ppport.h

But ppport.h 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:

  1. perl ppport.h [options] [files]

It also has embedded documentation, so you can use

  1. perldoc ppport.h

to find out more about how to use it.

FUNCTIONS

WriteFile

WriteFile 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 ppport.h.

The function returns a true value if the file was written successfully. Otherwise it returns a false value.

COMPATIBILITY

ppport.h supports Perl versions from 5.003 to 5.9.3 in threaded and non-threaded configurations.

Provided Perl compatibility API

The header file written by this module, typically ppport.h, provides access to the following elements of the Perl API that is not available in older Perl releases:

  1. _aMY_CXT
  2. _pMY_CXT
  3. aMY_CXT
  4. aMY_CXT_
  5. aTHX
  6. aTHX_
  7. AvFILLp
  8. boolSV
  9. call_argv
  10. call_method
  11. call_pv
  12. call_sv
  13. CopFILE
  14. CopFILE_set
  15. CopFILEAV
  16. CopFILEGV
  17. CopFILEGV_set
  18. CopFILESV
  19. CopSTASH
  20. CopSTASH_eq
  21. CopSTASH_set
  22. CopSTASHPV
  23. CopSTASHPV_set
  24. CopyD
  25. dAX
  26. DEFSV
  27. dITEMS
  28. dMY_CXT
  29. dMY_CXT_SV
  30. dNOOP
  31. dTHR
  32. dTHX
  33. dTHXa
  34. dTHXoa
  35. dUNDERBAR
  36. dXCPT
  37. dXSTARG
  38. END_EXTERN_C
  39. ERRSV
  40. eval_pv
  41. eval_sv
  42. EXTERN_C
  43. get_av
  44. get_cv
  45. get_hv
  46. get_sv
  47. grok_bin
  48. grok_hex
  49. grok_number
  50. GROK_NUMERIC_RADIX
  51. grok_numeric_radix
  52. grok_oct
  53. gv_stashpvn
  54. IN_LOCALE
  55. IN_LOCALE_COMPILETIME
  56. IN_LOCALE_RUNTIME
  57. IN_PERL_COMPILETIME
  58. INT2PTR
  59. IS_NUMBER_GREATER_THAN_UV_MAX
  60. IS_NUMBER_IN_UV
  61. IS_NUMBER_INFINITY
  62. IS_NUMBER_NAN
  63. IS_NUMBER_NEG
  64. IS_NUMBER_NOT_INT
  65. IVdf
  66. IVSIZE
  67. IVTYPE
  68. memEQ
  69. memNE
  70. MoveD
  71. mPUSHi
  72. mPUSHn
  73. mPUSHp
  74. mPUSHu
  75. mXPUSHi
  76. mXPUSHn
  77. mXPUSHp
  78. mXPUSHu
  79. MY_CXT
  80. MY_CXT_CLONE
  81. MY_CXT_INIT
  82. newCONSTSUB
  83. newRV_inc
  84. newRV_noinc
  85. newSVpvn
  86. newSVuv
  87. NOOP
  88. NUM2PTR
  89. NVef
  90. NVff
  91. NVgf
  92. NVTYPE
  93. PERL_BCDVERSION
  94. PERL_GCC_BRACE_GROUPS_FORBIDDEN
  95. PERL_INT_MAX
  96. PERL_INT_MIN
  97. PERL_LONG_MAX
  98. PERL_LONG_MIN
  99. PERL_MAGIC_arylen
  100. PERL_MAGIC_backref
  101. PERL_MAGIC_bm
  102. PERL_MAGIC_collxfrm
  103. PERL_MAGIC_dbfile
  104. PERL_MAGIC_dbline
  105. PERL_MAGIC_defelem
  106. PERL_MAGIC_env
  107. PERL_MAGIC_envelem
  108. PERL_MAGIC_ext
  109. PERL_MAGIC_fm
  110. PERL_MAGIC_glob
  111. PERL_MAGIC_isa
  112. PERL_MAGIC_isaelem
  113. PERL_MAGIC_mutex
  114. PERL_MAGIC_nkeys
  115. PERL_MAGIC_overload
  116. PERL_MAGIC_overload_elem
  117. PERL_MAGIC_overload_table
  118. PERL_MAGIC_pos
  119. PERL_MAGIC_qr
  120. PERL_MAGIC_regdata
  121. PERL_MAGIC_regdatum
  122. PERL_MAGIC_regex_global
  123. PERL_MAGIC_shared
  124. PERL_MAGIC_shared_scalar
  125. PERL_MAGIC_sig
  126. PERL_MAGIC_sigelem
  127. PERL_MAGIC_substr
  128. PERL_MAGIC_sv
  129. PERL_MAGIC_taint
  130. PERL_MAGIC_tied
  131. PERL_MAGIC_tiedelem
  132. PERL_MAGIC_tiedscalar
  133. PERL_MAGIC_utf8
  134. PERL_MAGIC_uvar
  135. PERL_MAGIC_uvar_elem
  136. PERL_MAGIC_vec
  137. PERL_MAGIC_vstring
  138. PERL_QUAD_MAX
  139. PERL_QUAD_MIN
  140. PERL_REVISION
  141. PERL_SCAN_ALLOW_UNDERSCORES
  142. PERL_SCAN_DISALLOW_PREFIX
  143. PERL_SCAN_GREATER_THAN_UV_MAX
  144. PERL_SCAN_SILENT_ILLDIGIT
  145. PERL_SHORT_MAX
  146. PERL_SHORT_MIN
  147. PERL_SUBVERSION
  148. PERL_UCHAR_MAX
  149. PERL_UCHAR_MIN
  150. PERL_UINT_MAX
  151. PERL_UINT_MIN
  152. PERL_ULONG_MAX
  153. PERL_ULONG_MIN
  154. PERL_UNUSED_DECL
  155. PERL_UQUAD_MAX
  156. PERL_UQUAD_MIN
  157. PERL_USHORT_MAX
  158. PERL_USHORT_MIN
  159. PERL_VERSION
  160. PL_compiling
  161. PL_copline
  162. PL_curcop
  163. PL_curstash
  164. PL_DBsingle
  165. PL_DBsub
  166. PL_debstash
  167. PL_defgv
  168. PL_diehook
  169. PL_dirty
  170. PL_dowarn
  171. PL_errgv
  172. PL_hexdigit
  173. PL_hints
  174. PL_na
  175. PL_no_modify
  176. PL_perl_destruct_level
  177. PL_perldb
  178. PL_ppaddr
  179. PL_rsfp
  180. PL_rsfp_filters
  181. PL_stack_base
  182. PL_stack_sp
  183. PL_stdingv
  184. PL_Sv
  185. PL_sv_arenaroot
  186. PL_sv_no
  187. PL_sv_undef
  188. PL_sv_yes
  189. PL_tainted
  190. PL_tainting
  191. pMY_CXT
  192. pMY_CXT_
  193. Poison
  194. pTHX
  195. pTHX_
  196. PTR2IV
  197. PTR2NV
  198. PTR2ul
  199. PTR2UV
  200. PTRV
  201. PUSHmortal
  202. PUSHu
  203. SAVE_DEFSV
  204. START_EXTERN_C
  205. START_MY_CXT
  206. STMT_END
  207. STMT_START
  208. sv_2pv_nolen
  209. sv_2pvbyte
  210. sv_2uv
  211. sv_catpv_mg
  212. sv_catpvf_mg
  213. sv_catpvf_mg_nocontext
  214. sv_catpvn_mg
  215. sv_catpvn_nomg
  216. sv_catsv_mg
  217. sv_catsv_nomg
  218. sv_pvn
  219. sv_pvn_force
  220. sv_pvn_nomg
  221. sv_setiv_mg
  222. sv_setnv_mg
  223. sv_setpv_mg
  224. sv_setpvf_mg
  225. sv_setpvf_mg_nocontext
  226. sv_setpvn_mg
  227. sv_setsv_mg
  228. sv_setsv_nomg
  229. sv_setuv
  230. sv_setuv_mg
  231. sv_usepvn_mg
  232. sv_uv
  233. sv_vcatpvf
  234. sv_vcatpvf_mg
  235. sv_vsetpvf
  236. sv_vsetpvf_mg
  237. SvGETMAGIC
  238. SvIV_nomg
  239. SvPV_force_nomg
  240. SvPV_nolen
  241. SvPV_nomg
  242. SvPVbyte
  243. SvUV
  244. SvUV_nomg
  245. SvUVX
  246. SvUVx
  247. SvUVXx
  248. UNDERBAR
  249. UVof
  250. UVSIZE
  251. UVTYPE
  252. UVuf
  253. UVXf
  254. UVxf
  255. vnewSVpvf
  256. XCPT_CATCH
  257. XCPT_RETHROW
  258. XCPT_TRY_END
  259. XCPT_TRY_START
  260. XPUSHmortal
  261. XPUSHu
  262. XSRETURN_UV
  263. XST_mUV
  264. ZeroD

Perl API not supported by ppport.h

There is still a big part of the API not supported by ppport.h. 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!

Here's a list of the currently unsupported API, and also the version of Perl below which it is unsupported:

  • perl 5.9.3
    1. SvMAGIC_set
    2. SvRV_set
    3. SvSTASH_set
    4. SvUV_set
    5. av_arylen_p
    6. dAXMARK
    7. hv_eiter_p
    8. hv_eiter_set
    9. hv_name_set
    10. hv_placeholders_get
    11. hv_placeholders_p
    12. hv_placeholders_set
    13. hv_riter_p
    14. hv_riter_set
    15. is_utf8_string_loclen
    16. newSVhek
    17. newWHILEOP
    18. stashpv_hvname_match
  • perl 5.9.2
    1. SvPVbyte_force
    2. find_rundefsvoffset
    3. gv_fetchpvn_flags
    4. gv_fetchsv
    5. op_refcnt_lock
    6. op_refcnt_unlock
    7. savesvpv
    8. vnormal
  • perl 5.9.1
    1. hv_assert
    2. hv_clear_placeholders
    3. hv_scalar
    4. scan_version
    5. sv_2iv_flags
    6. sv_2uv_flags
  • perl 5.9.0
    1. new_version
    2. save_set_svflags
    3. upg_version
    4. vcmp
    5. vnumify
    6. vstringify
  • perl 5.8.3
    1. SvIsCOW
    2. SvIsCOW_shared_hash
  • perl 5.8.1
    1. SvVOK
    2. doing_taint
    3. is_utf8_string_loc
    4. packlist
    5. save_bool
    6. savestack_grow_cnt
    7. scan_vstring
    8. sv_cat_decode
    9. sv_compile_2op
    10. sv_setpviv
    11. sv_setpviv_mg
    12. unpackstring
  • perl 5.8.0
    1. hv_iternext_flags
    2. hv_store_flags
    3. is_utf8_idcont
    4. nothreadhook
  • perl 5.7.3
    1. PerlIO_clearerr
    2. PerlIO_close
    3. PerlIO_eof
    4. PerlIO_error
    5. PerlIO_fileno
    6. PerlIO_fill
    7. PerlIO_flush
    8. PerlIO_get_base
    9. PerlIO_get_bufsiz
    10. PerlIO_get_cnt
    11. PerlIO_get_ptr
    12. PerlIO_read
    13. PerlIO_seek
    14. PerlIO_set_cnt
    15. PerlIO_set_ptrcnt
    16. PerlIO_setlinebuf
    17. PerlIO_stderr
    18. PerlIO_stdin
    19. PerlIO_stdout
    20. PerlIO_tell
    21. PerlIO_unread
    22. PerlIO_write
    23. SvLOCK
    24. SvSHARE
    25. SvUNLOCK
    26. atfork_lock
    27. atfork_unlock
    28. custom_op_desc
    29. custom_op_name
    30. deb
    31. debstack
    32. debstackptrs
    33. gv_fetchmeth_autoload
    34. ibcmp_utf8
    35. my_fork
    36. my_socketpair
    37. pack_cat
    38. perl_destruct
    39. pv_uni_display
    40. regclass_swash
    41. save_shared_pvref
    42. savesharedpv
    43. sortsv
    44. sv_copypv
    45. sv_magicext
    46. sv_nolocking
    47. sv_nosharing
    48. sv_nounlocking
    49. sv_recode_to_utf8
    50. sv_uni_display
    51. to_uni_fold
    52. to_uni_lower
    53. to_uni_title
    54. to_uni_upper
    55. to_utf8_case
    56. to_utf8_fold
    57. to_utf8_lower
    58. to_utf8_title
    59. to_utf8_upper
    60. unpack_str
    61. uvchr_to_utf8_flags
    62. uvuni_to_utf8_flags
    63. vdeb
  • perl 5.7.2
    1. calloc
    2. getcwd_sv
    3. init_tm
    4. malloc
    5. mfree
    6. mini_mktime
    7. my_atof2
    8. my_strftime
    9. op_null
    10. realloc
    11. sv_2pv_flags
    12. sv_catpvn_flags
    13. sv_catsv_flags
    14. sv_pvn_force_flags
    15. sv_setsv_flags
    16. sv_utf8_upgrade_flags
    17. swash_fetch
  • perl 5.7.1
    1. POPpbytex
    2. SvUOK
    3. bytes_from_utf8
    4. csighandler
    5. despatch_signals
    6. do_openn
    7. gv_handler
    8. is_lvalue_sub
    9. my_popen_list
    10. newSVpvn_share
    11. save_mortalizesv
    12. save_padsv
    13. scan_num
    14. sv_force_normal_flags
    15. sv_setref_uv
    16. sv_unref_flags
    17. sv_utf8_upgrade
    18. utf8_length
    19. utf8_to_uvchr
    20. utf8_to_uvuni
    21. utf8n_to_uvchr
    22. utf8n_to_uvuni
    23. uvchr_to_utf8
    24. uvuni_to_utf8
  • perl 5.6.1
    1. apply_attrs_string
    2. bytes_to_utf8
    3. gv_efullname4
    4. gv_fullname4
    5. is_utf8_string
    6. save_generic_pvref
    7. utf16_to_utf8
    8. utf16_to_utf8_reversed
    9. utf8_to_bytes
  • perl 5.6.0
    1. SvIOK_UV
    2. SvIOK_notUV
    3. SvIOK_only_UV
    4. SvPOK_only_UTF8
    5. SvPVbyte_nolen
    6. SvPVbytex
    7. SvPVbytex_force
    8. SvPVutf8
    9. SvPVutf8_force
    10. SvPVutf8_nolen
    11. SvPVutf8x
    12. SvPVutf8x_force
    13. SvUTF8
    14. SvUTF8_off
    15. SvUTF8_on
    16. av_delete
    17. av_exists
    18. call_atexit
    19. cast_i32
    20. cast_iv
    21. cast_ulong
    22. cast_uv
    23. do_gv_dump
    24. do_gvgv_dump
    25. do_hv_dump
    26. do_magic_dump
    27. do_op_dump
    28. do_open9
    29. do_pmop_dump
    30. do_sv_dump
    31. dump_all
    32. dump_eval
    33. dump_form
    34. dump_indent
    35. dump_packsubs
    36. dump_sub
    37. dump_vindent
    38. get_context
    39. get_ppaddr
    40. gv_dump
    41. init_i18nl10n
    42. init_i18nl14n
    43. is_uni_alnum
    44. is_uni_alnum_lc
    45. is_uni_alnumc
    46. is_uni_alnumc_lc
    47. is_uni_alpha
    48. is_uni_alpha_lc
    49. is_uni_ascii
    50. is_uni_ascii_lc
    51. is_uni_cntrl
    52. is_uni_cntrl_lc
    53. is_uni_digit
    54. is_uni_digit_lc
    55. is_uni_graph
    56. is_uni_graph_lc
    57. is_uni_idfirst
    58. is_uni_idfirst_lc
    59. is_uni_lower
    60. is_uni_lower_lc
    61. is_uni_print
    62. is_uni_print_lc
    63. is_uni_punct
    64. is_uni_punct_lc
    65. is_uni_space
    66. is_uni_space_lc
    67. is_uni_upper
    68. is_uni_upper_lc
    69. is_uni_xdigit
    70. is_uni_xdigit_lc
    71. is_utf8_alnum
    72. is_utf8_alnumc
    73. is_utf8_alpha
    74. is_utf8_ascii
    75. is_utf8_char
    76. is_utf8_cntrl
    77. is_utf8_digit
    78. is_utf8_graph
    79. is_utf8_idfirst
    80. is_utf8_lower
    81. is_utf8_mark
    82. is_utf8_print
    83. is_utf8_punct
    84. is_utf8_space
    85. is_utf8_upper
    86. is_utf8_xdigit
    87. load_module
    88. magic_dump
    89. mess
    90. my_atof
    91. my_fflush_all
    92. newANONATTRSUB
    93. newATTRSUB
    94. newMYSUB
    95. newPADOP
    96. newXS
    97. newXSproto
    98. new_collate
    99. new_ctype
    100. new_numeric
    101. op_dump
    102. perl_parse
    103. pmop_dump
    104. pv_display
    105. re_intuit_start
    106. re_intuit_string
    107. reginitcolors
    108. require_pv
    109. safesyscalloc
    110. safesysfree
    111. safesysmalloc
    112. safesysrealloc
    113. save_I8
    114. save_alloc
    115. save_destructor
    116. save_destructor_x
    117. save_re_context
    118. save_vptr
    119. scan_bin
    120. set_context
    121. set_numeric_local
    122. set_numeric_radix
    123. set_numeric_standard
    124. str_to_version
    125. sv_2pvutf8
    126. sv_2pvutf8_nolen
    127. sv_force_normal
    128. sv_len_utf8
    129. sv_pos_b2u
    130. sv_pos_u2b
    131. sv_pv
    132. sv_pvbyte
    133. sv_pvbyten
    134. sv_pvbyten_force
    135. sv_pvutf8
    136. sv_pvutf8n
    137. sv_pvutf8n_force
    138. sv_rvweaken
    139. sv_utf8_decode
    140. sv_utf8_downgrade
    141. sv_utf8_encode
    142. swash_init
    143. tmps_grow
    144. to_uni_lower_lc
    145. to_uni_title_lc
    146. to_uni_upper_lc
    147. utf8_distance
    148. utf8_hop
    149. vcroak
    150. vform
    151. vload_module
    152. vmess
    153. vwarn
    154. vwarner
    155. warner
  • perl 5.005_03
    1. POPpx
    2. get_vtbl
    3. save_generic_svref
  • perl 5.005
    1. PL_modglobal
    2. cx_dump
    3. debop
    4. debprofdump
    5. fbm_compile
    6. fbm_instr
    7. get_op_descs
    8. get_op_names
    9. init_stacks
    10. mg_length
    11. mg_size
    12. newHVhv
    13. new_stackinfo
    14. regdump
    15. regexec_flags
    16. regnext
    17. runops_debug
    18. runops_standard
    19. save_hints
    20. save_iv
    21. save_threadsv
    22. screaminstr
    23. sv_iv
    24. sv_nv
    25. sv_peek
    26. sv_true
  • perl 5.004_05
    1. do_binmode
    2. save_aelem
    3. save_helem
  • perl 5.004
    1. GIMME_V
    2. G_VOID
    3. HEf_SVKEY
    4. HeHASH
    5. HeKEY
    6. HeKLEN
    7. HePV
    8. HeSVKEY
    9. HeSVKEY_force
    10. HeSVKEY_set
    11. HeVAL
    12. SvSetMagicSV
    13. SvSetMagicSV_nosteal
    14. SvSetSV_nosteal
    15. SvTAINTED
    16. SvTAINTED_off
    17. SvTAINTED_on
    18. block_gimme
    19. call_list
    20. cv_const_sv
    21. delimcpy
    22. do_open
    23. form
    24. gv_autoload4
    25. gv_efullname3
    26. gv_fetchmethod_autoload
    27. gv_fullname3
    28. hv_delayfree_ent
    29. hv_delete_ent
    30. hv_exists_ent
    31. hv_fetch_ent
    32. hv_free_ent
    33. hv_iterkeysv
    34. hv_ksplit
    35. hv_store_ent
    36. ibcmp_locale
    37. my_failure_exit
    38. my_memcmp
    39. my_pclose
    40. my_popen
    41. newSVpvf
    42. rsignal
    43. rsignal_state
    44. save_I16
    45. save_gp
    46. start_subparse
    47. sv_catpvf
    48. sv_catpvf_mg
    49. sv_cmp_locale
    50. sv_derived_from
    51. sv_gets
    52. sv_setpvf
    53. sv_setpvf_mg
    54. sv_taint
    55. sv_tainted
    56. sv_untaint
    57. sv_vcatpvf
    58. sv_vcatpvf_mg
    59. sv_vcatpvfn
    60. sv_vsetpvf
    61. sv_vsetpvf_mg
    62. sv_vsetpvfn
    63. unsharepvn
    64. vnewSVpvf

BUGS

If you find any bugs, Devel::PPPort doesn't seem to build on your system or any of its tests fail, please use the CPAN Request Tracker at http://rt.cpan.org/ to create a ticket for the module.

AUTHORS

  • Version 1.x of Devel::PPPort was written by Kenneth Albanowski.

  • Version 2.x was ported to the Perl core by Paul Marquess.

  • Version 3.x was ported back to CPAN by Marcus Holland-Moritz.

COPYRIGHT

Version 3.x, Copyright (C) 2004-2005, Marcus Holland-Moritz.

Version 2.x, Copyright (C) 2001, Paul Marquess.

Version 1.x, Copyright (C) 1999, Kenneth Albanowski.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

See h2xs, ppport.h.