From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Tuexen Newsgroups: gmane.lisp.guile.devel Subject: Re: Initial SCTP support for the upcoming 1.6.5 release Date: Tue, 24 Aug 2004 14:46:14 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <95CA6528-F5CB-11D8-93F2-000D932C78D8@lurchi.franken.de> References: <28C61BE4-EB92-11D8-9129-000D932C78D8@lurchi.franken.de> <02FA4EE0-EFA6-11D8-B63D-000D932C78D8@lurchi.franken.de> <87ekm67wis.fsf@trouble.defaultvalue.org> <58846D32-F2D5-11D8-9904-000D932C78D8@lurchi.franken.de> <87oel2r7p3.fsf@zip.com.au> <3FE09419-F53E-11D8-B290-000D932C78D8@lurchi.franken.de> <87vff9z737.fsf@zip.com.au> <89D0BF0E-F5C0-11D8-93F2-000D932C78D8@lurchi.franken.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1093351629 14797 80.91.224.253 (24 Aug 2004 12:47:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Aug 2004 12:47:09 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 24 14:46:58 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BzahW-00049v-00 for ; Tue, 24 Aug 2004 14:46:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bzam1-0002Cp-Sd for guile-devel@m.gmane.org; Tue, 24 Aug 2004 08:51:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bzalt-0002Ck-9B for guile-devel@gnu.org; Tue, 24 Aug 2004 08:51:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bzals-0002CY-MO for guile-devel@gnu.org; Tue, 24 Aug 2004 08:51:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bzals-0002CV-Jo for guile-devel@gnu.org; Tue, 24 Aug 2004 08:51:28 -0400 Original-Received: from [193.175.24.27] (helo=ilsa.franken.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1Bzagv-0004AA-KY for guile-devel@gnu.org; Tue, 24 Aug 2004 08:46:22 -0400 Original-Received: from [192.168.1.219] (pD9FF1858.dip.t-dialin.net [217.255.24.88]) by ilsa.franken.de (Postfix) with ESMTP id CF618245CB; Tue, 24 Aug 2004 14:46:17 +0200 (CEST) (KNF account authenticated via SMTP-AUTH) In-Reply-To: <89D0BF0E-F5C0-11D8-93F2-000D932C78D8@lurchi.franken.de> Original-To: guile-devel@gnu.org X-Mailer: Apple Mail (2.619) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:4020 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:4020 Dear all, with the hints of Kevin I got my stuff working. I need besides the static functions from socket.c the SCM_SYSCALL stuff from libguile/_scm.h. This is file is not installed. So is there a chance to move the SCM_SYSCALL stuff from _scm.h to __scm.h? If not, I have to duplicate the code, which is not a problem... I have another question: How can I make the documentation included in the SCM_DEFINE makro available from scheme. My C code contains SCM_DEFINE (net_sctp_sendmsg, "sctp-sendmsg", 8, 0, 1, (SCM sock, SCM message, SCM ppid, SCM stream_no, SCM ttl, SCM context, SCM fam, SCM address, SCM args_and_flags), "Transmit the string @var{message} on the socket port\n" "@var{sock}. The\n" "parameters @var{ppid}, @var{stream_no}, @var{ttl} and @var{context}\n" "are the corresponding SCTP parameters. The\n" "destination address is specified using the @var{fam},\n" "@var{address} and\n" "@var{args_and_flags} arguments, in a similar way to the\n" "@code{connect} procedure. @var{args_and_flags} contains\n" "the usual connection arguments optionally followed by\n" "a flags argument, which is a value or\n" "bitwise OR of MSG_UNORDERED, MSG_ABORT, MSG_EOF etc.\n\n" "The value returned is the number of bytes transmitted\n" "Note that the data is written directly to the socket\n" "file descriptor:\n" "any unflushed buffered port data is ignored.") #define FUNC_NAME s_net_sctp_sendmsg { /* missing the code */ return SCM_MAKINUM (rv); } #undef FUNC_NAME but on the scheme side it is not available like the documentation for the socket() call, which is defined in libguile/socket.c: guile> (use-modules (net sctp)) guile> (help socket) `socket' is a primitive procedure in the (guile) module. - Scheme Procedure: socket family style proto Return a new socket port of the type specified by FAMILY, STYLE and PROTO. All three parameters are integers. Supported values for FAMILY are `AF_UNIX', `AF_INET' and `AF_INET6'. Typical values for STYLE are `SOCK_STREAM', `SOCK_DGRAM' and `SOCK_RAW'. PROTO can be obtained from a protocol name using `getprotobyname'. A value of zero specifies the default protocol, which is usually right. A single socket port cannot by used for communication until it has been connected to another socket. guile> (help sctp-sendmsg) No documentation found for: (net sctp): sctp-sendmsg Thank you very much for your help. Best regards Michael On Aug 24, 2004, at 1:27 PM, Michael Tuexen wrote: > Kevin, > > see my comments below. > > Best regards > Michael > > On Aug 24, 2004, at 2:57 AM, Kevin Ryde wrote: > >> Michael Tuexen writes: >>> >>> Since the set/getsockopt function does not reference any specific >>> structure >>> it would be a possibility of have it provided as generic as it is in >>> C >>> and >>> I would write some scheme functions to transfer the SCTP specific >>> data >>> into the generic one. >> >> It's probably better to make replacement functions that do their >> specifics then call the core. >> >> (If there were many semi-independent modules going to do that then >> some sort of hook arrangement would be better, but a replacement will >> work initially at least.) > So I just define my own setsockopt and it will 'overwrite' the existing > one. That'll work. I was not sure if I can just define another function > with the same name and that will overwrite the existing one. >> >>> I have not found an example for C based modules for guile yet. >> >> load-extension I think, per "A Sample Guile Extension" and "Putting >> Extensions into Modules" in the manual. More indexing in the manual >> might help when looking for such stuff. > I was looking at > > http://www.gnu.org/software/guile/docs/guile-ref/Dynamic- > Libraries.html#Dynamic%20Libraries > > under the title "Modules" > not at "A Whirlwind Tour" where I find under > http://www.gnu.org/software/guile/docs/guile-ref/A-Sample-Guile- > Extension.html#A%20Sample%20Guile%20Extension > the Extension stuff... Thank you very much for the hint. > >> >>> Everything distributed with guile is scheme based, I think. >> >> Cf srfi/srfi-13 and 14, and guile-readline/ice-9/readline.scm. > Ahh. I have not found them. I was looking at ice-9... > > Thank you very much for your help. >> > > > > _______________________________________________ > Guile-devel mailing list > Guile-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/guile-devel > _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel