aboutsummaryrefslogtreecommitdiff
path: root/src/tool_metalink.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-06-21 00:51:06 +0900
committerYang Tse <yangsita@gmail.com>2012-06-21 03:35:23 +0200
commit196c8242caa30472564290f1c89e7e19d2f04453 (patch)
tree9771fcbcda3fe37e2d5c12a3c1f5f4ff645e29e7 /src/tool_metalink.h
parent424bb3587748eb59c0d56613e88ef4511ad4dcbf (diff)
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.
Diffstat (limited to 'src/tool_metalink.h')
-rw-r--r--src/tool_metalink.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tool_metalink.h b/src/tool_metalink.h
index 36b4b02c7..c2568a31e 100644
--- a/src/tool_metalink.h
+++ b/src/tool_metalink.h
@@ -82,13 +82,21 @@ extern const digest_params MD5_DIGEST_PARAMS[1];
extern const digest_params SHA1_DIGEST_PARAMS[1];
extern const digest_params SHA256_DIGEST_PARAMS[1];
+#include <metalink/metalink_parser.h>
+
/*
* Counts the resource in the metalinkfile.
*/
int count_next_metalink_resource(metalinkfile *mlfile);
void clean_metalink(struct Configurable *config);
-int parse_metalink(struct Configurable *config, const char *infile);
+int parse_metalink(struct Configurable *config, struct OutStruct *outs);
+
+/*
+ * Callback function for CURLOPT_WRITEFUNCTION
+ */
+size_t metalink_write_cb(void *buffer, size_t sz, size_t nmemb,
+ void *userdata);
/*
* Returns nonzero if content_type includes "application/metalink+xml"