mirror of https://github.com/aria2/aria2
2008-12-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added ifdef clause for conditional compilation. * src/main.ccpull/1/head
parent
7cc3023188
commit
f07b0cbec5
|
@ -1,3 +1,8 @@
|
||||||
|
2008-12-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Added ifdef clause for conditional compilation.
|
||||||
|
* src/main.cc
|
||||||
|
|
||||||
2008-12-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2008-12-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Updated Russian, Simplified Chinese, Ukrainian and Japanese
|
Updated Russian, Simplified Chinese, Ukrainian and Japanese
|
||||||
|
|
18
src/main.cc
18
src/main.cc
|
@ -103,13 +103,16 @@ std::ostream& getSummaryOut(const Option* op)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_BITTORRENT
|
||||||
static void showTorrentFile(const std::string& uri)
|
static void showTorrentFile(const std::string& uri)
|
||||||
{
|
{
|
||||||
SharedHandle<DefaultBtContext> btContext(new DefaultBtContext());
|
SharedHandle<DefaultBtContext> btContext(new DefaultBtContext());
|
||||||
btContext->load(uri);
|
btContext->load(uri);
|
||||||
std::cout << btContext << std::endl;
|
std::cout << btContext << std::endl;
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_BITTORRENT
|
||||||
|
|
||||||
|
#ifdef ENABLE_METALINK
|
||||||
static void showMetalinkFile(const std::string& uri, const Option* op)
|
static void showMetalinkFile(const std::string& uri, const Option* op)
|
||||||
{
|
{
|
||||||
std::deque<SharedHandle<MetalinkEntry> > metalinkEntries;
|
std::deque<SharedHandle<MetalinkEntry> > metalinkEntries;
|
||||||
|
@ -119,7 +122,9 @@ static void showMetalinkFile(const std::string& uri, const Option* op)
|
||||||
Util::toStream(std::cout, fileEntries);
|
Util::toStream(std::cout, fileEntries);
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_METALINK
|
||||||
|
|
||||||
|
#if defined ENABLE_BITTORRENT || defined ENABLE_METALINK
|
||||||
static void showFiles(const std::deque<std::string>& uris, const Option* op)
|
static void showFiles(const std::deque<std::string>& uris, const Option* op)
|
||||||
{
|
{
|
||||||
ProtocolDetector dt;
|
ProtocolDetector dt;
|
||||||
|
@ -129,11 +134,17 @@ static void showFiles(const std::deque<std::string>& uris, const Option* op)
|
||||||
printf(MSG_SHOW_FILES, (*i).c_str());
|
printf(MSG_SHOW_FILES, (*i).c_str());
|
||||||
printf("\n");
|
printf("\n");
|
||||||
try {
|
try {
|
||||||
|
#ifdef ENABLE_BITTORRENT
|
||||||
if(dt.guessTorrentFile(*i)) {
|
if(dt.guessTorrentFile(*i)) {
|
||||||
showTorrentFile(*i);
|
showTorrentFile(*i);
|
||||||
} else if(dt.guessMetalinkFile(*i)) {
|
} else
|
||||||
|
#endif // ENABLE_BITTORRENT
|
||||||
|
#ifdef ENABLE_METALINK
|
||||||
|
if(dt.guessMetalinkFile(*i)) {
|
||||||
showMetalinkFile(*i, op);
|
showMetalinkFile(*i, op);
|
||||||
} else {
|
} else
|
||||||
|
#endif // ENABLE_METALINK
|
||||||
|
{
|
||||||
printf(MSG_NOT_TORRENT_METALINK);
|
printf(MSG_NOT_TORRENT_METALINK);
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
|
@ -142,6 +153,7 @@ static void showFiles(const std::deque<std::string>& uris, const Option* op)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_BITTORRENT || ENABLE_METALINK
|
||||||
|
|
||||||
extern Option* option_processing(int argc, char* const argv[]);
|
extern Option* option_processing(int argc, char* const argv[]);
|
||||||
|
|
||||||
|
@ -205,8 +217,10 @@ int main(int argc, char* argv[])
|
||||||
#endif // ENABLE_METALINK
|
#endif // ENABLE_METALINK
|
||||||
if(!op->blank(PREF_INPUT_FILE)) {
|
if(!op->blank(PREF_INPUT_FILE)) {
|
||||||
createRequestGroupForUriList(requestGroups, op);
|
createRequestGroupForUriList(requestGroups, op);
|
||||||
|
#if defined ENABLE_BITTORRENT || defined ENABLE_METALINK
|
||||||
} else if(op->get(PREF_SHOW_FILES) == V_TRUE) {
|
} else if(op->get(PREF_SHOW_FILES) == V_TRUE) {
|
||||||
showFiles(args, op);
|
showFiles(args, op);
|
||||||
|
#endif // ENABLE_METALINK || ENABLE_METALINK
|
||||||
} else {
|
} else {
|
||||||
createRequestGroupForUri(requestGroups, op, args);
|
createRequestGroupForUri(requestGroups, op, args);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue