00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <SourceOrDerived.H>
00030 #include <BitVector.H>
00031 #include "WeederConfig.H"
00032 #include "RootTbl.H"
00033
00034 using std::ifstream;
00035 using std::cout;
00036 using std::endl;
00037 using std::hex;
00038 using std::dec;
00039
00040 int main() {
00041 time_t startTime, keepTime;
00042 ShortId disShortId;
00043 BitVector *weeded;
00044 RootTbl *roots;
00045
00046
00047 ifstream ifs;
00048 try {
00049 try {
00050 FS::OpenReadOnly(Config_WeededFile, ifs);
00051 weeded = NEW_CONSTR(BitVector, (ifs));
00052 FS::Close(ifs);
00053 }
00054 catch (FS::DoesNotExist) {
00055 weeded = NEW(BitVector);
00056 }
00057
00058 try {
00059 FS::OpenReadOnly(Config_MiscVarsFile, ifs);
00060 FS::Read(ifs, (char *)(&(startTime)), sizeof(startTime));
00061 FS::Read(ifs, (char *)(&(keepTime)), sizeof(keepTime));
00062 FS::Read(ifs, (char *)(&(disShortId)), sizeof(disShortId));
00063 roots = NEW_CONSTR(RootTbl, (ifs));
00064 FS::Close(ifs);
00065 }
00066 catch (FS::DoesNotExist) {
00067 startTime = -1;
00068 keepTime = -1;
00069 disShortId = 0;
00070 roots = NEW(RootTbl);
00071 }
00072 }
00073 catch (FS::EndOfFile) {
00074
00075 assert(false);
00076 }
00077
00078
00079 cout << "*** Start Time ***" << endl;
00080 cout << " startTime = ";
00081 if(startTime != -1)
00082 {
00083
00084
00085 cout << ctime(&startTime)
00086 << " (" << startTime << ")";
00087 }
00088 else
00089 {
00090 cout << startTime;
00091 }
00092 cout << endl;
00093 cout << " keepTime = ";
00094 if(keepTime != -1)
00095 {
00096 cout << ctime(&keepTime)
00097 << " (" << keepTime << ")";
00098 }
00099 else
00100 {
00101 cout << keepTime;
00102 }
00103 cout << endl << endl;
00104 cout << "*** ShortId of DIs file ***" << endl;
00105 cout << " disShortId = 0x" << hex << disShortId << dec << endl << endl;
00106 cout << "*** Table of GraphLog Roots to keep ***" << endl;
00107 cout << " Size = " << roots->Size() << endl;
00108 if (roots->Size() > 0) {
00109 cout << " Content = " << endl;
00110 roots->Print(cout, 4,
00111 "[explicit]", "[fresh]");
00112 }
00113 cout << endl;
00114 cout << "*** Weeded set ***" << endl;
00115 int card = weeded->Cardinality();
00116 cout << " Size = " << card << endl;
00117 if (card > 0) {
00118 cout << " Content =" << endl;
00119 weeded->PrintAll(cout, 4, 76);
00120 cout << endl;
00121 }
00122 }