[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What replaces scm_register_module_xxx (Doc update?)
From: |
rm |
Subject: |
Re: What replaces scm_register_module_xxx (Doc update?) |
Date: |
Mon, 19 Aug 2002 21:05:24 +0200 |
User-agent: |
Mutt/1.3.24i |
On Sat, Aug 17, 2002 at 12:59:47PM +0100, Neil Jerram wrote:
> OK, so the idea is:
>
> HTTP request for some URL --->
> mapped by Apache config file to generic mod_guile handler,
> with parameters indicating the module in which the appropriate
> handler proc lives, and perhaps the proc name as well (?)
Yes, indeed. On can 'map' a request URL to an module/handler:
| <Location /blub>
| ...
| GuileSetHandler (foo bar)
| </Location>
or with an optional handler name:
| GuileSetHanlder ((foo bar) . my-handler)
> mod_guile handler uses the module and calls the handler proc from that
> module (how do you handle handler procs with the same name in
> different modules? perhaps by not actually importing them)
Correct, i don't import the modules, i just use them as namespace compartments.
> Now we're into Scheme code, that has a SMOB in its hand and wants to
> use the utility functions defined in (apache request) etc. to play
> with it, which it does using use-module in the usual way.
>
> And the problem was: how do you export the C definitions for (apache
> request) etc. into their respective modules?
>
> I presume that Marius's docs for the C module API have given you one
> answer, using scm_c_define, scm_c_with_module etc. Another
> possibility would be to write a C function per module to register its
> definitions as Guile primitives:
>
> void mg_register_apache_request_primitives ()
> {
> scm_c_define_gsubr (...);
> ...
> }
This is how i do it currently. An init function per functional unit/module.
>
> Then at the top of apache/request.scm, you can call this using either
> load-extension or the dynamic-* functions:
>
> (define-module (apache request)
> ...)
>
> (load-extension "libmg" "mg_register_apache_request_primitives")
Currently i pass these init functions to 'scm_c_define_module', but that's
probably equivalent to your solution.
> Does this cover everything, and would you mind if I reworked this into
> another example for the manual?
Sounds fine to me. As soon as i get space on a server i'll put the code
online (together with some samples ;-)
Ralf
> Regards,
> Neil
>
- Re: What replaces scm_register_module_xxx (Doc update?), (continued)
- Re: What replaces scm_register_module_xxx (Doc update?), Dale P. Smith, 2002/08/08
- Re: What replaces scm_register_module_xxx (Doc update?), Dale P. Smith, 2002/08/08
- Re: What replaces scm_register_module_xxx (Doc update?), Rob Browning, 2002/08/08
- Re: What replaces scm_register_module_xxx (Doc update?), Marius Vollmer, 2002/08/08
- Re: What replaces scm_register_module_xxx (Doc update?), Neil Jerram, 2002/08/08
- Re: What replaces scm_register_module_xxx (Doc update?), rm, 2002/08/09
- Re: What replaces scm_register_module_xxx (Doc update?), Neil Jerram, 2002/08/19
- Re: What replaces scm_register_module_xxx (Doc update?),
rm <=
- Re: What replaces scm_register_module_xxx (Doc update?), Matthias Koeppe, 2002/08/09
- Re: What replaces scm_register_module_xxx (Doc update?), rm, 2002/08/09
- Re: What replaces scm_register_module_xxx (Doc update?), Matthias Koeppe, 2002/08/09
- Re: What replaces scm_register_module_xxx (Doc update?), rm, 2002/08/09
- Re: What replaces scm_register_module_xxx (Doc update?), Marius Vollmer, 2002/08/10
- Re: What replaces scm_register_module_xxx (Doc update?), Marius Vollmer, 2002/08/11
- Re: What replaces scm_register_module_xxx (Doc update?), Dirk Herrmann, 2002/08/17
- Re: What replaces scm_register_module_xxx (Doc update?), Neil Jerram, 2002/08/19
- Re: What replaces scm_register_module_xxx (Doc update?), Dirk Herrmann, 2002/08/24
- Re: What replaces scm_register_module_xxx (Doc update?), Neil Jerram, 2002/08/26