1 |
|
/* ============================================================================ |
2 |
|
* Douglas Thrift's Search Engine License |
3 |
|
* |
4 |
< |
* Copyright (C) 2002-2003, Douglas Thrift. All Rights Reserved. |
4 |
> |
* Copyright (C) 2002-2004, Douglas Thrift. All Rights Reserved. |
5 |
|
* Redistribution and use in source and binary forms, with or without |
6 |
|
* modification, are permitted provided that the following conditions are met: |
7 |
|
* |
46 |
|
// |
47 |
|
// Douglas Thrift |
48 |
|
// |
49 |
< |
// Search.cpp |
49 |
> |
// $Id$ |
50 |
|
|
51 |
< |
#include "Search.h" |
52 |
< |
#include "Indexer.h" |
53 |
< |
#include "Searcher.h" |
54 |
< |
#include "Outputer.h" |
51 |
> |
#include "Search.hpp" |
52 |
> |
#include "Indexer.hpp" |
53 |
> |
#include "Searcher.hpp" |
54 |
> |
#include "Outputer.hpp" |
55 |
|
|
56 |
|
#ifndef _WIN32 |
57 |
|
#include <sys/utsname.h> |
58 |
|
#else |
59 |
|
#include <windows.h> |
60 |
< |
#endif // _WIN32 |
60 |
> |
|
61 |
> |
// Stupid MinGW |
62 |
> |
#ifndef PROCESSOR_ARCHITECTURE_AMD64 |
63 |
> |
#define PROCESSOR_ARCHITECTURE_AMD64 9 |
64 |
> |
#endif |
65 |
> |
#ifndef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 |
66 |
> |
#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10 |
67 |
> |
#endif |
68 |
> |
|
69 |
> |
#endif |
70 |
|
|
71 |
|
string program; |
72 |
|
string programName = "Douglas Thrift's Search Engine"; |
73 |
< |
string programVersion = "1.1rc3"; |
73 |
> |
string programVersion = "1.3svn"; |
74 |
|
bool debug = false; |
75 |
|
|
76 |
|
int main(int argc, char* argv[]) |
118 |
|
{ |
119 |
|
if (++index < argc) |
120 |
|
{ |
121 |
< |
page = strtoul(argv[index],0,0); |
121 |
> |
istringstream number(argv[index]); |
122 |
> |
|
123 |
> |
number >> page; |
124 |
|
} |
125 |
|
else |
126 |
|
{ |
238 |
|
else if (arg == "-D") |
239 |
|
{ |
240 |
|
debug = true; |
241 |
+ |
cerr.setf(ios_base::boolalpha); |
242 |
|
} |
243 |
|
else |
244 |
|
{ |
445 |
|
void version() |
446 |
|
{ |
447 |
|
cout << programName << " " << programVersion << " "<< platform() << "\n\n" |
448 |
< |
<< " Copyright (C) 2002-2003, Douglas Thrift. All Rights Reserved.\n" |
448 |
> |
<< " Copyright (C) 2002-2004, Douglas Thrift. All Rights Reserved.\n" |
449 |
|
<< "\n" |
450 |
|
<< " This product includes software developed by Douglas Thrift\n" |
451 |
|
<< " (http://computers.douglasthrift.net/searchengine/).\n"; |
452 |
+ |
#ifdef _OpenSSL_ |
453 |
+ |
cout << "\n" << openssl() << " " << SSLeay_version(SSLEAY_BUILT_ON) << " " |
454 |
+ |
<< SSLeay_version(SSLEAY_PLATFORM) << "\n"; |
455 |
+ |
#endif |
456 |
|
} |
457 |
|
|
458 |
|
void license() |
459 |
|
{ |
460 |
|
cout << "License:\n" |
461 |
|
<< " Douglas Thrift's Search Engine License\n\n" |
462 |
< |
<< " Copyright (C) 2002-2003, Douglas Thrift. All Rights Reserved.\n" |
462 |
> |
<< " Copyright (C) 2002-2004, Douglas Thrift. All Rights Reserved.\n" |
463 |
|
<< "\n" |
464 |
|
<< " Redistribution and use in source and binary forms, with or with" |
465 |
|
<< "out\n" |