* Re: searching: example of C extension implementing port
@ 2006-03-07 22:23 Marco Maggi
0 siblings, 0 replies; 5+ messages in thread
From: Marco Maggi @ 2006-03-07 22:23 UTC (permalink / raw)
"user42@zip.com.au" wrote:
>You'll have seen the "Soft Ports" node in the manual,
>it's pretty straightforward.
Yes, it is straightforward with pure Scheme; but I have
to filter a stream of bytes (binary data not strings)
thru a C implemented algorithm.
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: searching: example of C extension implementing port
@ 2006-03-08 22:45 Marco Maggi
0 siblings, 0 replies; 5+ messages in thread
From: Marco Maggi @ 2006-03-08 22:45 UTC (permalink / raw)
>"Marco Maggi" <marco.maggi-ipsu@poste.it> writes:
>> If, dunno when, I come up with a simple example channel
>> implementation: is there an "official" place where I can
>> put it?
>I don't think so. Well, depends on what you mean by
>"official" I guess. ;-) And BTW, what do you mean
>by "channel"?
I come from TCL:
* in the TCL world it is known that the sample
extension is a module in the CVS repository of
the TCL core project at SourceForge; if one goes
to the TCL'ers Wiki and does a search he quickly
finds it;
* in the TCL world a channel is a generalisation
of Guile ports; not only it does I/O on file,
sockets and memory (strings), but channels can be
stacked to do compression, encryption, etc.
With TCL a channel is somewhat complex because: there
is also the event loop to take into account; so simpler
stacking is what I'm trying to do in a C only library and
I would like to build an interface for Guile.
If someone wants to take a look at what I've done so
far (it is only half written, it is tough to do reverse
engineering):
http://web.tiscali.it/marcomaggi/tmp/gee--alpha--0.1.tar.gz
--
Marco Maggi
"They say jump!, you say how high?"
Rage Against the Machine - "Bullet in the Head"
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* searching: example of C extension implementing port
@ 2006-03-06 21:43 Marco Maggi
2006-03-07 9:15 ` Ludovic Courtès
2006-03-07 20:55 ` Kevin Ryde
0 siblings, 2 replies; 5+ messages in thread
From: Marco Maggi @ 2006-03-06 21:43 UTC (permalink / raw)
Ciao,
is there a sample extension implementing an input/output
channel?
I'm thinking of a memory channel (not an interface
to a file or hardware port), something like the string
port; is the channel API of Guile worth learning for this,
or is it better to write something of my own?
I only need the open/close/read/write/end operations, no
events, no seek.
--
Marco Maggi
"They say jump!, you say how high?"
Rage Against the Machine - "Bullet in the Head"
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: searching: example of C extension implementing port
2006-03-06 21:43 Marco Maggi
@ 2006-03-07 9:15 ` Ludovic Courtès
2006-03-07 20:55 ` Kevin Ryde
1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2006-03-07 9:15 UTC (permalink / raw)
Cc: guile-user
Hi,
"Marco Maggi" <marco.maggi-ipsu@poste.it> writes:
> I'm thinking of a memory channel (not an interface
> to a file or hardware port), something like the string
> port; is the channel API of Guile worth learning for this,
> or is it better to write something of my own?
Perhaps you can look at the file ports or string ports in Guile itself
(fports.c and strports.c). Guile-gnome contains an example, too, but I
couldn't find it.
Hope this helps,
Ludovic.
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: searching: example of C extension implementing port
2006-03-06 21:43 Marco Maggi
2006-03-07 9:15 ` Ludovic Courtès
@ 2006-03-07 20:55 ` Kevin Ryde
1 sibling, 0 replies; 5+ messages in thread
From: Kevin Ryde @ 2006-03-07 20:55 UTC (permalink / raw)
Cc: guile-user
"Marco Maggi" <marco.maggi-ipsu@poste.it> writes:
>
> is there a sample extension implementing an input/output
> channel?
You'll have seen the "Soft Ports" node in the manual, it's pretty
straightforward.
> I'm thinking of a memory channel (not an interface
> to a file or hardware port), something like the string
> port; is the channel API of Guile worth learning for this,
If it's for a lot of bytes, then the scheme-level bits will be very
slow (read/write only 1 byte at a time) and you might have to break
out some C. (Getting that C level bits into scheme would be a good
thing one day.)
> or is it better to write something of my own?
For reading OLE file contents I did my own read func. But whether
that's good probably depends what and how much other code is going to
use the port.
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-03-08 22:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-07 22:23 searching: example of C extension implementing port Marco Maggi
-- strict thread matches above, loose matches on Subject: below --
2006-03-08 22:45 Marco Maggi
2006-03-06 21:43 Marco Maggi
2006-03-07 9:15 ` Ludovic Courtès
2006-03-07 20:55 ` Kevin Ryde
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).