Subject: | 5.17.4 pad API |
I thought you might want to consider adding support for 5.17.4’s pad API. Here is what I
have been using for the modules I have patched:
#ifndef PadARRAY
typedef AV PADNAMELIST;
typedef SV PADNAME;
# if PERL_VERSION < 8 || (PERL_VERSION == 8 && !PERL_SUBVERSION)
typedef AV PADLIST;
typedef AV PAD;
# endif
# define PadlistARRAY(pl) ((PAD **)AvARRAY(pl))
# define PadlistMAX(pl) AvFILLp(pl)
# define PadlistNAMES(pl) (*PadlistARRAY(pl))
# define PadlistNAMESARRAY(pl) AvARRAY(*PadlistARRAY(pl))
# define PadlistNAMESMAX(pl) AvFILLp(*PadlistARRAY(pl))
# define PadnamelistARRAY(pnl) ((PADNAME **)AvARRAY(pnl))
# define PadnamelistMAX(pnl) AvFILLp(pnl)
# define PadARRAY(pad) AvARRAY(pad)
# define PadMAX(pad) AvFILLp(pad)
# define PadnameIsOUR(pn) !!(SvFLAGS(pn) & SVpad_OUR)
# define PadnameLEN(pn) SvCUR(pn)
# define PadnameOURSTASH(pn) SvOURSTASH(pn)
# define PadnameOUTER(pn) !!SvFAKE(pn)
# define PadnamePV(pn) (SvPOKp(pn) ? SvPVX(pn) : NULL)
# ifdef SvPAD_STATE
# define PadnameSTATE(pn) SvPAD_STATE(pn)
# else
# define PadnameSTATE(pn) 0
# endif
# define PadnameSV(pn) pn
# define PadlistREFCNT(pl) 1
#endif