~ubuntu-branches/ubuntu/quantal/aria2/quantal

« back to all changes in this revision

Viewing changes to src/main.cc

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry
  • Date: 2010-11-24 12:26:31 UTC
  • mfrom: (1.6.1 upstream) (2.3.8 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124122631-upujekj1ek94h3x2
Tags: 1.10.6-1
* New upstream release:
  + Fixed FTBFS on alpha arch (Closes: #590257)
  + Added IPv6 support (Closes: #448390)
* debian/patches/ftbfs_kfreebsd.diff:
  + Dropped, merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
}
110
110
 
111
111
#ifdef ENABLE_BITTORRENT
112
 
static void showTorrentFile(const std::string& uri)
 
112
namespace {
 
113
void showTorrentFile(const std::string& uri)
113
114
{
114
115
  SharedHandle<DownloadContext> dctx(new DownloadContext());
115
116
  bittorrent::load(uri, dctx);
116
117
  bittorrent::print(std::cout, dctx);
117
118
}
 
119
} // namespace
118
120
#endif // ENABLE_BITTORRENT
119
121
 
120
122
#ifdef ENABLE_METALINK
121
 
static void showMetalinkFile
 
123
namespace {
 
124
void showMetalinkFile
122
125
(const std::string& uri, const SharedHandle<Option>& op)
123
126
{
124
127
  std::vector<SharedHandle<MetalinkEntry> > metalinkEntries;
128
131
  util::toStream(fileEntries.begin(), fileEntries.end(), std::cout);
129
132
  std::cout << std::endl;
130
133
}
 
134
} // namespace
131
135
#endif // ENABLE_METALINK
132
136
 
133
137
#if defined ENABLE_BITTORRENT || defined ENABLE_METALINK
134
 
static void showFiles
 
138
namespace {
 
139
void showFiles
135
140
(const std::vector<std::string>& uris, const SharedHandle<Option>& op)
136
141
{
137
142
  ProtocolDetector dt;
160
165
    }
161
166
  }
162
167
}
 
168
} // namespace
163
169
#endif // ENABLE_BITTORRENT || ENABLE_METALINK
164
170
 
165
171
extern void option_processing(Option& option, std::vector<std::string>& uris,
215
221
  std::vector<SharedHandle<RequestGroup> > requestGroups;
216
222
#ifdef ENABLE_BITTORRENT
217
223
  if(!op->blank(PREF_TORRENT_FILE)) {
218
 
    if(op->get(PREF_SHOW_FILES) == V_TRUE) {
 
224
    if(op->get(PREF_SHOW_FILES) == A2_V_TRUE) {
219
225
      showTorrentFile(op->get(PREF_TORRENT_FILE));
220
226
      return exitStatus;
221
227
    } else {
226
232
#endif // ENABLE_BITTORRENT
227
233
#ifdef ENABLE_METALINK
228
234
    if(!op->blank(PREF_METALINK_FILE)) {
229
 
      if(op->get(PREF_SHOW_FILES) == V_TRUE) {
 
235
      if(op->get(PREF_SHOW_FILES) == A2_V_TRUE) {
230
236
        showMetalinkFile(op->get(PREF_METALINK_FILE), op);
231
237
        return exitStatus;
232
238
      } else {
238
244
      if(!op->blank(PREF_INPUT_FILE)) {
239
245
        createRequestGroupForUriList(requestGroups, op);
240
246
#if defined ENABLE_BITTORRENT || defined ENABLE_METALINK
241
 
      } else if(op->get(PREF_SHOW_FILES) == V_TRUE) {
 
247
      } else if(op->get(PREF_SHOW_FILES) == A2_V_TRUE) {
242
248
        showFiles(args, op);
243
249
        return exitStatus;
244
250
#endif // ENABLE_METALINK || ENABLE_METALINK