Re: converters/decoders to filter stuff out?

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 UTC