From 196c8242caa30472564290f1c89e7e19d2f04453 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 21 Jun 2012 00:51:06 +0900 Subject: curl: Made --metalink option toggle Metalink functionality In this change, --metalink option no longer takes argument. If it is specified, given URIs are processed as Metalink XML file. If given URIs are remote (e.g., http URI), curl downloads it first. Regardless URI is local file (e.g., file URI scheme) or remote, Metalink XML file is not written to local file system and the received data is fed into Metalink XML parser directly. This means with --metalink option, filename related options like -O and -o are ignored. Usage examples: $ curl --metalink http://example.org/foo.metalink This will download foo.metalink and parse it and then download the URI described there. $ curl --metalink file://foo.metalink This will parse local file foo.metalink and then download the URI described there. --- src/tool_sdecls.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/tool_sdecls.h') diff --git a/src/tool_sdecls.h b/src/tool_sdecls.h index da6253604..8038ad7a3 100644 --- a/src/tool_sdecls.h +++ b/src/tool_sdecls.h @@ -22,7 +22,9 @@ * ***************************************************************************/ #include "tool_setup.h" - +#ifdef USE_METALINK +# include +#endif /* USE_METALINK */ /* * OutStruct variables keep track of information relative to curl's @@ -55,6 +57,9 @@ * * 'init' member holds original file size or offset at which truncation is * taking place. Always zero unless appending to a non-empty regular file. + * + * 'metalink_parser' member is a pointer to Metalink XML parser + * context. */ struct OutStruct { @@ -67,6 +72,9 @@ struct OutStruct { struct Configurable *config; curl_off_t bytes; curl_off_t init; +#ifdef USE_METALINK + metalink_parser_context_t *metalink_parser; +#endif /* USE_METALINK */ }; -- cgit v1.2.3