2006-02-16 15:30:10 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include <dc_client.h>
|
2006-04-07 14:18:11 +00:00
|
|
|
#include "common_defs.h"
|
2006-02-16 15:30:10 +00:00
|
|
|
|
|
|
|
static time_t ckpt_start;
|
|
|
|
static time_t ckpt_freq = 10; /* Checkpoint frequency in seconds */
|
|
|
|
|
|
|
|
int DC_init(void)
|
|
|
|
{
|
|
|
|
ckpt_start = time(NULL);
|
|
|
|
return DC_OK;
|
|
|
|
}
|
|
|
|
|
2006-04-07 14:18:11 +00:00
|
|
|
char *DC_resolveFileName(DC_Filetype type, const char *logicalFileName)
|
2006-02-16 15:30:10 +00:00
|
|
|
{
|
2006-04-07 14:18:11 +00:00
|
|
|
return (char *)logicalFileName;
|
|
|
|
}
|
|
|
|
|
|
|
|
int DC_sendResult(const char *logicalFileName, const char *path, DC_FileMode fileMode)
|
|
|
|
{
|
|
|
|
// not implemented yet!!
|
|
|
|
|
2006-02-16 15:30:10 +00:00
|
|
|
return DC_OK;
|
|
|
|
}
|
|
|
|
|
2006-04-07 14:18:11 +00:00
|
|
|
int DC_sendMessage(const char *message)
|
2006-02-16 15:30:10 +00:00
|
|
|
{
|
|
|
|
// not implemented yet!!
|
|
|
|
|
|
|
|
return DC_OK;
|
|
|
|
}
|
|
|
|
|
2006-04-07 14:18:11 +00:00
|
|
|
DC_Event DC_checkEvent(void **data)
|
|
|
|
{
|
|
|
|
// not impl.
|
|
|
|
|
|
|
|
return DC_EVENT_NONE;
|
|
|
|
}
|
|
|
|
|
2006-02-16 15:30:10 +00:00
|
|
|
int DC_timeToCheckpoint(void)
|
|
|
|
{
|
|
|
|
time_t current;
|
|
|
|
current = time(NULL);
|
|
|
|
if (current - ckpt_start > ckpt_freq)
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-04-07 14:18:11 +00:00
|
|
|
void DC_checkpointMade(const char *fileName)
|
2006-02-16 15:30:10 +00:00
|
|
|
{
|
|
|
|
ckpt_start = time(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
int DC_continueWork(void)
|
|
|
|
{
|
|
|
|
// not implemented yet!!
|
|
|
|
|
|
|
|
return 1; // yes, continue work.
|
|
|
|
}
|
|
|
|
|
2006-04-07 14:18:11 +00:00
|
|
|
void DC_fractionDone(double fraction)
|
2006-02-16 15:30:10 +00:00
|
|
|
{
|
2006-04-07 14:18:11 +00:00
|
|
|
|
2006-02-16 15:30:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DC_finish(int exitcode)
|
|
|
|
{
|
|
|
|
exit(exitcode);
|
|
|
|
}
|