* More on module API
@ 2002-08-12 19:29 rm
2002-08-16 20:56 ` Dale P. Smith
2002-08-31 13:49 ` Marius Vollmer
0 siblings, 2 replies; 4+ messages in thread
From: rm @ 2002-08-12 19:29 UTC (permalink / raw)
Hello,
first of all a big "thank you" to Mathias and Marius -- i
now got my module stuff working. Working on mod_guile some
more questions and suggestions emerged:
- currently snarfing doesn't really work for my use of the
module C API. While it does generate a call to 'scm_c_define_gsubr'
it doesn't generate one for 'scm_c_export'. I guess the rationale
behind this was the concept that methods are added to the modules
public interface by means of scheme code. Since sometimes (like in
my case) this isn't wanted i want to suggest adding a new snarfer
macro 'SCM_DEFINE_PUBLIC' to libguile/snarf.h:
/* FIXME: The following is _allmost_ literal from libguile/snarf.h:
* This should be provided by guile itself.
*/
#define SCM_DEFINE_PUBLIC(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \
SCM_SNARF_HERE(\
static const char s_ ## FNAME [] = PRIMNAME; \
static SCM FNAME ARGLIST\
)\
SCM_SNARF_INIT(\
scm_c_define_gsubr (s_ ## FNAME, REQ, OPT, VAR, \
(SCM_FUNC_CAST_ARBITRARY_ARGS) FNAME); \
scm_c_export(s_ ## FNAME , NULL); \
)\
SCM_SNARF_DOCS(primitive, FNAME, PRIMNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING)
- looking at the code emited by the current snarfer i realized that
the function isn't declared 'static' (NOTE: my version of SCM_DEFINE_PUBLIC
declares the function to be static). Is this intentional? I can't think of a
reason to export the function on the C level.
Ralf Mattes
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: More on module API
2002-08-12 19:29 More on module API rm
@ 2002-08-16 20:56 ` Dale P. Smith
2002-08-31 13:49 ` Marius Vollmer
1 sibling, 0 replies; 4+ messages in thread
From: Dale P. Smith @ 2002-08-16 20:56 UTC (permalink / raw)
On Mon, 12 Aug 2002 21:29:38 +0200
rm@fabula.de wrote:
>
> - looking at the code emited by the current snarfer i realized that
> the function isn't declared 'static' (NOTE: my version of SCM_DEFINE_PUBLIC
> declares the function to be static). Is this intentional? I can't think of a
> reason to export the function on the C level.
>
Lots of Guile C code calls the C functions directly. If declared
static, they could only be called from within the same source file.
-Dale
--
Dale P. Smith
Senior Systems Consultant, | Treasurer,
Altus Technologies Corporation | Cleveland Linux Users Group
dsmith@altustech.com | http://cleveland.lug.net
440-746-9000 x339 |
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: More on module API
2002-08-12 19:29 More on module API rm
2002-08-16 20:56 ` Dale P. Smith
@ 2002-08-31 13:49 ` Marius Vollmer
2002-08-31 18:32 ` Dale P. Smith
1 sibling, 1 reply; 4+ messages in thread
From: Marius Vollmer @ 2002-08-31 13:49 UTC (permalink / raw)
rm@fabula.de writes:
> /* FIXME: The following is _allmost_ literal from libguile/snarf.h:
> * This should be provided by guile itself.
> */
> #define SCM_DEFINE_PUBLIC(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \
> SCM_SNARF_HERE(\
> static const char s_ ## FNAME [] = PRIMNAME; \
> static SCM FNAME ARGLIST\
> )\
> SCM_SNARF_INIT(\
> scm_c_define_gsubr (s_ ## FNAME, REQ, OPT, VAR, \
> (SCM_FUNC_CAST_ARBITRARY_ARGS) FNAME); \
> scm_c_export(s_ ## FNAME , NULL); \
> )\
> SCM_SNARF_DOCS(primitive, FNAME, PRIMNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING)
I think we add provide this, without "static". Objections?
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: More on module API
2002-08-31 13:49 ` Marius Vollmer
@ 2002-08-31 18:32 ` Dale P. Smith
0 siblings, 0 replies; 4+ messages in thread
From: Dale P. Smith @ 2002-08-31 18:32 UTC (permalink / raw)
On 31 Aug 2002 15:49:40 +0200
Marius Vollmer <mvo@zagadka.ping.de> wrote:
> rm@fabula.de writes:
>
> > /* FIXME: The following is _allmost_ literal from libguile/snarf.h:
> > * This should be provided by guile itself.
> > */
> > #define SCM_DEFINE_PUBLIC(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \
> > SCM_SNARF_HERE(\
> > static const char s_ ## FNAME [] = PRIMNAME; \
> > static SCM FNAME ARGLIST\
> > )\
> > SCM_SNARF_INIT(\
> > scm_c_define_gsubr (s_ ## FNAME, REQ, OPT, VAR, \
> > (SCM_FUNC_CAST_ARBITRARY_ARGS) FNAME); \
> > scm_c_export(s_ ## FNAME , NULL); \
> > )\
> > SCM_SNARF_DOCS(primitive, FNAME, PRIMNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING)
>
> I think we add provide this, without "static". Objections?
Sounds good to me!
-Dale
--
Dale P. Smith
Senior Systems Consultant, | Treasurer,
Altus Technologies Corporation | Cleveland Linux Users Group
dsmith@altustech.com | http://cleveland.lug.net
440-746-9000 x339 |
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-08-31 18:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-12 19:29 More on module API rm
2002-08-16 20:56 ` Dale P. Smith
2002-08-31 13:49 ` Marius Vollmer
2002-08-31 18:32 ` Dale P. Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).