Skip to content

Commit

Permalink
Moving forward...
Browse files Browse the repository at this point in the history
  • Loading branch information
shashankkumar committed Apr 14, 2011
1 parent 5c71eb5 commit c928fb2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion FileHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class FileHandle{
char systemString[100], status[10], logs[10000], detailstatus[10000], str[100], *token, tmp[10], logString[100];
char timeused[10], memoryused[10], fileid[10], command[1000];
const char* lang, *ProblemId;
bool result;
string CompileOutput;
CurlWrapper FileCurl;
string ExecutionStr;
Expand All @@ -25,4 +24,6 @@ class FileHandle{
void pipeMatch();
void SendResults();
void CleanUp();
bool result;

};
24 changes: 24 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@ shashankkumar.me@gmail.com
****************************************************************************/
#include "includes.h"
#include "CurlWrapper.h"
#include "FileHandle.h"

void FileThread(int FileId, const char* ProblemId, int TimeLimit, int MemoryLimit, const char* lang){

FileHandle *F = new FileHandle(FileId, ProblemId, lang);
int TestCaseId; int ErrNo;

if(F->FetchFile()==-1) return;
if(F->MakeDir()==-1) return;

F->Compile();

if(F->result==true){
if(F->PrepareToExecute()==-1){
F->CleanUp();
return;
}
F->Execution();
}
F->SendResults();
//F->CleanUp();
delete F;
}


int main(){
Expand Down

0 comments on commit c928fb2

Please sign in to comment.