17 |
|
#include "Sleep.hpp" |
18 |
|
#include "Zlib/GzipWriter.hpp" |
19 |
|
|
20 |
+ |
namespace |
21 |
+ |
{ |
22 |
+ |
|
23 |
+ |
static struct Apr |
24 |
+ |
{ |
25 |
+ |
Apr() |
26 |
+ |
{ |
27 |
+ |
api::Apr::CheckError(::apr_initialize()); |
28 |
+ |
} |
29 |
+ |
|
30 |
+ |
~Apr() |
31 |
+ |
{ |
32 |
+ |
::apr_terminate(); |
33 |
+ |
} |
34 |
+ |
} |
35 |
+ |
arp; |
36 |
+ |
|
37 |
+ |
} |
38 |
+ |
|
39 |
|
int Main(const app::Options &options) |
40 |
|
{ |
41 |
|
cse::String sitemap(_B("sitemap.gz")), base; |
75 |
|
|
76 |
|
GoogleTron::GoogleTron(const cse::String &sitemap, const cse::String &base, const _L<_R<Command> > &commands) : working(true), sitemap(sitemap), base(base), output(hop::BindAll(&GoogleTron::Output, this)) |
77 |
|
{ |
59 |
– |
api::Apr::CheckError(::apr_initialize()); |
60 |
– |
|
78 |
|
_foreach (const _L<_R<Command> >, command_, commands) |
79 |
|
if (_R<FileSystemCommand> command = dynamic_cast<FileSystemCommand *>(command_->GetValue())) |
80 |
|
threads.Add(hop::BindAll(&GoogleTron::FileSystem_, this, command)); |
91 |
|
working = false; |
92 |
|
|
93 |
|
output.Join(); |
77 |
– |
|
78 |
– |
::apr_terminate(); |
94 |
|
} |
95 |
|
|
96 |
|
int GoogleTron::Output() |