cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
dougm 01/09/25 12:44:03 Modified:lib/ModPerl WrapXS.pm src/modules/perl modperl_perl_includes.h modperl_util.c modperl_util.h t/response/TestAPR table.pm todo api.txt xs modperl_xs_util.h typemap xs/APR/Table APR__Table.h xs/maps apr_functions.map xs/tables/current/ModPerl FunctionTable.pm Log: add APR::Table tied interface support Submitted by: Philippe M . Chiasson [EMAIL PROTECTED] Reviewed by: dougm Revision ChangesPath 1.22 +1 -0 modperl-2.0/lib/ModPerl/WrapXS.pm Index: WrapXS.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- WrapXS.pm 2001/09/13 02:37:37 1.21 +++ WrapXS.pm 2001/09/25 19:44:02 1.22 @@ -506,6 +506,7 @@ my %typemap = ( 'Apache::RequestRec' = 'T_APACHEOBJ', 'apr_time_t' = 'T_APR_TIME', +'APR::Table' = 'T_HASHOBJ', ); sub write_typemap { 1.6 +4 -0 modperl-2.0/src/modules/perl/modperl_perl_includes.h Index: modperl_perl_includes.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- modperl_perl_includes.h 2001/09/25 17:30:32 1.5 +++ modperl_perl_includes.h 2001/09/25 19:44:02 1.6 @@ -51,4 +51,8 @@ # define G_METHOD 64 #endif +#ifndef PERL_MAGIC_tied +# define PERL_MAGIC_tied 'P' +#endif + #endif /* MODPERL_PERL_INCLUDES_H */ 1.18 +47 -0 modperl-2.0/src/modules/perl/modperl_util.c Index: modperl_util.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- modperl_util.c2001/08/08 16:20:32 1.17 +++ modperl_util.c2001/09/25 19:44:02 1.18 @@ -339,3 +339,50 @@ return uri; } +MP_INLINE SV *modperl_hash_tie(pTHX_ + const char *classname, + SV *tsv, void *p) +{ +SV *hv = (SV*)newHV(); +SV *rsv = newSViv(0); + +sv_setref_pv(rsv, classname, p); +sv_magic(hv, rsv, PERL_MAGIC_tied, Nullch, 0); + +return SvREFCNT_inc(sv_bless(sv_2mortal(newRV_noinc(hv)), + gv_stashpv(classname, TRUE))); +} + +MP_INLINE void *modperl_hash_tied_object(pTHX_ + const char *classname, + SV *tsv) +{ +if (sv_derived_from(tsv, classname)) { +if (SVt_PVHV == SvTYPE(SvRV(tsv))) { +SV *hv = SvRV(tsv); +MAGIC *mg; + +if (SvMAGICAL(hv)) { +if ((mg = mg_find(hv, PERL_MAGIC_tied))) { +return (void *)MgObjIV(mg); +} +else { +Perl_warn(aTHX_ Not a tied hash: (magic=%c), mg); +} +} +else { +Perl_warn(aTHX_ SV is not tied); +} +} +else { +return (void *)SvObjIV(tsv); +} +} +else { +Perl_croak(aTHX_ + argument is not a blessed reference + (expecting an %s derived object), classname); +} + +return NULL; +} 1.17 +9 -0 modperl-2.0/src/modules/perl/modperl_util.h Index: modperl_util.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- modperl_util.h2001/08/08 07:02:41 1.16 +++ modperl_util.h2001/09/25 19:44:02 1.17 @@ -19,6 +19,7 @@ #endif #define SvObjIV(o) SvIV((SV*)SvRV(o)) +#define MgObjIV(m) SvIV((SV*)SvRV(m-mg_obj)) MP_INLINE server_rec *modperl_sv2server_rec(pTHX_ SV *sv); MP_INLINE request_rec *modperl_sv2request_rec(pTHX_ SV *sv); @@ -49,5 +50,13 @@ modperl_cleanup_data_t *modperl_cleanup_data_new(apr_pool_t *p, void *data); MP_INLINE modperl_uri_t *modperl_uri_new(apr_pool_t *p); + +/* tie %hash */ +MP_INLINE SV *modperl_hash_tie(pTHX_ const char *classname, + SV *tsv, void *p); + +/* tied %hash */ +MP_INLINE void *modperl_hash_tied_object(pTHX_ const char *classname, + SV *tsv); #endif /* MODPERL_UTIL_H */ 1.3 +29 -2
cvs commit: modperl-2.0/lib/Apache ParseSource.pm
dougm 01/09/25 09:33:30 Modified:lib/Apache ParseSource.pm Log: skip mod_cgi.h Revision ChangesPath 1.27 +1 -1 modperl-2.0/lib/Apache/ParseSource.pm Index: ParseSource.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- ParseSource.pm2001/09/06 16:40:11 1.26 +++ ParseSource.pm2001/09/25 16:33:30 1.27 @@ -88,7 +88,7 @@ my @includes; my $unwanted = join '|', qw(ap_listen internal version -apr_optional mod_include +apr_optional mod_include mod_cgi mod_ssl ssl_); for my $dir (@dirs) {
cvs commit: modperl-2.0/src/modules/perl modperl_perl_includes.h
dougm 01/09/25 10:30:32 Modified:lib/Apache ParseSource.pm src/modules/perl modperl_perl_includes.h Log: C::Scan does not properly remove __attribute__ within function prototypes; so we just rip them all out via cpp Revision ChangesPath 1.28 +1 -1 modperl-2.0/lib/Apache/ParseSource.pm Index: ParseSource.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- ParseSource.pm2001/09/25 16:33:30 1.27 +++ ParseSource.pm2001/09/25 17:30:31 1.28 @@ -60,7 +60,7 @@ my $c = C::Scan-new(filename = $self-{scan_filename}); $c-set(includeDirs = $self-includes); -$c-set(Defines = '-DCORE_PRIVATE'); +$c-set(Defines = '-DCORE_PRIVATE -DMP_SOURCE_SCAN'); bless $c, 'Apache::ParseSource::Scan'; } 1.5 +8 -0 modperl-2.0/src/modules/perl/modperl_perl_includes.h Index: modperl_perl_includes.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- modperl_perl_includes.h 2001/03/15 01:26:18 1.4 +++ modperl_perl_includes.h 2001/09/25 17:30:32 1.5 @@ -18,6 +18,14 @@ # define PERL_CORE #endif +#ifdef MP_SOURCE_SCAN +/* XXX: C::Scan does not properly remove __attribute__ within + * function prototypes; so we just rip them all out via cpp + */ +# undef __attribute__ +# define __attribute__(arg) +#endif + #include EXTERN.h #include perl.h #include XSUB.h
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
dougm 01/09/25 11:02:39 Modified:xs/tables/current/Apache FunctionTable.pm StructureTable.pm xs/tables/current/ModPerl FunctionTable.pm Log: sync Revision ChangesPath 1.20 +167 -1modperl-2.0/xs/tables/current/Apache/FunctionTable.pm Index: FunctionTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/FunctionTable.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- FunctionTable.pm 2001/09/15 17:53:12 1.19 +++ FunctionTable.pm 2001/09/25 18:02:39 1.20 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Sat Sep 15 10:57:55 2001 +# ! Tue Sep 25 10:58:26 2001 # ! do NOT edit, any changes will be lost ! # !! @@ -188,6 +188,24 @@ ] }, { +'return_type' = 'void', +'name' = 'ap_allow_standard_methods', +'args' = [ + { +'type' = 'request_rec *', +'name' = 'r' + }, + { +'type' = 'int', +'name' = 'reset' + }, + { +'type' = '...', +'name' = 'arg2' + } +] + }, + { 'return_type' = 'const char *', 'name' = 'ap_auth_name', 'args' = [ @@ -736,6 +754,34 @@ }, { 'return_type' = 'apr_status_t', +'name' = 'ap_explode_recent_gmt', +'args' = [ + { +'type' = 'apr_exploded_time_t *', +'name' = 'tm' + }, + { +'type' = 'apr_time_t', +'name' = 't' + } +] + }, + { +'return_type' = 'apr_status_t', +'name' = 'ap_explode_recent_localtime', +'args' = [ + { +'type' = 'apr_exploded_time_t *', +'name' = 'tm' + }, + { +'type' = 'apr_time_t', +'name' = 't' + } +] + }, + { +'return_type' = 'apr_status_t', 'name' = 'ap_fflush', 'args' = [ { @@ -6557,6 +6603,24 @@ }, { 'return_type' = 'apr_status_t', +'name' = 'apr_file_mktemp', +'args' = [ + { +'type' = 'apr_file_t **', +'name' = 'fp' + }, + { +'type' = 'char *', +'name' = 'tmplt' + }, + { +'type' = 'apr_pool_t *', +'name' = 'p' + } +] + }, + { +'return_type' = 'apr_status_t', 'name' = 'apr_file_name_get', 'args' = [ { @@ -8979,6 +9043,104 @@ ] }, { +'return_type' = 'apr_status_t', +'name' = 'apr_proc_mutex_child_init', +'args' = [ + { +'type' = 'apr_proc_mutex_t **', +'name' = 'mutex' + }, + { +'type' = 'const char *', +'name' = 'fname' + }, + { +'type' = 'apr_pool_t *', +'name' = 'pool' + } +] + }, + { +'return_type' = 'apr_status_t', +'name' = 'apr_proc_mutex_create', +'args' = [ + { +'type' = 'apr_proc_mutex_t **', +'name' = 'mutex' + }, + { +'type' = 'const char *', +'name' = 'fname' + }, + { +'type' = 'apr_pool_t *', +'name' = 'pool' + } +] + }, + { +'return_type' = 'apr_status_t', +'name' = 'apr_proc_mutex_create_np', +'args' = [ + { +'type' = 'apr_proc_mutex_t **', +'name' = 'mutex' + }, + { +'type' = 'const char *', +'name' = 'fname' + }, + { +'type' = 'apr_lockmech_e_np', +'name' = 'mech' + }, + { +'type' = 'apr_pool_t *', +'name' = 'pool' + } +] + }, + { +'return_type' = 'apr_status_t', +'name' = 'apr_proc_mutex_destroy', +'args' = [ + { +'type' = 'apr_proc_mutex_t *', +'name' = 'mutex' + } +] + }, + { +'return_type' = 'apr_status_t', +'name' = 'apr_proc_mutex_lock', +'args' = [ + { +'type' = 'apr_proc_mutex_t *', +'name' = 'mutex' + } +] + }, + { +'return_type' = 'apr_status_t', +'name' = 'apr_proc_mutex_trylock', +'args' = [ + { +'type' = 'apr_proc_mutex_t *', +'name' = 'mutex' + } +] + }, + { +'return_type' = 'apr_status_t', +'name' = 'apr_proc_mutex_unlock', +'args' = [ + { +'type' = 'apr_proc_mutex_t *', +'name' = 'mutex' + } +] + }, + { 'return_type' = 'void', 'name' = 'apr_proc_other_child_check', 'args' = [] @@ -9042,6 +9204,10 @@