guile-devel
[Top][All Lists]
Advanced

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

Re: Creating modules from C


From: Marius Vollmer
Subject: Re: Creating modules from C
Date: 15 May 2001 02:44:54 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Alex Shinn <address@hidden> writes:

> So how would one define an exported function from C?

Like this:

    void
    my_module_init (void *unused)
    {
      scm_make_gsubr ("foo", 0, 0, 0, foo);
      scm_make_gsubr ("bar", 0, 0, 0, foo);
      ...
      scm_c_export ("foo", "bar");
    }

    void
    create_my_module ()
    {
      scm_c_define_module ("my module", my_module_init, NULL);
    }

`scm_make_gsubr' already uses scm_define internally.  (I'd say, it
shouldn't).  We could certainly improve upon this pattern.  The
snarfer can help, too.  But for now, I'd like to concentrate on the
basics.



reply via email to

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