- From: Henrik Frystyk Nielsen <frystyk@w3.org>
- Date: Wed, 14 Oct 1998 09:33:45 -0400
- 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"); >[...cut...] > > 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 -- Henrik Frystyk Nielsen, World Wide Web Consortium http://www.w3.org/People/Frystyk
Received on Wednesday, 14 October 1998 09:33:52 UTC