gm2
[Top][All Lists]
Advanced

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

RE: [Gm2] iso streams


From: Martin Kalbfuß
Subject: RE: [Gm2] iso streams
Date: Sat, 05 Jun 2010 00:32:31 +0200

Many thanks,

That helps a lot. I wonder, that there's no default implementation of
such a stream.

I had a look at your code. I've seen, that you did a cast

 p := SYSTEM.CAST(IOLink.DeviceTablePtr, cid);

Is this standard conform? There is a function to get the table.

PROCEDURE DeviceTablePtrValue *(cid: IOChan.ChanId; did: DeviceId;
                               x: DevExceptionRange; s:  ARRAY OF CHAR): 
DeviceTablePtr;

But I'm unsure about the third and fourth parameter. What's their
purpose?

Am Freitag, den 04.06.2010, 17:12 -0400 schrieb Breeden, Thomas (tmb):
> > -----Original Message-----
> > From: address@hidden [mailto:gm2-
> > address@hidden On Behalf Of Martin Kalbfuß
> > Sent: June 04, 2010 3:12 PM
> > To: GNU Modula-2
> > Subject: [Gm2] iso streams
> > 
> > Hi,
> > 
> > I try to understand the streams of ISO Modula-2. And I'm a bit confused.
> > Maybe someone can help me a bit? That would be kind.
> > 
> > I try to understand how to create temporary memory only stream. I don't
> > want to write to a mass storage.
> > But how?
> > 
> > I found the IOLink module. There you can create a unique stream. Fine.
> > But how to proceed? If I now try to write to the stream, an exception is
> > thrown telling me that the stream isn't prepared.
> > 
> > It would be nice if someone could give me a short explanation about the
> > different stream types, too.
> > 
> > Many thanks,
> > Martin
> > 
> 
> Hi,
> 
> I put together a stream for writing text to memory a while ago
> 
> see this web page for download: 
> 
> User Device for ISO Std Channel I/O to Memory
> http://www.modula2.org/projects/tbchans.php
> 
> It gives a text stream (IOChan) which I named "TBChan" because I layered
> it on top of a TextBlocks module I already had.
> 
> I was working pretty much in the dark, but followed the pattern of the source
> code in SeqFile and Terminal. I've forgotten, but looking at the code it
> is a matter of 
>    > using IOLink to AllocateDevice in your stream handler module 
> initialization code
>    > implementing the usual Open() and Close() procs for export
>    > implementing the specific procs for callback from TextIO - Skip(), Look()
>      TextRead(), TextWrite() etc.
>    > using IOLinks to MakeChan() for the ChanId structure, and filling the 
> proc fields
>      with your callbacks.
> 
> TBChans is not high on the efficiency scale, but if you want to use it let me 
> know, and I'll
> check to see if I have any bugfixes since that was posted on www.modula2.org.
> 
> regards,
> 
> Tom
> 
> Tom Breeden
> address@hidden
> 
> 
> _______________________________________________
> gm2 mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/gm2





reply via email to

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