hi all...
here is an implementation for the final missing piece in directive handlers - $parms->info.
nice work, Geoff!
even though info is part of the cmd_parms_struct, it needs special treatment due to the underlying and imposed mod_perl struct on the slot. so, info() is implemented in Apache__CmdParms.h which, I gather, is the way to add stuff to the autogenerated classes.
Correct.
in XS, the patch changes the current (autogenerated) implementation from
void * info(obj, val=NULL) Apache::CmdParms obj void * val ... RETVAL = (void *) obj->info; ...
to its new form
char * info(obj, val=NULL) Apache::CmdParms obj void * val ... RETVAL = ((modperl_module_cmd_data_t *)obj->info)->cmd_data; ...
which is essentially how mp1 handled it.
Since now things are implemented in perl, may be it'd make more sense to match the perl API with perl keys? Since now you have:
> + cmd_data => 'some info',
but you retrieve it with:
->info
that's confusing.
the patch was (for the most part) generated by making the above change in WrapXS, compiling, then putting the results from the generated .c into Apache__CmdParms.h - in other words, the patch was autogenerated too, so don't blame me :)
Yes, but you need to rewrite it to reduce the clutter, which is ok when things are autogenerated, since no one has to maintain them. There is a typemap for doing all the conversions and croaking. Look at other thin wrappers in .h files under xs/ or the guide for writing those wrappers. It should be pretty trivial for this function.
anyway, I had to shuffle the modperl_module_cmd_data_t struct around so that everybody could see everything, but it all worked out in the end.
Won't it better to put it into modperl_types.h then? All public types reside there.
oh, and I couldn't figure out how to cvs diff the xs/Apache/CmdParms/Apache__CmdParms.h file and directory I needed to add (-RuN didn't seem to work), so that file is included as a diff against /dev/null.
That's correct. plus we have util/getdiff.pl which does all the work for you.
+ ok (! $dir_cfg->{MyTestInfo});
no need for () here.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
