diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-20 20:11:00 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-20 20:11:00 +0000 |
commit | 4b27a2c96afa0e623ce71f6936ffb9fd1548b608 (patch) | |
tree | 59be533d4490c25a2b500c9434ebc288d61be788 /ext | |
parent | 3a028addd1e1ae0a829dd260e9673c087fa4a15f (diff) | |
parent | 99ddec231552b282cd8a8bc25f49d7d3e7f0d272 (diff) | |
download | perl-4b27a2c96afa0e623ce71f6936ffb9fd1548b608.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
p4raw-link: @17330 on //depot/perlio: 2dc2558e5965ed21842375d8cc89de68e0c966e2
p4raw-id: //depot/perl@17331
Diffstat (limited to 'ext')
-rw-r--r-- | ext/PerlIO/Scalar/Scalar.xs | 5 | ||||
-rw-r--r-- | ext/PerlIO/Via/Via.xs | 5 | ||||
-rw-r--r-- | ext/PerlIO/encoding/encoding.xs | 5 |
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, |