Skip to content
Snippets Groups Projects
Commit 9f418e16 authored by jdh8d's avatar jdh8d
Browse files

Former-commit-id: 80b2b18726bfa93f2a7f31ffa4eb0d612a40ccc3
parent 95f3eda3
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ src/drivers/Makefile.in -text
src/drivers/idapro/Makefile.in -text
src/drivers/idapro/SMPStaticAnalyzer.cpp -text
src/drivers/irdb/Makefile.in -text
src/drivers/irdb/stars_driver.cpp -text
src/interfaces/Makefile.in -text
src/interfaces/abstract/Makefile.in -text
src/interfaces/abstract/STARSInstruction.cpp -text
......
#include <stdlib.h>
#include <fstream>
#include <libIRDB-core.hpp>
#include <libgen.h>
using namespace std;
using namespace libIRDB;
#include "interfaces/abstract/STARSInterface.h"
#include "interfaces/irdb/STARSInterface.h"
STARS_Interface_t* global_stars_interface = NULL;
STARS_Program_t *global_STARS_program = NULL;
void usage(char* name)
{
cerr<<"Usage: "<<name<<" <variant_id>\n";
}
int main(int argc, char **argv)
{
if(argc != 2)
{
usage(argv[0]);
exit(1);
}
string programName(argv[0]);
int variantID = atoi(argv[1]);
VariantID_t *pidp=NULL;
/* setup the interface to the sql server */
pqxxDB_t pqxx_interface;
BaseObj_t::SetInterface(&pqxx_interface);
pidp=new VariantID_t(variantID);
assert(pidp->IsRegistered()==true);
cout<<argv[0]<<" started\n";
for(set<File_t*>::iterator it=pidp->GetFiles().begin();
it!=pidp->GetFiles().end();
++it)
{
File_t* this_file = *it;
FileIR_t *firp = new FileIR_t(*pidp, this_file);
cout<<"Transforming "<<this_file->GetURL()<<endl;
assert(firp && pidp);
try
{
int success=true;
// run stars
global_stars_interface = new STARS_IRDB_Interface_t(firp);
//firp->WriteToDB();
delete firp;
}
catch (DatabaseError_t pnide)
{
cerr << programName << ": Unexpected database error: " << pnide << "file url: " << this_file->GetURL() << endl;
}
catch (...)
{
cerr << programName << ": Unexpected error file url: " << this_file->GetURL() << endl;
}
} // end file iterator
//cout<<"Commiting changes...\n";
//pqxx_interface.Commit();
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment