summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug MacEachern <dougm@covalent.net>2001-02-18 06:49:33 -0800
committerJarkko Hietaniemi <jhi@iki.fi>2001-02-19 00:23:41 +0000
commitcd66917f5d9bae1a120de0189299ed54df1a4fa8 (patch)
treeba61b1f08997a95e92a0dcd5a3977822918cc676
parentca73f6a8f2689f9d567e35daf10909bfa1d47427 (diff)
downloadperl-cd66917f5d9bae1a120de0189299ed54df1a4fa8.tar.gz
[patch] add sv_setref_uv
Message-ID: <Pine.LNX.4.21.0102181448290.10021-100000@mako.covalent.net> p4raw-id: //depot/perl@8840
-rw-r--r--embed.h4
-rwxr-xr-xembed.pl1
-rw-r--r--global.sym1
-rw-r--r--objXSUB.h4
-rw-r--r--perlapi.c7
-rw-r--r--pod/perlapi.pod27
-rw-r--r--pod/perlguts.pod3
-rw-r--r--proto.h1
-rw-r--r--sv.c19
9 files changed, 59 insertions, 8 deletions
diff --git a/embed.h b/embed.h
index 9a8e442fb3..a101d236f8 100644
--- a/embed.h
+++ b/embed.h
@@ -698,6 +698,7 @@
#define sv_setuv Perl_sv_setuv
#define sv_setnv Perl_sv_setnv
#define sv_setref_iv Perl_sv_setref_iv
+#define sv_setref_uv Perl_sv_setref_uv
#define sv_setref_nv Perl_sv_setref_nv
#define sv_setref_pv Perl_sv_setref_pv
#define sv_setref_pvn Perl_sv_setref_pvn
@@ -2186,6 +2187,7 @@
#define sv_setuv(a,b) Perl_sv_setuv(aTHX_ a,b)
#define sv_setnv(a,b) Perl_sv_setnv(aTHX_ a,b)
#define sv_setref_iv(a,b,c) Perl_sv_setref_iv(aTHX_ a,b,c)
+#define sv_setref_uv(a,b,c) Perl_sv_setref_uv(aTHX_ a,b,c)
#define sv_setref_nv(a,b,c) Perl_sv_setref_nv(aTHX_ a,b,c)
#define sv_setref_pv(a,b,c) Perl_sv_setref_pv(aTHX_ a,b,c)
#define sv_setref_pvn(a,b,c,d) Perl_sv_setref_pvn(aTHX_ a,b,c,d)
@@ -4290,6 +4292,8 @@
#define sv_setnv Perl_sv_setnv
#define Perl_sv_setref_iv CPerlObj::Perl_sv_setref_iv
#define sv_setref_iv Perl_sv_setref_iv
+#define Perl_sv_setref_uv CPerlObj::Perl_sv_setref_uv
+#define sv_setref_uv Perl_sv_setref_uv
#define Perl_sv_setref_nv CPerlObj::Perl_sv_setref_nv
#define sv_setref_nv Perl_sv_setref_nv
#define Perl_sv_setref_pv CPerlObj::Perl_sv_setref_pv
diff --git a/embed.pl b/embed.pl
index 1cdc4a2f82..f1bfd4123a 100755
--- a/embed.pl
+++ b/embed.pl
@@ -2045,6 +2045,7 @@ Apd |void |sv_setpviv |SV* sv|IV num
Apd |void |sv_setuv |SV* sv|UV num
Apd |void |sv_setnv |SV* sv|NV num
Apd |SV* |sv_setref_iv |SV* rv|const char* classname|IV iv
+Apd |SV* |sv_setref_uv |SV* rv|const char* classname|UV uv
Apd |SV* |sv_setref_nv |SV* rv|const char* classname|NV nv
Apd |SV* |sv_setref_pv |SV* rv|const char* classname|void* pv
Apd |SV* |sv_setref_pvn |SV* rv|const char* classname|char* pv \
diff --git a/global.sym b/global.sym
index 5ab9c718b0..cdc36aaaf8 100644
--- a/global.sym
+++ b/global.sym
@@ -437,6 +437,7 @@ Perl_sv_setpviv
Perl_sv_setuv
Perl_sv_setnv
Perl_sv_setref_iv
+Perl_sv_setref_uv
Perl_sv_setref_nv
Perl_sv_setref_pv
Perl_sv_setref_pvn
diff --git a/objXSUB.h b/objXSUB.h
index 1fd1839233..254934498c 100644
--- a/objXSUB.h
+++ b/objXSUB.h
@@ -1753,6 +1753,10 @@
#define Perl_sv_setref_iv pPerl->Perl_sv_setref_iv
#undef sv_setref_iv
#define sv_setref_iv Perl_sv_setref_iv
+#undef Perl_sv_setref_uv
+#define Perl_sv_setref_uv pPerl->Perl_sv_setref_uv
+#undef sv_setref_uv
+#define sv_setref_uv Perl_sv_setref_uv
#undef Perl_sv_setref_nv
#define Perl_sv_setref_nv pPerl->Perl_sv_setref_nv
#undef sv_setref_nv
diff --git a/perlapi.c b/perlapi.c
index 726be517ea..644bef8562 100644
--- a/perlapi.c
+++ b/perlapi.c
@@ -3178,6 +3178,13 @@ Perl_sv_setref_iv(pTHXo_ SV* rv, const char* classname, IV iv)
return ((CPerlObj*)pPerl)->Perl_sv_setref_iv(rv, classname, iv);
}
+#undef Perl_sv_setref_uv
+SV*
+Perl_sv_setref_uv(pTHXo_ SV* rv, const char* classname, UV uv)
+{
+ return ((CPerlObj*)pPerl)->Perl_sv_setref_uv(rv, classname, uv);
+}
+
#undef Perl_sv_setref_nv
SV*
Perl_sv_setref_nv(pTHXo_ SV* rv, const char* classname, NV nv)
diff --git a/pod/perlapi.pod b/pod/perlapi.pod
index ef3a260ae8..7b6ad4a621 100644
--- a/pod/perlapi.pod
+++ b/pod/perlapi.pod
@@ -2368,19 +2368,19 @@ false, defined or undefined. Does not handle 'get' magic.
=for hackers
Found in file sv.h
-=item svtype
+=item SvTYPE
-An enum of flags for Perl types. These are found in the file B<sv.h>
-in the C<svtype> enum. Test these flags with the C<SvTYPE> macro.
+Returns the type of the SV. See C<svtype>.
+
+ svtype SvTYPE(SV* sv)
=for hackers
Found in file sv.h
-=item SvTYPE
-
-Returns the type of the SV. See C<svtype>.
+=item svtype
- svtype SvTYPE(SV* sv)
+An enum of flags for Perl types. These are found in the file B<sv.h>
+in the C<svtype> enum. Test these flags with the C<SvTYPE> macro.
=for hackers
Found in file sv.h
@@ -3011,6 +3011,19 @@ Note that C<sv_setref_pv> copies the pointer while this copies the string.
=for hackers
Found in file sv.c
+=item sv_setref_uv
+
+Copies an unsigned integer into a new SV, optionally blessing the SV. The C<rv>
+argument will be upgraded to an RV. That RV will be modified to point to
+the new SV. The C<classname> argument indicates the package for the
+blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+will be returned and will have a reference count of 1.
+
+ SV* sv_setref_uv(SV* rv, const char* classname, UV uv)
+
+=for hackers
+Found in file sv.c
+
=item sv_setsv
Copies the contents of the source SV C<ssv> into the destination SV C<dsv>.
diff --git a/pod/perlguts.pod b/pod/perlguts.pod
index 54d071596a..557dbaf306 100644
--- a/pod/perlguts.pod
+++ b/pod/perlguts.pod
@@ -530,10 +530,11 @@ class. SV is returned.
SV* newSVrv(SV* rv, const char* classname);
-Copies integer or double into an SV whose reference is C<rv>. SV is blessed
+Copies integer, unsigned integer or double into an SV whose reference is C<rv>. SV is blessed
if C<classname> is non-null.
SV* sv_setref_iv(SV* rv, const char* classname, IV iv);
+ SV* sv_setref_uv(SV* rv, const char* classname, UV uv);
SV* sv_setref_nv(SV* rv, const char* classname, NV iv);
Copies the pointer value (I<the address, not the string!>) into an SV whose
diff --git a/proto.h b/proto.h
index 10ef21ac77..a33e8b7566 100644
--- a/proto.h
+++ b/proto.h
@@ -779,6 +779,7 @@ PERL_CALLCONV void Perl_sv_setpviv(pTHX_ SV* sv, IV num);
PERL_CALLCONV void Perl_sv_setuv(pTHX_ SV* sv, UV num);
PERL_CALLCONV void Perl_sv_setnv(pTHX_ SV* sv, NV num);
PERL_CALLCONV SV* Perl_sv_setref_iv(pTHX_ SV* rv, const char* classname, IV iv);
+PERL_CALLCONV SV* Perl_sv_setref_uv(pTHX_ SV* rv, const char* classname, UV uv);
PERL_CALLCONV SV* Perl_sv_setref_nv(pTHX_ SV* rv, const char* classname, NV nv);
PERL_CALLCONV SV* Perl_sv_setref_pv(pTHX_ SV* rv, const char* classname, void* pv);
PERL_CALLCONV SV* Perl_sv_setref_pvn(pTHX_ SV* rv, const char* classname, char* pv, STRLEN n);
diff --git a/sv.c b/sv.c
index ea360c3f6e..eeda889989 100644
--- a/sv.c
+++ b/sv.c
@@ -6349,6 +6349,25 @@ Perl_sv_setref_iv(pTHX_ SV *rv, const char *classname, IV iv)
}
/*
+=for apidoc sv_setref_uv
+
+Copies an unsigned integer into a new SV, optionally blessing the SV. The C<rv>
+argument will be upgraded to an RV. That RV will be modified to point to
+the new SV. The C<classname> argument indicates the package for the
+blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+will be returned and will have a reference count of 1.
+
+=cut
+*/
+
+SV*
+Perl_sv_setref_uv(pTHX_ SV *rv, const char *classname, UV uv)
+{
+ sv_setuv(newSVrv(rv,classname), uv);
+ return rv;
+}
+
+/*
=for apidoc sv_setref_nv
Copies a double into a new SV, optionally blessing the SV. The C<rv>