46 |
|
// |
47 |
|
// Douglas Thrift |
48 |
|
// |
49 |
< |
// Search.cpp |
49 |
> |
// $Id: Search.cpp,v 1.23 2003/08/08 03:38:49 douglas Exp $ |
50 |
|
|
51 |
|
#include "Search.h" |
52 |
|
#include "Indexer.h" |
57 |
|
#include <sys/utsname.h> |
58 |
|
#else |
59 |
|
#include <windows.h> |
60 |
< |
#endif // _WIN32 |
60 |
> |
#endif |
61 |
|
|
62 |
|
string program; |
63 |
|
string programName = "Douglas Thrift's Search Engine"; |
64 |
< |
string programVersion = "1.1rc2"; |
64 |
> |
string programVersion = "1.2beta"; |
65 |
|
bool debug = false; |
66 |
|
|
67 |
|
int main(int argc, char* argv[]) |
109 |
|
{ |
110 |
|
if (++index < argc) |
111 |
|
{ |
112 |
< |
page = strtoul(argv[index],0,0); |
112 |
> |
istringstream number(argv[index]); |
113 |
> |
|
114 |
> |
number >> page; |
115 |
|
} |
116 |
|
else |
117 |
|
{ |
229 |
|
else if (arg == "-D") |
230 |
|
{ |
231 |
|
debug = true; |
232 |
+ |
cerr.setf(ios_base::boolalpha); |
233 |
|
} |
234 |
|
else |
235 |
|
{ |
389 |
|
|
390 |
|
void usage() |
391 |
|
{ |
392 |
+ |
#ifdef _WIN32 |
393 |
+ |
OSVERSIONINFO* computer = new OSVERSIONINFO; |
394 |
+ |
computer->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); |
395 |
+ |
GetVersionEx(computer); |
396 |
+ |
|
397 |
+ |
string program = ::program; |
398 |
+ |
if (computer->dwPlatformId != VER_PLATFORM_WIN32_NT) |
399 |
+ |
{ |
400 |
+ |
program = "Search"; |
401 |
+ |
} |
402 |
+ |
|
403 |
+ |
delete computer; |
404 |
+ |
#endif // _WIN32 |
405 |
+ |
|
406 |
|
string tab(8 + program.length(), ' '); |
407 |
|
|
408 |
|
cout << "Usage: " << program << " [index ...] [-P page] [-h header] [-b bo" |
440 |
|
<< "\n" |
441 |
|
<< " This product includes software developed by Douglas Thrift\n" |
442 |
|
<< " (http://computers.douglasthrift.net/searchengine/).\n"; |
443 |
+ |
#ifdef _OpenSSL_ |
444 |
+ |
cout << "\n" << openssl() << " " << SSLeay_version(SSLEAY_BUILT_ON) << " " |
445 |
+ |
<< SSLeay_version(SSLEAY_PLATFORM) << "\n"; |
446 |
+ |
#endif |
447 |
|
} |
448 |
|
|
449 |
|
void license() |