You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/11/27 15:55:18 UTC

source_scan doesn't pick up new MPXS_ method :(

I think I've tried all the combinations of possible ways to declare a 
function in the map file, but in vain -- it won't be picked by the 
source scan.

What I try to add is something like this:

Index: xs/maps/modperl_functions.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
retrieving revision 1.29
diff -u -r1.29 modperl_functions.map
--- xs/maps/modperl_functions.map	2001/11/15 18:19:56	1.29
+++ xs/maps/modperl_functions.map	2001/11/27 14:31:37
@@ -90,3 +90,6 @@
  PACKAGE=Apache
  DEFINE_LOG_MARK   | MPXS_Apache_LOG_MARK       | ...
  DEFINE_warn       | MPXS_Apache__Log_log_error | ...
+
+PACKAGE=Apache::Broken
+ Apache__Broken_broken | MPXS_ | ...
--- /dev/null	Thu Jan  1 07:30:00 1970
+++ xs/Apache/Broken/Apache__Broken.h	Tue Nov 27 22:46:34 2001
@@ -0,0 +1,3 @@
+static XS(MPXS_Apache__Broken_broken)
+{
+}

I've looked at all other XS(MPXS_...) functions but they all appear to 
be somewhat special. what do I miss?

I've tried to use the usual mpxs_ style and ...:

+PACKAGE=Apache::Broken
+ mpxs_Apache__Broken_broken |  | ...

so I can work with:
  (pTHX_ I32 items,SV **MARK, SV **SP) and just code in XS ppcode, but 
how do I get hold of 'cv'? I need it for modperl_sv2request_rec to 
convert ST(0) into request_rec object.


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: source_scan doesn't pick up new MPXS_ method :(

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 28 Nov 2001, Stas Bekman wrote:
 
> that's not the problem. The problem is that the xs_generate has a bug 
> and it won't create Wrap/Apache/Subprocess/Apache__SubProcess.h if there 

i sure hope it wouldn't create that file!

> are only MPXS_ functions in the map file. I've added a dummy normal 
> (mpxs_) function and now it does what I want:

should work now.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: source_scan doesn't pick up new MPXS_ method :(

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:

> MPXS_ functions are not supposed to be picked up by source_scan.  they are
> supposed to be thin wrappers around the real functions that actually do
> the work.  the real functions are what get picked up by source_scan.


that's not the problem. The problem is that the xs_generate has a bug 
and it won't create Wrap/Apache/Subprocess/Apache__SubProcess.h if there 
are only MPXS_ functions in the map file. I've added a dummy normal 
(mpxs_) function and now it does what I want:


MODULE=Apache::SubProcess PACKAGE=Apache::RequestRec
  modperl_test_run | MPXS_ | ...
  mpxs_Apache__SubProcess_dummy

but I don't want the dummy function...

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: source_scan doesn't pick up new MPXS_ method :(

Posted by Doug MacEachern <do...@covalent.net>.
MPXS_ functions are not supposed to be picked up by source_scan.  they are
supposed to be thin wrappers around the real functions that actually do
the work.  the real functions are what get picked up by source_scan.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: source_scan doesn't pick up new MPXS_ method :(

Posted by Stas Bekman <st...@stason.org>.
Gerald Richter wrote:

