unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
Subject: Re: Initial SCTP support for the upcoming 1.6.5 release
Date: Tue, 24 Aug 2004 14:46:14 +0200	[thread overview]
Message-ID: <95CA6528-F5CB-11D8-93F2-000D932C78D8@lurchi.franken.de> (raw)
In-Reply-To: <89D0BF0E-F5C0-11D8-93F2-000D932C78D8@lurchi.franken.de>

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 <Michael.Tuexen@lurchi.franken.de> 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


  reply	other threads:[~2004-08-24 12:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-10 18:26 Initial SCTP support for the upcoming 1.6.5 release Michael Tuexen
2004-08-11 12:29 ` Michael Tuexen
2004-08-13 13:40   ` Marius Vollmer
2004-08-13 20:27     ` Michael Tuexen
2004-08-24 14:15       ` Marius Vollmer
2004-08-24 17:35         ` Michael Tuexen
2004-09-08 15:03           ` Marius Vollmer
2004-09-08 15:34             ` Michael Tuexen
2004-08-14  9:59     ` Michael Tuexen
2004-08-16  0:40       ` Kevin Ryde
2004-08-16 10:42         ` Michael Tuexen
2004-08-17 23:46           ` Kevin Ryde
2004-08-19 18:34             ` Michael Tuexen
2004-08-20  1:13               ` Kevin Ryde
2004-08-20  7:57                 ` Michael Tuexen
2004-08-16 17:02       ` Michael Tuexen
2004-08-16 18:44         ` Rob Browning
2004-08-20 18:18           ` Michael Tuexen
2004-08-23  0:58             ` Kevin Ryde
2004-08-23 19:54               ` Michael Tuexen
2004-08-24  0:57                 ` Kevin Ryde
2004-08-24 11:27                   ` Michael Tuexen
2004-08-24 12:46                     ` Michael Tuexen [this message]
2004-08-24 14:24                       ` Marius Vollmer
2004-08-24 18:22                         ` Michael Tuexen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95CA6528-F5CB-11D8-93F2-000D932C78D8@lurchi.franken.de \
    --to=michael.tuexen@lurchi.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).