guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More on module API


From: rm
Subject: More on module API
Date: Mon, 12 Aug 2002 21:29:38 +0200
User-agent: Mutt/1.3.24i

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 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]