> 
>>I think I've tried all the combinations of possible ways to declare a
>>function in the map file, but in vain -- it won't be picked by the
>>source scan.
>>
>>
> 
> Source scan doesn't look at the maps files at all. Source scan only scans
> the h files. Inside of Apache/ModPerl::ParseSource there are a lot of
> condtions what should be included and what shouldn't.
> 
> The map files a picked up by xs_generate and put together with the
> xs/tables/current/Apache|ModPerl/*Tables.pm to generate the XS code
> 
> So first of all you have to make sure that your function goes into
> xs/tables/current/ModPerl/FunctionTable.pm. Does iT ?
> 
> If not you maybe have to alter the conditions in ModPerl::ParseSource, so it
> gets parsed and included.


That's right, if I add MPXS to

my $prefixes = join '|', qw(modperl mpxs mp_xs);


in ModPerl/ParseSource.pm

it picks it up for ModPerl/FunctionTable.pm

but then it won't go into Wrap during xs_generate

I've tried

static XS(mpxs_Apache__Broken_broken)

but it won't work.

According to the old doc originally residing in pod/

     =item MPXS_

     The prefix for mod_perl XSUBs with an XS() prototype.

and that's what I was trying to use...

no luck so far.


>>What I try to add is something like this:
>>
>>Index: xs/maps/modperl_functions.map
>>===================================================================
>>RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
>>retrieving revision 1.29
>>diff -u -r1.29 modperl_functions.map
>>--- xs/maps/modperl_functions.map 2001/11/15 18:19:56 1.29
>>+++ xs/maps/modperl_functions.map 2001/11/27 14:31:37
>>@@ -90,3 +90,6 @@
>>  PACKAGE=Apache
>>  DEFINE_LOG_MARK   | MPXS_Apache_LOG_MARK       | ...
>>  DEFINE_warn       | MPXS_Apache__Log_log_error | ...
>>+
>>+PACKAGE=Apache::Broken
>>+ Apache__Broken_broken | MPXS_ | ...
>>--- /dev/null Thu Jan  1 07:30:00 1970
>>+++ xs/Apache/Broken/Apache__Broken.h Tue Nov 27 22:46:34 2001
>>@@ -0,0 +1,3 @@
>>+static XS(MPXS_Apache__Broken_broken)
>>+{
>>+}
>>
>>I've looked at all other XS(MPXS_...) functions but they all appear to
>>be somewhat special. what do I miss?
>>
>>I've tried to use the usual mpxs_ style and ...:
>>
>>+PACKAGE=Apache::Broken
>>+ mpxs_Apache__Broken_broken |  | ...
>>
>>so I can work with:
>>  (pTHX_ I32 items,SV **MARK, SV **SP) and just code in XS ppcode, but
>>how do I get hold of 'cv'? I need it for modperl_sv2request_rec to
>>convert ST(0) into request_rec object.
>>
>>
>>_____________________________________________________________________
>>Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
>>http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
>>mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
>>http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
>>For additional commands, e-mail: dev-help@perl.apache.org
>>
>>
>>
> 
> 
> -------------------------------------------------------------
> Gerald Richter    ecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
> 
> Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
> E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
> WWW:        http://www.ecos.de      Fax:      +49 6133 925152
> -------------------------------------------------------------
> 
> 
> 



-- 


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: source_scan doesn't pick up new MPXS_ method :(

Posted by Gerald Richter <ri...@ecos.de>.

> I think I've tried all the combinations of possible ways to declare a
> function in the map file, but in vain -- it won't be picked by the
> source scan.
>

Source scan doesn't look at the maps files at all. Source scan only scans
the h files. Inside of Apache/ModPerl::ParseSource there are a lot of
condtions what should be included and what shouldn't.

The map files a picked up by xs_generate and put together with the
xs/tables/current/Apache|ModPerl/*Tables.pm to generate the XS code

So first of all you have to make sure that your function goes into
xs/tables/current/ModPerl/FunctionTable.pm. Does iT ?

If not you maybe have to alter the conditions in ModPerl::ParseSource, so it
gets parsed and included.

Gerald



> What I try to add is something like this:
>
> Index: xs/maps/modperl_functions.map
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
> retrieving revision 1.29
> diff -u -r1.29 modperl_functions.map
> --- xs/maps/modperl_functions.map 2001/11/15 18:19:56 1.29
> +++ xs/maps/modperl_functions.map 2001/11/27 14:31:37
> @@ -90,3 +90,6 @@
>   PACKAGE=Apache
>   DEFINE_LOG_MARK   | MPXS_Apache_LOG_MARK       | ...
>   DEFINE_warn       | MPXS_Apache__Log_log_error | ...
> +
> +PACKAGE=Apache::Broken
> + Apache__Broken_broken | MPXS_ | ...
> --- /dev/null Thu Jan  1 07:30:00 1970
> +++ xs/Apache/Broken/Apache__Broken.h Tue Nov 27 22:46:34 2001
> @@ -0,0 +1,3 @@
> +static XS(MPXS_Apache__Broken_broken)
> +{
> +}
>
> I've looked at all other XS(MPXS_...) functions but they all appear to
> be somewhat special. what do I miss?
>
> I've tried to use the usual mpxs_ style and ...:
>
> +PACKAGE=Apache::Broken
> + mpxs_Apache__Broken_broken |  | ...
>
> so I can work with:
>   (pTHX_ I32 items,SV **MARK, SV **SP) and just code in XS ppcode, but
> how do I get hold of 'cv'? I need it for modperl_sv2request_rec to
> convert ST(0) into request_rec object.
>
>
> _____________________________________________________________________
> Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
> http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
> mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
> http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org
>
>


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org