message sending

git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@1024 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
drotos 2007-01-25 12:38:42 +00:00 committed by Adam Visegradi
parent 924b9bac7f
commit f3e316ef5e
1 changed files with 29 additions and 0 deletions

View File

@ -25,6 +25,10 @@
#include <sys/types.h>
#include "local_master.h"
#include "local_common.h"
#include "local_utils.c"
#include "local_wu.h"
/********************************************************************
* Global variables
@ -40,6 +44,7 @@ int sleep_interval;
static GHashTable *wu_table;
/********************************************************************
* API functions
*/
@ -49,6 +54,8 @@ int DC_initMaster(const char *config_file)
char *cfgval;
int ret;
_DC_init_common();
if (!config_file)
config_file = DC_CONFIG_FILE;
@ -782,6 +789,28 @@ DC_deserializeWU(const char *buf)
}
/**************************************************************** Messaging */
/* Sends a message to a running work unit. */
int
DC_sendWUMessage(DC_Workunit *wu, const char *message)
{
GString *dn;
int ret;
/*if (!_DC_wu_check(wu))
return(DC_ERR_UNKNOWN_WU);*/
DC_log(LOG_DEBUG, "DC_sendWUMessage(%p-\"%s\", %s)",
wu, wu->name, message);
dn= g_string_new(wu->workdir);
g_string_append(dn, "/");
g_string_append(dn, _DC_wu_cfg(wu, cfg_master_message_box));
ret= _DC_create_message(dn->str, _DCAPI_MSG_MESSAGE, message, NULL);
g_string_free(dn, TRUE);
return(ret);
}
/* End of local/local_master.c */
/* Local variables: */