W3C home > Mailing lists > Public > www-lib@w3.org > October to December 1998

Re: Trouble accessing Stream "methods"

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Wed, 14 Oct 1998 09:33:45 -0400
Message-Id: <>
To: "Michael Zedeler" <mike@netropolis.dk>, www-lib@w3.org
Cc: mike@netropolis.dk
At 12:31 10/14/98 -0000, Michael Zedeler wrote:
>Hi fellow libwww'ers,
>I have ventured deep into libwww-space -- so far without much trouble --
until now. I have been implementing my own pseudo-HTML-parser, using the
SGML-module, and now I need help accessing the "methods" of a Stream:

Yes, the stream model is based on "subclassing" as in C++ or originally Tim
Berners-Lee's NextStep based Object-C although in ANSI C, it is less elegant.

Streams like the SGML stream contains the "isa" field as in "is a [stream]"
which points to a structure defining the generic stream methods. In order
to call them, you must therefore dereference the pointer:

	(*hs->isa->put_string)(hs, "Hello, world\n");

>	HTStream * hs;
>	hs = SGML_new(&IHTML_dtd,HTTestStream());
>[Now this doesn't work:]
>	(hs->put_string)(hs,"Hello, world\n");
>[So I tried looking in the library and found that maybe this would work:]
>	(hs->isa->put_string)(hs,"Hello, world\n");

Henrik Frystyk Nielsen,
World Wide Web Consortium
Received on Wednesday, 14 October 1998 09:33:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:48 UTC