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

libwww AND NT, getting a html-doc into memory-buffer

From: Martin Ostrowski <mostrowski@marlowe.iosys.de>
Date: Wed, 23 Oct 1996 13:22:10 -0000
Message-Id: <01BBC0E5.34FE85C0@matahari.iosys.de>
To: "'www-lib@w3.org'" <www-lib@w3.org>
I've coded this small routine ;-), to load a document from the www in the memory-buffer (to parse it later...), but it does'nt work !

#include "WWWLib.h"
#include "WWWInit.h"
#include "WWWHTTP.h"

/*
**	...try to load a html-doc in the memory-buffer
*/
int main (int argc, char ** argv)
{
    HTRequest * request;
	HTChunk * chunk = NULL;
	HTEventInit();
    HTProfile_newPreemptiveClient("Test", "0.1");
    request = HTRequest_new();
	
    if (argc == 2) {
	char * url = argv[1];
	
	if (url && *url)
	    chunk = HTLoadToChunk(url, request);
        if (chunk) {    <- chunk is NULL !    
	    char * string = HTChunk_toCString(chunk);
	    printf("Content = %s\n", string);
	    HT_FREE(string);
	}
	else
	    printf("Falsche Parameter !\n");
    } 
    HTRequest_delete(request);			/* Löscht das request object */
    HTProfile_delete();
    return 0;
}

Please let me know if/when/how someone resolve a Problem like this.


Thanks

Martin


--------------------------------------------------------------------------------------------------------
Martin Ostrowski 

ioSYS GmbH                                              www.iosys.de
Im Bonsiepen 6                                           www.kolibri.de
45136 Essen
Received on Wednesday, 23 October 1996 07:12:08 GMT

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