15 |
|
#include <fts.h> |
16 |
|
} |
17 |
|
|
18 |
< |
int main(int argc, char* argv[]) |
18 |
> |
#include <menes-api/exename.hpp> |
19 |
> |
#include <menes-app/simple.hpp> |
20 |
> |
|
21 |
> |
int Main(const app::Options& options) |
22 |
|
{ |
23 |
< |
FeepingCreaturism::program = argv[0]; |
23 |
> |
FeepingCreaturism::program = api::GetExecutablePath().GetName(); |
24 |
|
|
25 |
|
FeepingCreaturism creaturism; |
26 |
|
|
65 |
|
std::transform(one.begin(), one.end(), one_.begin(), ::tolower); |
66 |
|
std::transform(two.begin(), two.end(), two_.begin(), ::tolower); |
67 |
|
|
68 |
+ |
if (one_ == two_) return one < two; |
69 |
+ |
|
70 |
|
return one_ < two_; |
71 |
|
} |
72 |
|
|
78 |
|
this->path = *node/"jargon"; |
79 |
|
this->matcher = *node/"matcher"; |
80 |
|
|
81 |
< |
char* path[] = { new char[this->path.size()] }; |
81 |
> |
char* path[] = { new char[this->path.GetData().GetSize()] }; |
82 |
|
|
83 |
< |
std::strcpy(path[0], this->path.c_str()); |
83 |
> |
std::strcpy(path[0], this->path.NullTerminate()); |
84 |
|
|
85 |
|
::FTS* traversal(::fts_open(path, FTS_LOGICAL, NULL)); |
86 |
|
Matcher matcher("^" + this->path + "/(" + this->matcher + ")$"); |
176 |
|
{ |
177 |
|
api::Cout << "Content-Type: text/html; charset=UTF-8\r\n\r\n"; |
178 |
|
|
179 |
< |
_M::iterator include(cgi.find("include")); |
180 |
< |
|
181 |
< |
if (include != cgi.end()) |
182 |
< |
{ |
178 |
< |
Jargon jargon(path + "/" + selection, |
179 |
< |
lexical_cast<bool>(include->second)); |
180 |
< |
|
181 |
< |
api::Cout << jargon; |
182 |
< |
} |
183 |
< |
else |
184 |
< |
{ |
185 |
< |
Jargon jargon(path + "/" + selection); |
179 |
> |
Jargon jargon(path, selection, cgi.find("include") != cgi.end() |
180 |
> |
&& lexical_cast<bool>(ext::String(cgi.find("include")->second)), |
181 |
> |
cgi.find("relative") != cgi.end() |
182 |
> |
? ext::String(cgi.find("relative")->second) : ext::String()); |
183 |
|
|
184 |
< |
api::Cout << jargon; |
188 |
< |
} |
184 |
> |
api::Cout << jargon; |
185 |
|
} |
186 |
|
else |
187 |
|
{ |