From: Jarkko Hietaniemi Date: Sat, 18 Mar 2000 19:08:40 +0000 (+0000) Subject: Add newSVuv(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a3327fb7deb3868ef5f43054de7364d8208e8e7;p=p5sagit%2Fp5-mst-13.2.git Add newSVuv(). p4raw-id: //depot/cfgperl@5803 --- diff --git a/Configure b/Configure index 237d2f9..f722d38 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Sat Mar 18 18:51:21 EET 2000 [metaconfig 3.0 PL70] +# Generated on Sat Mar 18 19:51:46 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <Perl_newSViv #undef newSViv #define newSViv Perl_newSViv +#undef Perl_newSVuv +#define Perl_newSVuv pPerl->Perl_newSVuv +#undef newSVuv +#define newSVuv Perl_newSVuv #undef Perl_newSVnv #define Perl_newSVnv pPerl->Perl_newSVnv #undef newSVnv diff --git a/perlapi.c b/perlapi.c index b396d6b..787c2f2 100755 --- a/perlapi.c +++ b/perlapi.c @@ -1963,6 +1963,13 @@ Perl_newSViv(pTHXo_ IV i) return ((CPerlObj*)pPerl)->Perl_newSViv(i); } +#undef Perl_newSVuv +SV* +Perl_newSVuv(pTHXo_ UV u) +{ + return ((CPerlObj*)pPerl)->Perl_newSVuv(u); +} + #undef Perl_newSVnv SV* Perl_newSVnv(pTHXo_ NV n) diff --git a/pod/perlapi.pod b/pod/perlapi.pod index c13dcde..32e77d6 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -897,6 +897,13 @@ Creates a new SV which is an exact duplicate of the original SV. SV* newSVsv(SV* old) +=item newSVuv + +Creates a new SV and copies an unsigned integer into it. +The reference count for the SV is set to 1. + + SV* newSVuv(UV u) + =item newXS Used by C to hook up XSUBs as Perl subs. @@ -1590,17 +1597,17 @@ false, defined or undefined. Does not handle 'get' magic. bool SvTRUE(SV* sv) +=item svtype + +An enum of flags for Perl types. These are found in the file B +in the C enum. Test these flags with the C macro. + =item SvTYPE Returns the type of the SV. See C. svtype SvTYPE(SV* sv) -=item svtype - -An enum of flags for Perl types. These are found in the file B -in the C enum. Test these flags with the C macro. - =item SVt_IV Integer type flag for scalars. See C. diff --git a/proto.h b/proto.h index 37a7bdc..1be9992 100644 --- a/proto.h +++ b/proto.h @@ -541,6 +541,7 @@ PERL_CALLCONV SV* Perl_newSV(pTHX_ STRLEN len); PERL_CALLCONV OP* Perl_newSVREF(pTHX_ OP* o); PERL_CALLCONV OP* Perl_newSVOP(pTHX_ I32 type, I32 flags, SV* sv); PERL_CALLCONV SV* Perl_newSViv(pTHX_ IV i); +PERL_CALLCONV SV* Perl_newSVuv(pTHX_ UV u); PERL_CALLCONV SV* Perl_newSVnv(pTHX_ NV n); PERL_CALLCONV SV* Perl_newSVpv(pTHX_ const char* s, STRLEN len); PERL_CALLCONV SV* Perl_newSVpvn(pTHX_ const char* s, STRLEN len); diff --git a/sv.c b/sv.c index e2b740d..f6f49d2 100644 --- a/sv.c +++ b/sv.c @@ -4743,6 +4743,25 @@ Perl_newSViv(pTHX_ IV i) } /* +=for apidoc newSVuv + +Creates a new SV and copies an unsigned integer into it. +The reference count for the SV is set to 1. + +=cut +*/ + +SV * +Perl_newSVuv(pTHX_ UV u) +{ + register SV *sv; + + new_SV(sv); + sv_setuv(sv,u); + return sv; +} + +/* =for apidoc newRV_noinc Creates an RV wrapper for an SV. The reference count for the original