Perl 5 version 8.0 documentation

Devel::PPPort

NAME

Perl/Pollution/Portability

SYNOPSIS

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

DESCRIPTION

Perl 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, typicaly ppport.h , written by this module attempts to bring some of the newer Perl 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.

Why 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.

Why you should attempt older code to fully use ppport.h : because the reduced pollution of newer Perl versions is an important thing, 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 gained compatibility and a sense of having done the electronic ecology some good.

How to use ppport.h: Don't direct the user to download Devel::PPPort , and don't make ppport.h optional. Rather, just take the most recent copy of ppport.h that you can find (probably in Devel::PPPort on CPAN), copy it into your project, adjust your project to use it, and distribute the header along with your module.

Devel::PPPort contains a single function, called WriteFile . It's purpose is to write a 'C' header file that is used when writing XS modules. The file contains a series of macros that allow XS modules to be built using older versions of Perl.

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

WriteFile

WriteFile takes a zero or one parameters. When called with one parameter it expects to be passed a filename. When called with no parameters, it defults to the filename ./pport.h .

The function returns TRUE if the file was written successfully. Otherwise it returns FALSE.

ppport.h

The file written by this module, typically ppport.h , provides access to the following Perl API if not already available (and in some cases [*] even if available, access to a fixed interface):

  1. aMY_CXT
  2. aMY_CXT_
  3. _aMY_CXT
  4. aTHX
  5. aTHX_
  6. AvFILLp
  7. boolSV(b)
  8. DEFSV
  9. dMY_CXT
  10. dMY_CXT_SV
  11. dNOOP
  12. dTHR
  13. dTHX
  14. dTHXa
  15. dTHXoa
  16. ERRSV
  17. gv_stashpvn(str,len,flags)
  18. INT2PTR(type,int)
  19. IVdf
  20. MY_CXT
  21. MY_CXT_INIT
  22. newCONSTSUB(stash,name,sv)
  23. newRV_inc(sv)
  24. newRV_noinc(sv)
  25. newSVpvn(data,len)
  26. NOOP
  27. NV
  28. NVef
  29. NVff
  30. NVgf
  31. PERL_REVISION
  32. PERL_SUBVERSION
  33. PERL_UNUSED_DECL
  34. PERL_UNUSED_DECL
  35. PERL_VERSION
  36. PL_compiling
  37. PL_copline
  38. PL_curcop
  39. PL_curstash
  40. PL_defgv
  41. PL_dirty
  42. PL_hints
  43. PL_na
  44. PL_perldb
  45. PL_rsfp_filters
  46. PL_rsfpv
  47. PL_stdingv
  48. PL_Sv
  49. PL_sv_no
  50. PL_sv_undef
  51. PL_sv_yes
  52. pMY_CXT
  53. pMY_CXT_
  54. _pMY_CXT
  55. pTHX
  56. pTHX_
  57. PTR2IV(ptr)
  58. PTR2NV(ptr)
  59. PTR2ul(ptr)
  60. PTR2UV(ptr)
  61. SAVE_DEFSV
  62. START_MY_CXT
  63. SvPVbyte(sv,lp) [*]
  64. UVof
  65. UVSIZE
  66. UVuf
  67. UVxf
  68. UVXf

AUTHOR

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

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

SEE ALSO

See h2xs.