W3C home > Mailing lists > Public > www-lib@w3.org > July to September 1999

Re: I want you to help me about " libwww library "

From: Henrik Frystyk Nielsen <frystyk@microsoft.com>
Date: Sat, 18 Sep 1999 20:38:32 -0700
Message-ID: <005c01bf0250$755ea780$98661fac@redmond.corp.microsoft.com>
To: "Niran Angkawattanawit" <b39nia@anreg.cpe.ku.ac.th>
Cc: <www-lib@w3.org>

>           I'm sorry if you may not be understand purpose of this mail.
>       I am a student. I am studying in a University in Thailand.
>       I have used " libwww library " and have many problems with it.
>       The problems are how to implement the correct code.
>       I list them 2 problems which want your answers.
>
>       In example code ,showtext.c .
>
>       1. How do 'HText_registerTextCallback(addText)' works ?
>
>          I understand by myself that when there is a stream come ,
>          this function will check 'Text' . If it find 'Text', it will
>          call 'addText' to work. Am I right ?  If I am right, I will
have
>          a confuse understanding. Where is the HTML stream, which the
>          callback function checked, from?

The HTML stream is created automatically when data arrives and the MIME
parser finds out that the body is of type HTML. You can see how the stream
is set up in function pumpData in

    http://www.w3.org/Library/src/HTMIME.c

The stream stack builder function looks at the content type (text/html,
for example), and finds the appropriate stream. The callback handler is
called from

    http://www.w3.org/Library/src/HText.c

>       2. I want modify showtext.c . I want receive filename instead URI.
>          It's mean, I must open file then read data and store in my
>          buffer before. How do I continue ? If I want to use callback
>          function to check 'Text' in my buffer.

If you want to read a local file instead of a document with a HTTP URI
then you just feed a file URL to showtext and it should read the local
file instead, for example

    showtext file:/this/is/your/local/file.html

As far as I remember this should work.

>          I hope your answers make me more understand. I must modify this
>          code successfull before 28th September. Please reply me
quickly.
>
>
>                                             Thank you very much.
>
>                                                  Niran A.
>
>
>      P.S.   I'm not good in english. I apologize you ,if my english make
>             confusion.

Henrik
Received on Saturday, 18 September 1999 23:39:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:17 UTC