summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-02-08 21:31:55 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-02-09 07:30:19 +0000
commitef50df4b2435a16251e94335bad8aa9485e4478c (patch)
treef9c34021c30005404fdcb5adf18834ff2a160052 /sv.c
parentd9bb4600de3a7f46a4972e4a2d2e5d1ea333bb0a (diff)
downloadperl-ef50df4b2435a16251e94335bad8aa9485e4478c.tar.gz
[win32] enhancements to previous patch for XSUB OUTPUT args
Message-Id: <199802090731.CAA04438@aatma.engin.umich.edu> Subject: Re: [PATCH] XSUB OUTPUT arguments and 'set' magic p4raw-id: //depot/win32/perl@492
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c125
1 files changed, 125 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index f460e45b3f..1ab0e315e7 100644
--- a/sv.c
+++ b/sv.c
@@ -1138,6 +1138,13 @@ sv_setiv(register SV *sv, IV i)
}
void
+sv_setiv_mg(register SV *sv, IV i)
+{
+ sv_setiv(sv,i);
+ SvSETMAGIC(sv);
+}
+
+void
sv_setuv(register SV *sv, UV u)
{
if (u <= IV_MAX)
@@ -1147,6 +1154,13 @@ sv_setuv(register SV *sv, UV u)
}
void
+sv_setuv_mg(register SV *sv, UV u)
+{
+ sv_setuv(sv,u);
+ SvSETMAGIC(sv);
+}
+
+void
sv_setnv(register SV *sv, double num)
{
sv_check_thinkfirst(sv);
@@ -1190,6 +1204,13 @@ sv_setnv(register SV *sv, double num)
SvTAINT(sv);
}
+void
+sv_setnv_mg(register SV *sv, double num)
+{
+ sv_setnv(sv,num);
+ SvSETMAGIC(sv);
+}
+
static void
not_a_number(SV *sv)
{
@@ -2169,6 +2190,13 @@ sv_setsv(SV *dstr, register SV *sstr)
}
void
+sv_setsv_mg(SV *dstr, register SV *sstr)
+{
+ sv_setsv(dstr,sstr);
+ SvSETMAGIC(dstr);
+}
+
+void
sv_setpvn(register SV *sv, register const char *ptr, register STRLEN len)
{
assert(len >= 0); /* STRLEN is probably unsigned, so this may
@@ -2193,6 +2221,13 @@ sv_setpvn(register SV *sv, register const char *ptr, register STRLEN len)
}
void
+sv_setpvn_mg(register SV *sv, register const char *ptr, register STRLEN len)
+{
+ sv_setpvn(sv,ptr,len);
+ SvSETMAGIC(sv);
+}
+
+void
sv_setpv(register SV *sv, register const char *ptr)
{
register STRLEN len;
@@ -2217,6 +2252,13 @@ sv_setpv(register SV *sv, register const char *ptr)
}
void
+sv_setpv_mg(register SV *sv, register const char *ptr)
+{
+ sv_setpv(sv,ptr);
+ SvSETMAGIC(sv);
+}
+
+void
sv_usepvn(register SV *sv, register char *ptr, register STRLEN len)
{
sv_check_thinkfirst(sv);
@@ -2237,6 +2279,13 @@ sv_usepvn(register SV *sv, register char *ptr, register STRLEN len)
SvTAINT(sv);
}
+void
+sv_usepvn_mg(register SV *sv, register char *ptr, register STRLEN len)
+{
+ sv_usepvn_mg(sv,ptr,len);
+ SvSETMAGIC(sv);
+}
+
static void
sv_check_thinkfirst(register SV *sv)
{
@@ -2294,6 +2343,13 @@ sv_catpvn(register SV *sv, register char *ptr, register STRLEN len)
}
void
+sv_catpvn_mg(register SV *sv, register char *ptr, register STRLEN len)
+{
+ sv_catpvn(sv,ptr,len);
+ SvSETMAGIC(sv);
+}
+
+void
sv_catsv(SV *dstr, register SV *sstr)
{
char *s;
@@ -2305,6 +2361,13 @@ sv_catsv(SV *dstr, register SV *sstr)
}
void
+sv_catsv_mg(SV *dstr, register SV *sstr)
+{
+ sv_catsv(dstr,sstr);
+ SvSETMAGIC(dstr);
+}
+
+void
sv_catpv(register SV *sv, register char *ptr)
{
register STRLEN len;
@@ -2324,6 +2387,13 @@ sv_catpv(register SV *sv, register char *ptr)
SvTAINT(sv);
}
+void
+sv_catpv_mg(register SV *sv, register char *ptr)
+{
+ sv_catpv_mg(sv,ptr);
+ SvSETMAGIC(sv);
+}
+
SV *
#ifdef LEAKTEST
newSV(I32 x, STRLEN len)
@@ -4089,6 +4159,14 @@ sv_setpviv(SV *sv, IV iv)
SvCUR(sv) = p - SvPVX(sv);
}
+
+void
+sv_setpviv_mg(SV *sv, IV iv)
+{
+ sv_setpviv(sv,iv);
+ SvSETMAGIC(sv);
+}
+
#ifdef I_STDARG
void
sv_setpvf(SV *sv, const char* pat, ...)
@@ -4111,6 +4189,30 @@ sv_setpvf(sv, pat, va_alist)
va_end(args);
}
+
+#ifdef I_STDARG
+void
+sv_setpvf_mg(SV *sv, const char* pat, ...)
+#else
+/*VARARGS0*/
+void
+sv_setpvf_mg(sv, pat, va_alist)
+ SV *sv;
+ const char *pat;
+ va_dcl
+#endif
+{
+ va_list args;
+#ifdef I_STDARG
+ va_start(args, pat);
+#else
+ va_start(args);
+#endif
+ sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
+ va_end(args);
+ SvSETMAGIC(sv);
+}
+
#ifdef I_STDARG
void
sv_catpvf(SV *sv, const char* pat, ...)
@@ -4133,6 +4235,29 @@ sv_catpvf(sv, pat, va_alist)
va_end(args);
}
+#ifdef I_STDARG
+void
+sv_catpvf_mg(SV *sv, const char* pat, ...)
+#else
+/*VARARGS0*/
+void
+sv_catpvf_mg(sv, pat, va_alist)
+ SV *sv;
+ const char *pat;
+ va_dcl
+#endif
+{
+ va_list args;
+#ifdef I_STDARG
+ va_start(args, pat);
+#else
+ va_start(args);
+#endif
+ sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
+ va_end(args);
+ SvSETMAGIC(sv);
+}
+
void
sv_vsetpvfn(SV *sv, const char *pat, STRLEN patlen, va_list *args, SV **svargs, I32 svmax, bool *used_locale)
{