cvs commit: ponie/perl/pod perlapi.pod
[email protected] (Arthur Bergman) 15 Dec 2003 13:55:17 -0000
| Newsgroups | perl.ponie.changes |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 03/12/15 05:55:16
Modified: perl embed.fnc embed.h global.sym proto.h sv.c sv.h
perl/pod perlapi.pod
Log:
try and do the right thing for LvTYPE
Revision Changes Path
1.3 +2 -1 ponie/perl/embed.fnc
Index: embed.fnc
===================================================================
RCS file: /cvs/public/ponie/perl/embed.fnc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- embed.fnc 10 Dec 2003 15:26:25 -0000 1.2
+++ embed.fnc 15 Dec 2003 13:55:14 -0000 1.3
@@ -968,7 +968,8 @@
Adp |int |nothreadhook
-Ap |char* |macro_SvPVX |SV *
+Ap |char** |macro_SvPVX |SV *
+Ap |char** |macro_LvTYPE |SV *
END_EXTERN_C
1.3 +2 -0 ponie/perl/embed.h
Index: embed.h
===================================================================
RCS file: /cvs/public/ponie/perl/embed.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- embed.h 10 Dec 2003 15:26:25 -0000 1.2
+++ embed.h 15 Dec 2003 13:55:14 -0000 1.3
@@ -1256,6 +1256,7 @@
#define sv_nounlocking Perl_sv_nounlocking
#define nothreadhook Perl_nothreadhook
#define macro_SvPVX Perl_macro_SvPVX
+#define macro_LvTYPE Perl_macro_LvTYPE
#if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define do_trans_simple S_do_trans_simple
@@ -3739,6 +3740,7 @@
#define sv_nounlocking(a) Perl_sv_nounlocking(aTHX_ a)
#define nothreadhook() Perl_nothreadhook(aTHX)
#define macro_SvPVX(a) Perl_macro_SvPVX(aTHX_ a)
+#define macro_LvTYPE(a) Perl_macro_LvTYPE(aTHX_ a)
#if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define do_trans_simple(a) S_do_trans_simple(aTHX_ a)
1.3 +1 -0 ponie/perl/global.sym
Index: global.sym
===================================================================
RCS file: /cvs/public/ponie/perl/global.sym,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- global.sym 10 Dec 2003 15:26:25 -0000 1.2
+++ global.sym 15 Dec 2003 13:55:15 -0000 1.3
@@ -629,6 +629,7 @@
Perl_sv_nounlocking
Perl_nothreadhook
Perl_macro_SvPVX
+Perl_macro_LvTYPE
Perl_Slab_Alloc
Perl_Slab_Free
Perl_sv_setsv_flags
1.3 +1 -0 ponie/perl/proto.h
Index: proto.h
===================================================================
RCS file: /cvs/public/ponie/perl/proto.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- proto.h 10 Dec 2003 15:26:26 -0000 1.2
+++ proto.h 15 Dec 2003 13:55:15 -0000 1.3
@@ -927,6 +927,7 @@
PERL_CALLCONV char** Perl_macro_SvPVX(pTHX_ SV *);
+PERL_CALLCONV char** Perl_macro_LvTYPE(pTHX_ SV *);
END_EXTERN_C
1.4 +10 -1 ponie/perl/sv.c
Index: sv.c
===================================================================
RCS file: /cvs/public/ponie/perl/sv.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- sv.c 10 Dec 2003 15:40:18 -0000 1.3
+++ sv.c 15 Dec 2003 13:55:15 -0000 1.4
@@ -1267,12 +1267,19 @@
char** Perl_macro_SvPVX (pTHX_ SV *sv) {
if(SvPMC(sv)) {
- FIXME("SvPVX() not implemented yet\n");
+ FIXME("SvPVX() not implemented yet");
}
return &((XPV*)SvANY(sv))->xpv_pv;
}
+char** Perl_macro_LvTYPE (pTHX_ SV* sv) {
+ perl5lv_pmc_data* data;
+ if(!SvPMC(sv))
+ abort();
+ data = (perl5lv_pmc_data*) Parrot_PMC_get_pointer(PL_Parrot, SvANY(sv));
+ return &(data->xlv_type);
+}
/*
=for apidoc sv_upgrade
@@ -1452,6 +1459,8 @@
case SVt_PVLV:
SvANY(sv) = new_XPVLV();
SvPMC_on(sv);
+ break;
+ FIXME("lv..");
SvPVX(sv) = pv;
SvCUR(sv) = cur;
SvLEN(sv) = len;
1.4 +12 -1 ponie/perl/sv.h
Index: sv.h
===================================================================
RCS file: /cvs/public/ponie/perl/sv.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- sv.h 10 Dec 2003 15:40:18 -0000 1.3
+++ sv.h 15 Dec 2003 13:55:15 -0000 1.4
@@ -288,6 +288,16 @@
* y=alem/helem/iter t=tie T=tied HE */
};
+
+typedef struct {
+ STRLEN xlv_targoff;
+ STRLEN xlv_targlen;
+ SV* xlv_targ;
+ char xlv_type; /* k=keys .=pos x=substr v=vec /=join/re
+ * y=alem/helem/iter t=tie T=tied HE */
+} perl5lv_pmc_data;
+
+
struct xpvgv {
char * xpv_pv; /* pointer to malloced string */
STRLEN xpv_cur; /* length of xpv_pv as a C string */
@@ -779,7 +789,8 @@
#define FmLINES(sv) ((XPVFM*) SvANY(sv))->xfm_lines
-#define LvTYPE(sv) ((XPVLV*) SvANY(sv))->xlv_type
+#define LvTYPE(sv) ((char*)*Perl_macro_LvTYPE(aTHX_ (SV*)sv))
+//#define LvTYPE(sv) ((XPVLV*) SvANY(sv))->xlv_type
#define LvTARG(sv) ((XPVLV*) SvANY(sv))->xlv_targ
#define LvTARGOFF(sv) ((XPVLV*) SvANY(sv))->xlv_targoff
#define LvTARGLEN(sv) ((XPVLV*) SvANY(sv))->xlv_targlen
1.3 +23 -23 ponie/perl/pod/perlapi.pod
Index: perlapi.pod
===================================================================
RCS file: /cvs/public/ponie/perl/pod/perlapi.pod,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- perlapi.pod 9 Sep 2003 14:48:07 -0000 1.2
+++ perlapi.pod 15 Dec 2003 13:55:16 -0000 1.3
@@ -2868,22 +2868,22 @@
=for hackers
Found in file sv.h
-=item SvIVX
+=item SvIVx
-Returns the raw value in the SV's IV slot, without checks or conversions.
-Only use when you are sure SvIOK is true. See also C<SvIV()>.
+Coerces the given SV to an integer and returns it. Guarantees to evaluate
+sv only once. Use the more efficient C<SvIV> otherwise.
- IV SvIVX(SV* sv)
+ IV SvIVx(SV* sv)
=for hackers
Found in file sv.h
-=item SvIVx
+=item SvIVX
-Coerces the given SV to an integer and returns it. Guarantees to evaluate
-sv only once. Use the more efficient C<SvIV> otherwise.
+Returns the raw value in the SV's IV slot, without checks or conversions.
+Only use when you are sure SvIOK is true. See also C<SvIV()>.
- IV SvIVx(SV* sv)
+ IV SvIVX(SV* sv)
=for hackers
Found in file sv.h
@@ -2983,22 +2983,22 @@
=for hackers
Found in file sv.h
-=item SvNVx
+=item SvNVX
-Coerces the given SV to a double and returns it. Guarantees to evaluate
-sv only once. Use the more efficient C<SvNV> otherwise.
+Returns the raw value in the SV's NV slot, without checks or conversions.
+Only use when you are sure SvNOK is true. See also C<SvNV()>.
- NV SvNVx(SV* sv)
+ NV SvNVX(SV* sv)
=for hackers
Found in file sv.h
-=item SvNVX
+=item SvNVx
-Returns the raw value in the SV's NV slot, without checks or conversions.
-Only use when you are sure SvNOK is true. See also C<SvNV()>.
+Coerces the given SV to a double and returns it. Guarantees to evaluate
+sv only once. Use the more efficient C<SvNV> otherwise.
- NV SvNVX(SV* sv)
+ NV SvNVx(SV* sv)
=for hackers
Found in file sv.h
@@ -3192,21 +3192,21 @@
=for hackers
Found in file sv.h
-=item SvPVX
+=item SvPVx
-Returns a pointer to the physical string in the SV. The SV must contain a
-string.
+A version of C<SvPV> which guarantees to evaluate sv only once.
- char* SvPVX(SV* sv)
+ char* SvPVx(SV* sv, STRLEN len)
=for hackers
Found in file sv.h
-=item SvPVx
+=item SvPVX
-A version of C<SvPV> which guarantees to evaluate sv only once.
+Returns a pointer to the physical string in the SV. The SV must contain a
+string.
- char* SvPVx(SV* sv, STRLEN len)
+ char* SvPVX(SV* sv)
=for hackers
Found in file sv.h