diff --git a/dcapi/boinc/dc.c b/dcapi/boinc/dc.c index c2326e4f76..d371b21498 100644 --- a/dcapi/boinc/dc.c +++ b/dcapi/boinc/dc.c @@ -224,6 +224,22 @@ void DC_setMasterCb(DC_ResultCallback resultcb, _dc_messagecb = msgcb; } +void DC_setResultCb(DC_ResultCallback cb) +{ + _dc_resultcb = cb; +} + +void DC_setSubresultCb(DC_SubresultCallback cb) +{ + _dc_subresultcb = cb; +} + +void DC_setMessageCb(DC_MessageCallback cb) +{ + _dc_messagecb = cb; +} + + /******************************************************************** * XML file definition parser */ diff --git a/dcapi/doc/dc-sections.txt b/dcapi/doc/dc-sections.txt index 889d6080a6..1ae17e8770 100644 --- a/dcapi/doc/dc-sections.txt +++ b/dcapi/doc/dc-sections.txt @@ -58,7 +58,6 @@ DC_MasterEvent DC_ResultCallback DC_SubresultCallback DC_MessageCallback -DC_SuspendCallback DC_initMaster @@ -66,7 +65,6 @@ DC_setMasterCb DC_setMessageCb DC_setResultCb DC_setSubresultCb -DC_setSuspendCb DC_processMasterEvents diff --git a/dcapi/doc/tmpl/dc.sgml b/dcapi/doc/tmpl/dc.sgml index 83bbc6367e..6bf4087a2a 100644 --- a/dcapi/doc/tmpl/dc.sgml +++ b/dcapi/doc/tmpl/dc.sgml @@ -120,12 +120,41 @@ Sets the callback functions to be used for event reporting. One or more of the callbacks may be %NULL if the master does not wish to receive the specific event. + +This function is deprecated, use the separate DC_setMessageCb(), DC_setResultCb() +and DC_setSubresultCb() functions instead. + @resultcb: the callback to be used to report results. @subresultcb: the callback to be used to report subresults. @msgcb: the callback for reporting messages. + + +Sets the callback function that will be called when the master receives a +new message from one of the running workunits. + + +@cb: the callback to be used to report messages. + + + + +Sets the callback function that will be called when a workunit finishes. + + +@cb: the callback to be used to report results. + + + + +Sets the callback function that will be called when a subresult becomes available. + + +@cb: the callback to be used to report subresults. + + Processes work unit events. In case of a work unit completes and its result is diff --git a/dcapi/include/dc.h b/dcapi/include/dc.h index ffc1adcb53..7075a6c9b3 100644 --- a/dcapi/include/dc.h +++ b/dcapi/include/dc.h @@ -97,6 +97,11 @@ int DC_initMaster(const char *configFile); void DC_setMasterCb(DC_ResultCallback resultcb, DC_SubresultCallback subresultcb, DC_MessageCallback msgcb); +/* Set the callback functions for particular events */ +void DC_setResultCb(DC_ResultCallback cb); +void DC_setSubresultCb(DC_SubresultCallback cb); +void DC_setMessageCb(DC_MessageCallback cb); + /* Queries the number of WUs known to the API in the given state. */ int DC_getWUNumber(DC_WUState state);