joes 2003/05/30 22:39:51
Modified: glue/perl/xsbuilder apreq_xs_postperl.h
glue/perl/xsbuilder/Apache/Cookie Apache__Cookie.h
glue/perl/xsbuilder/Apache/Request Apache__Request.h
Log:
Fix broken i-thread support (missing pTHX_) and bless SV into an object.
Revision Changes Path
1.3 +8 -7 httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_postperl.h
Index: apreq_xs_postperl.h
===================================================================
RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_postperl.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- apreq_xs_postperl.h 31 May 2003 04:52:39 -0000 1.2
+++ apreq_xs_postperl.h 31 May 2003 05:39:51 -0000 1.3
@@ -4,7 +4,7 @@
/* conversion function template based on modperl-2's sv2request_rec */
-#define APREQ_XS_DEFINE_SV2(type) \
+#define APREQ_XS_DEFINE_SV2(type, class) \
static \
SV *apreq_xs_hv_find_##type(pTHX_ SV *in) \
{ \
@@ -69,16 +69,16 @@
SvIOK_on(sv); \
SvPOK_on(sv); \
sv_magic(sv, Nullsv, PERL_MAGIC_ext, (char *)t->env, 0); \
+ \
+ /* initialize sv as an object */ \
+ SvSTASH(sv) = gv_stashpv(class, TRUE); \
+ SvOBJECT_on(sv); \
return newRV_noinc(sv); \
}
#define APREQ_XS_DEFINE_TIEDSV(type, class) \
-static int apreq_xs_##type##_free(SV* sv, MAGIC *mg); \
-const static MGVTBL apreq_xs_##type##_magic = { 0, 0, 0, 0, \
- apreq_xs_##type##_free }; \
- \
-static int apreq_xs_##type##_free(SV* sv, MAGIC *mg) \
+static int apreq_xs_##type##_free(pTHX_ SV* sv, MAGIC *mg) \
{ \
/* need to prevent perl from freeing the apreq value */ \
SvPVX(sv) = NULL; \
@@ -86,7 +86,8 @@
SvPOK_off(sv); \
return 0; \
} \
- \
+const static MGVTBL apreq_xs_##type##_magic = { 0, 0, 0, 0, \
+ apreq_xs_##type##_free }; \
\
APR_INLINE \
static SV *apreq_xs_##type##2sv(apreq_##type##_t *t) \
1.2 +1 -1
httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Apache__Cookie.h
Index: Apache__Cookie.h
===================================================================
RCS file:
/home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Apache__Cookie.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Apache__Cookie.h 30 May 2003 19:15:22 -0000 1.1
+++ Apache__Cookie.h 31 May 2003 05:39:51 -0000 1.2
@@ -1,2 +1,2 @@
-APREQ_XS_DEFINE_SV2(jar);
+APREQ_XS_DEFINE_SV2(jar, "Apache::Cookie::Jar");
APREQ_XS_DEFINE_TIEDSV(cookie, "Apache::Cookie");
1.2 +1 -1
httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Apache__Request.h
Index: Apache__Request.h
===================================================================
RCS file:
/home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Apache__Request.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Apache__Request.h 30 May 2003 19:15:22 -0000 1.1
+++ Apache__Request.h 31 May 2003 05:39:51 -0000 1.2
@@ -1,2 +1,2 @@
-APREQ_XS_DEFINE_SV2(request);
+APREQ_XS_DEFINE_SV2(request, "Apache::Request");
APREQ_XS_DEFINE_TIEDSV(param, "Apache::Request::Param");