I need Apache->gensym (actually I need the C function modperl_gensym), I
wanted to port it from 1.x but todo says:
Apache->gensym:
>> Apache::compat ?
we don't need it anymore? I know we don't need it for the Perl side, but
we do need it for the C side.
This is a slightly adjusted copy from 1.x. Should it be named
modperl_perl_gensym?
In any case, while I'm at it, I'd rather complete this todo item. So
should I just use Symbol::gensym in compat.pm?
--- src/modules/perl/modperl_util.c 2001/11/19 23:24:46 1.31
+++ src/modules/perl/modperl_util.c 2001/12/12 17:10:11
@@ -572,3 +572,13 @@
{
return gv_stashpv(name, FALSE) ? 1 : 0;
}
+
+/* same as Symbol::gensym() */
+SV *modperl_gensym(pTHX_ char *pack)
+{
+ GV *gv = newGVgen(pack);
+ SV *rv = newRV((SV*)gv);
+ (void)hv_delete(gv_stashpv(pack, TRUE),
+ GvNAME(gv), GvNAMELEN(gv), G_DISCARD);
+ return rv;
+}
Index: src/modules/perl/modperl_util.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
retrieving revision 1.30
diff -u -r1.30 modperl_util.h
--- src/modules/perl/modperl_util.h 2001/11/06 18:39:41 1.30
+++ src/modules/perl/modperl_util.h 2001/12/12 17:10:11
@@ -112,4 +112,6 @@
MP_INLINE int modperl_perl_module_loaded(pTHX_ const char *name);
+SV *modperl_gensym(pTHX_ char *pack);
+
#endif /* MODPERL_UTIL_H */
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]