summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-21 11:56:33 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-21 11:56:33 +0000
commit0ca13ac91eaa16b0aa057bdc5944a31b25769b3e (patch)
tree488322f62f2e458891daffdaa0f607521fdc7881 /ext
parentc6367843475544677d20a70a9a99d3c41aaec9ef (diff)
parent3727c173a40b254b4b9641c2b2efa9a56ebf9e30 (diff)
downloadperl-0ca13ac91eaa16b0aa057bdc5944a31b25769b3e.tar.gz
Integrate perlio:
[ 17330] PerlIO Layer implementation future proofing. - Inspired by Nick C's suggestion add size of function table to the table as a validation check. - also optimize pseudo-layer code to avoid malloc/link of something destined to be immediately popped & freed. - Minor addition to pod/perliol.pod [ 17335] Fix bug in optimized pseudo-layers. p4raw-link: @17335 on //depot/perlio: 00f5185623ac489efbed49ff4cbdf42316dcf5fd p4raw-link: @17330 on //depot/perlio: 2dc2558e5965ed21842375d8cc89de68e0c966e2 p4raw-id: //depot/perl@17336
Diffstat (limited to 'ext')
-rw-r--r--ext/PerlIO/Scalar/Scalar.xs5
-rw-r--r--ext/PerlIO/Via/Via.xs5
-rw-r--r--ext/PerlIO/encoding/encoding.xs5
3 files changed, 9 insertions, 6 deletions
diff --git a/ext/PerlIO/Scalar/Scalar.xs b/ext/PerlIO/Scalar/Scalar.xs
index 314c0f317c..5bbc11951e 100644
--- a/ext/PerlIO/Scalar/Scalar.xs
+++ b/ext/PerlIO/Scalar/Scalar.xs
@@ -14,7 +14,7 @@ typedef struct
} PerlIOScalar;
IV
-PerlIOScalar_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg)
+PerlIOScalar_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
{
IV code;
PerlIOScalar *s = PerlIOSelf(f,PerlIOScalar);
@@ -38,7 +38,7 @@ PerlIOScalar_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg)
s->var = newSVpvn("",0);
}
sv_upgrade(s->var,SVt_PV);
- code = PerlIOBase_pushed(aTHX_ f,mode,Nullsv);
+ code = PerlIOBase_pushed(aTHX_ f,mode,Nullsv,tab);
if ((PerlIOBase(f)->flags) & PERLIO_F_TRUNCATE)
SvCUR(s->var) = 0;
if ((PerlIOBase(f)->flags) & PERLIO_F_APPEND)
@@ -263,6 +263,7 @@ PerlIOScalar_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags)
}
PerlIO_funcs PerlIO_scalar = {
+ sizeof(PerlIO_funcs),
"Scalar",
sizeof(PerlIOScalar),
PERLIO_K_BUFFERED|PERLIO_K_RAW,
diff --git a/ext/PerlIO/Via/Via.xs b/ext/PerlIO/Via/Via.xs
index d1ebab2ae3..04c4d48906 100644
--- a/ext/PerlIO/Via/Via.xs
+++ b/ext/PerlIO/Via/Via.xs
@@ -123,9 +123,9 @@ PerlIOVia_method(pTHX_ PerlIO *f,char *method,CV **save,int flags,...)
}
IV
-PerlIOVia_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg)
+PerlIOVia_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
{
- IV code = PerlIOBase_pushed(aTHX_ f,mode,Nullsv);
+ IV code = PerlIOBase_pushed(aTHX_ f,mode,Nullsv,tab);
if (code == 0)
{
PerlIOVia *s = PerlIOSelf(f,PerlIOVia);
@@ -559,6 +559,7 @@ PerlIOVia_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags)
}
PerlIO_funcs PerlIO_object = {
+ sizeof(PerlIO_funcs),
"Via",
sizeof(PerlIOVia),
PERLIO_K_BUFFERED|PERLIO_K_DESTRUCT,
diff --git a/ext/PerlIO/encoding/encoding.xs b/ext/PerlIO/encoding/encoding.xs
index df911ed705..a714a3d6d2 100644
--- a/ext/PerlIO/encoding/encoding.xs
+++ b/ext/PerlIO/encoding/encoding.xs
@@ -80,11 +80,11 @@ PerlIOEncode_getarg(pTHX_ PerlIO * f, CLONE_PARAMS * param, int flags)
}
IV
-PerlIOEncode_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg)
+PerlIOEncode_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg, PerlIO_funcs *tab)
{
PerlIOEncode *e = PerlIOSelf(f, PerlIOEncode);
dSP;
- IV code = PerlIOBuf_pushed(aTHX_ f, mode, Nullsv);
+ IV code = PerlIOBuf_pushed(aTHX_ f, mode, Nullsv,tab);
SV *result = Nullsv;
PUSHSTACKi(PERLSI_MAGIC);
@@ -584,6 +584,7 @@ PerlIOEncode_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count)
}
PerlIO_funcs PerlIO_encode = {
+ sizeof(PerlIO_funcs),
"encoding",
sizeof(PerlIOEncode),
PERLIO_K_BUFFERED|PERLIO_K_DESTRUCT,