From 4466efc025c41aede2bf33a0a5153963c4bf274d Mon Sep 17 00:00:00 2001 From: gombasg Date: Tue, 21 Mar 2006 13:55:16 +0000 Subject: [PATCH] Make the client code compile git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@378 a7169a2c-3604-0410-bc95-c702d8d87f7a --- dcapi/boinc/Makefile.am | 2 +- dcapi/boinc/client.c | 62 ++++++++++++++++++++--------------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/dcapi/boinc/Makefile.am b/dcapi/boinc/Makefile.am index af3b25714e..85ff3324bf 100644 --- a/dcapi/boinc/Makefile.am +++ b/dcapi/boinc/Makefile.am @@ -26,7 +26,7 @@ libdc_boinc_la_LIBADD = \ libdc_boinc_la_CPPFLAGS = $(AM_CPPFLAGS) $(BOINC_SERVER_CPPFLAGS) libdc_client_boinc_la_SOURCES = \ - dc_client.c + client.c libdc_client_boinc_la_LIBADD = \ $(BOINC_CLIENT_LIBS) libdc_client_boinc_la_CPPFLAGS = $(AM_CPPFLAGS) $(BOINC_CPPFLAGS) diff --git a/dcapi/boinc/client.c b/dcapi/boinc/client.c index cf8356d51e..11d79f5de8 100644 --- a/dcapi/boinc/client.c +++ b/dcapi/boinc/client.c @@ -2,6 +2,8 @@ #include #endif +#include + /* BOINC includes */ #ifdef _WIN32 #include @@ -16,60 +18,56 @@ int DC_init(void) { - int retval; - - retval = boinc_init_diagnostics(BOINC_DIAG_REDIRECTSTDERR); - if (retval) return retval; - retval = boinc_init(); - if (retval) return retval; - - return DC_OK; + if (boinc_init_diagnostics(BOINC_DIAG_REDIRECTSTDERR)) + return DC_ERR_INTERNAL; + if (boinc_init()) + return DC_ERR_INTERNAL; + return 0; } -int DC_resolveFileName(DC_Filetype type, const char *requestedFileName, char *actualFileName, int maxlength) +/* XXX Add handling for DC_CHECKPOINT_FILE */ +char *DC_resolveFileName(DC_Filetype type, const char *logicalFileName) { - int retval; + char buf[PATH_MAX]; - retval = boinc_resolve_filename(requestedFileName, actualFileName, maxlength); - if (retval) return retval; - - return DC_OK; + if (boinc_resolve_filename(logicalFileName, buf, sizeof(buf))) + return NULL; + return strdup(buf); } -int DC_sendResult(char **files, int nfiles) +int DC_sendResult(const char *logicalFileName, const char *path, + DC_FileMode fileMode) { - // not implemented yet!! - - return DC_OK; + return DC_ERR_NOTIMPL; } -int DC_timeToCheckpoint(void) +DC_Event DC_checkEvent(void **data) { - return boinc_time_to_checkpoint(); + if (boinc_time_to_checkpoint()) + return DC_EVENT_DO_CHECKPOINT; + return DC_EVENT_NONE; } -int DC_checkpointMade(void) +void DC_checkpointMade(const char *filename) { - return boinc_checkpoint_completed(); + boinc_checkpoint_completed(); } -int DC_continueWork(void) +void DC_fractionDone(double fraction) { - // not implemented yet!! - - return 1; // yes, continue work. -} - -int DC_fractionDone(double fraction) -{ - return boinc_fraction_done(fraction); + boinc_fraction_done(fraction); } void DC_finish(int exitcode) { - boinc_finish(exitcode); + boinc_finish(exitcode); } +/******************************************************************** + * Provide empty implementation for some functions required by the + * BOINC libraries + */ + void app_graphics_init(void) {} void app_graphics_resize(int width, int height){} void app_graphics_render(int xs, int ys, double time_of_day) {}