46 |
|
// |
47 |
|
// Douglas Thrift |
48 |
|
// |
49 |
< |
// $Id: Search.cpp,v 1.16 2003/07/11 07:54:47 douglas Exp $ |
49 |
> |
// $Id: Search.cpp,v 1.17 2003/07/15 07:22:06 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 |
> |
#ifdef _OpenSSL_ |
63 |
> |
#include <openssl/crypto.h> |
64 |
> |
|
65 |
> |
inline string openssl(bool agent = false) |
66 |
> |
{ |
67 |
> |
ostringstream openssl; |
68 |
> |
|
69 |
> |
openssl << "OpenSSL" << (agent ? "/" : " "); |
70 |
> |
|
71 |
> |
long version = SSLeay(); |
72 |
> |
long major = version / 0x10000000; |
73 |
> |
long minor = (version % 0x10000000) / 0x100000; |
74 |
> |
long fix = (version % 0x100000) / 0x1000; |
75 |
> |
long patch = (version % 0x1000); |
76 |
> |
|
77 |
> |
openssl << major << "." << minor << "." << fix; |
78 |
> |
|
79 |
> |
if (patch == 0x0) |
80 |
> |
{ |
81 |
> |
openssl << "-dev"; |
82 |
> |
} |
83 |
> |
else if (patch >= 0x1 && patch <= 0xe) |
84 |
> |
{ |
85 |
> |
openssl << "-beta" << patch; |
86 |
> |
} |
87 |
> |
else if (patch == 0xf) |
88 |
> |
{ |
89 |
> |
// release |
90 |
> |
} |
91 |
> |
else if (patch > 0xf) |
92 |
> |
{ |
93 |
> |
openssl << char('a' - 1 + (patch / 0x10) % 26); |
94 |
> |
} |
95 |
> |
|
96 |
> |
openssl << " " << SSLeay_version(SSLEAY_PLATFORM); |
97 |
> |
|
98 |
> |
return openssl.str(); |
99 |
> |
} |
100 |
> |
#endif |
101 |
|
|
102 |
|
string program; |
103 |
|
string programName = "Douglas Thrift's Search Engine"; |
478 |
|
<< "\n" |
479 |
|
<< " This product includes software developed by Douglas Thrift\n" |
480 |
|
<< " (http://computers.douglasthrift.net/searchengine/).\n"; |
481 |
+ |
#ifdef _OpenSSL_ |
482 |
+ |
cout << "\n" << openssl() << "\n"; |
483 |
+ |
#endif |
484 |
|
} |
485 |
|
|
486 |
|
void license() |