Re: Help getting started with libwww

On Tue, 30 May 1995, Rainer Klute wrote:
> The problem with the documentation is that there is something at a
> very high level which gives you an overview of the Library, but
> when you want to dig further into it you are immediately on the
> lowest possible level: the source code. And some documentation
> useful for application programmers who are already familiar with
> the Library. The middle-level, the glue between overview and source
> code is completely missing. It should have simple examples and
> should not hide everything within complicated details as the line
> mode browser (W3C's example) does. Therefore you have to go The
> Hard Way.

That's a relief -- I was afraid it was just me :-)

I would also add that the documentation illustrates everything that is
wrong with hypertext as a medium. All these complicated new concepts are
defined by links to even more complicated new concepts. There is no
beginning and no end. It is all too easy to become lost, disoriented, and
terrified in there.  An introduction to a code library really needs to
start from the ground up, in a logical sequence, building on what has
already been said, i.e. like a book with a chapter 1, chapter 2, etc.
Heavy cross-linking works well for a reference section, once you already
know what is going on.

That said, I do appreciate the large amount of work that obviously went
into the docs, it just needs a sequential introduction/middle level added.

> >   I was able to define dummy stubs for the various HText_* functions
> >   to get my program to compile. Then instead of trying to replace the
> >   HTML module, I set up a request structure using WWW_HTML as the
> >   output format. Is there anything wrong with doing it this way? Do I
> >   really need to "overwrite", whatever that means?
>
> What you did was "overwriting" the predefined modules. However,
> this should really be done in an object-oriented manner!...

So specifically, there is no problem with using the WWW_HTML format? I had
the impression from the docs, that I might be causing the html stream to
be parsed down into html tokens, then glued back together into an html
stream, when what I really should do is somehow intercept the html stream
directly off the sgml parser, before the html parser gets it. That is what
I thought "overwriting the HTML module" would do, but I could not find a
clue as to how to do it.

> >2. I think I am missing something really obvious and basic about the
> >   way streams are supposed to work. What should be in the
> >   output_stream field of my request? I just want to get back a string
> >   full of HTML to drop into the HTML widget. I got it to sort of work
> >   by using pipe(), and passing in the write-end to HTWriter_new, then
> >   reading off the other end, but pipes really are not meant for use
> >   in a single process, and I think the program would block if more
> >   than 4096 bytes got written to the pipe before I could read it.

> Or
> you should setup a stream which receives the chunks and implements
> the interface to the widget. However, as long as the widget wants
> just a single string you'll to collect all the data before passing
> it on to the widget.

Setting up a stream to collect the chunks is what I do not understand how
to do in C, in a single process. Could you elaborate?

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
= Matthew M. Freedman                                                 =
= U. of Washington Information Systems       mattf@cac.washington.edu =
= 4545 15th Ave. NE; 3rd Floor               (206) 543-5593           =
= Seattle, WA  98105                                                  =
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Received on Tuesday, 30 May 1995 13:56:22 UTC