W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1996

Using HTTee stream.

From: Giacomo Fiorentini <fiorenti@cli.di.unipi.it>
Date: Fri, 8 Mar 96 00:04:37 +0100
Message-Id: <9603072304.AA09380@cirano.cpr.it>
To: www-lib@w3.org
Hi,
        I want to know how I can set up the right output stream for a
request, that just save and parse one URL.
        I want to use the HTTee stream to perform this tasks :
        - the first stream must save the hardcoded URL to a file
        - the second stream must parse (HTML) URL's content to perform other
tasks, using HText interface.

    stream                                  HTTee       stream 1
======>=========stream from network=====>=======*=========>========save locally
                                                |
                                                |       stream 2
                                                |=========>========HTML parsing

--------------------------------------------------------------------------------
For example : 
... declaration ( global, local, HText ecc.. ) .....
FILE * fp ;
HTRequest * request = NULL;
HTList * conv = NULL ;    
conv = HTList_new () ;
HTLibInit (....,.... );
HTProtocol_add ( ....... ) ;
.... other statements .....
fp = fopen ( "dummy","w"); /* no check for semplicity */
request = HTRequest_new () ;
HTRequest_setMethod ( request, METHOD_GET ) ;
/* !!!!!!!!!!!!!!!! */
HTRequest_setOutputStream ( request, 
                            HTTee ( HTFWriter_new ( request, fp, NO ) /* is
this right ?? */ ,
                                    /* ??????? and here ???? */ ,
                                    NULL 
                                  )
                          )
.... ecc..... 
HTLibTerminate () ;
-------------------------------------------------------------------------------

Can you help me ? 

Thanks.

PS:  I'm using the library version 4.0D.

          
----------------------------------------------------------------------------
--------
     Giacomo Fiorentini
/\
     Pisa University
/00\
     fiorenti@cli.di.unipi.it
\gf/
     +39 050-544560
\/
----------------------------------------------------------------------------
--------
Received on Thursday, 7 March 1996 18:02:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:26 GMT