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

Re: converters/decoders to filter stuff out?

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Tue, 14 Jul 1998 18:43:55 -0400
Message-Id: <3.0.5.32.19980714184355.0332a2a0@localhost>
To: fil@cs.ucsd.edu (Filippo Menczer), www-lib@w3.org
Cc: fil@cs.ucsd.edu
At 21:23 7/12/98 -0700, Filippo Menczer wrote:
>Suppose I want to accept only html documents and register the
>following global converters:
>
>   HTConversion_add(converters, "text/x-http", "*/*",
>      HTMIMEConvert, 1.0, 0.0, 0.0);
>   HTConversion_add(converters, "text/html", "www/present",
>      HTThroughLine, 1.0, 0.0, 0.0);
...
>How do I avoid this? I want the library to just throw away the
>result if it is in ANY format other that the accepted one(s), without
>asking anything!

You can do several things:

1) You can put the libwww into non-interactive mode by calling

	HTAlert_setInteractive(NO);

2) You can unregister the file name prompt handler. These handlers are
normally registered by the profiles when calling the HTAlert_init()
function. You can unregister the handler for the op-code HT_A_PROMPT by
doing something like

	HTAlert_deleteOpcode(HT_A_PROMPT);

3) You should also be able to register a blackhole stream which does
exactly what the name says - it swallows data:

   HTConversion_add(c, "*/*", "www/present", HTBlackHoleConverter, 0.3,
0.0, 0.0);

but that will not take care of the encoding prompts.

Henrik
--
Henrik Frystyk Nielsen,
World Wide Web Consortium
http://www.w3.org/People/Frystyk
Received on Tuesday, 14 July 1998 18:43:52 GMT

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