dougm 01/10/27 10:14:17 Modified: src/modules/perl modperl_util.h xs modperl_xs_util.h Log: moving macros to be available outside .xs: mpxs_sv_grow => MP_SvGROW mpxs_sv_cur_set => MP_SvCUR_set Revision Changes Path 1.29 +9 -0 modperl-2.0/src/modules/perl/modperl_util.h Index: modperl_util.h =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- modperl_util.h 2001/10/21 06:22:45 1.28 +++ modperl_util.h 2001/10/27 17:14:17 1.29 @@ -34,6 +34,15 @@ #define SvObjIV(o) SvIV((SV*)SvRV(o)) #define MgObjIV(m) SvIV((SV*)SvRV(m->mg_obj)) +#define MP_SvGROW(sv, len) \ + (void)SvUPGRADE(sv, SVt_PV); \ + SvGROW(sv, len+1) + +#define MP_SvCUR_set(sv, len) \ + SvCUR_set(sv, len); \ + *SvEND(sv) = '\0'; \ + SvPOK_only(sv) + #define MP_magical_untie(sv, mg_flags) \ mg_flags = SvMAGICAL((SV*)sv); \ SvMAGICAL_off((SV*)sv) 1.10 +4 -7 modperl-2.0/xs/modperl_xs_util.h Index: modperl_xs_util.h =================================================================== RCS file: /home/cvs/modperl-2.0/xs/modperl_xs_util.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- modperl_xs_util.h 2001/09/25 19:44:03 1.9 +++ modperl_xs_util.h 2001/10/27 17:14:17 1.10 @@ -33,14 +33,11 @@ #define XPUSHs_mortal_iv(iv) EXTEND(SP, 1); PUSHs_mortal_iv(iv) #define XPUSHs_mortal_pv(pv) EXTEND(SP, 1); PUSHs_mortal_pv(pv) -#define mpxs_sv_grow(sv, len) \ - (void)SvUPGRADE(sv, SVt_PV); \ - SvGROW(sv, len+1) +/* XXX: replace the old mpxs_sv_ macros with MP_Sv macros */ -#define mpxs_sv_cur_set(sv, len) \ - SvCUR_set(sv, len); \ - *SvEND(sv) = '\0'; \ - SvPOK_only(sv) +#define mpxs_sv_grow(sv, len) MP_SvGROW(sv, len) + +#define mpxs_sv_cur_set(sv, len) MP_SvCUR_set(sv, len) #define mpxs_set_targ(func, arg) \ STMT_START { \