From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.user Subject: Re: c interface to modules Date: Fri, 17 Jun 2005 17:44:33 -0500 Message-ID: <87zmtoli26.fsf@trouble.defaultvalue.org> References: <20050616194019.GA22291@feanor> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1119048947 15725 80.91.229.2 (17 Jun 2005 22:55:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2005 22:55:47 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jun 18 00:55:47 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DjPk6-0004l6-M0 for guile-user@m.gmane.org; Sat, 18 Jun 2005 00:55:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DjPpn-0005vP-Vy for guile-user@m.gmane.org; Fri, 17 Jun 2005 19:01:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DjPoa-0005id-6G for guile-user@gnu.org; Fri, 17 Jun 2005 18:59:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DjPoS-0005em-EI for guile-user@gnu.org; Fri, 17 Jun 2005 18:59:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DjPoS-0005b1-3i for guile-user@gnu.org; Fri, 17 Jun 2005 18:59:48 -0400 Original-Received: from [70.85.129.156] (helo=defaultvalue.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DjPbl-0006rq-IO for guile-user@gnu.org; Fri, 17 Jun 2005 18:46:41 -0400 Original-Received: from omen.defaultvalue.org (localhost [127.0.0.1]) by defaultvalue.org (Postfix) with ESMTP id CD474911AB; Fri, 17 Jun 2005 17:44:34 -0500 (CDT) Original-Received: from trouble.defaultvalue.org (omen.defaultvalue.org [192.168.1.1]) by omen.defaultvalue.org (Postfix) with ESMTP id 7FD76409F; Fri, 17 Jun 2005 17:44:34 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 23ED4410DE; Fri, 17 Jun 2005 17:44:33 -0500 (CDT) Original-To: Ondrej Zajicek In-Reply-To: <20050616194019.GA22291@feanor> (Ondrej Zajicek's message of "Thu, 16 Jun 2005 21:40:20 +0200") User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:4632 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:4632 Ondrej Zajicek writes: > I would like to export two sets (low-level and high-level interface) > of C functions to Scheme. I think it is a good idea to have each > interface in different module. What is a good way to define C > function in specific module? Should i just replace > scm_c_define_gsubr with combination of scm_c_make_gsubr and > scm_c_module_define? If you write each of your modules as a .scm file which loads a C library and calls an init function (see 1.6's srfi-13.scm, for example), then you can just have two init functions in your C library, one for the low-level functions, and one for the high-level functions, i.e. ;; high-level.scm (define-module (high-level)) (load-extension "libguile-foo-v-1" "scm_init_foo_high_level") (export bar) ... ;; high-level.scm (define-module (low-level)) (load-extension "libguile-foo-v-1" "scm_init_foo_low_level") (export baz) ... -- Rob Browning rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4 _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user