From a839efce51f553322f74dda9a333d05769973e84 Mon Sep 17 00:00:00 2001 From: drotos Date: Thu, 25 Jan 2007 09:05:21 +0000 Subject: [PATCH] use better file names git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@1009 a7169a2c-3604-0410-bc95-c702d8d87f7a --- dcapi/local/Makefile.am | 23 +++-- dcapi/local/dc.c | 105 ----------------------- dcapi/local/{client.c => local_client.c} | 0 dcapi/local/{events.c => local_events.c} | 0 dcapi/local/{rm.c => local_master.c} | 95 ++++++++++++++++++++ dcapi/local/{result.c => local_result.c} | 0 6 files changed, 113 insertions(+), 110 deletions(-) delete mode 100644 dcapi/local/dc.c rename dcapi/local/{client.c => local_client.c} (100%) rename dcapi/local/{events.c => local_events.c} (100%) rename dcapi/local/{rm.c => local_master.c} (87%) rename dcapi/local/{result.c => local_result.c} (100%) diff --git a/dcapi/local/Makefile.am b/dcapi/local/Makefile.am index a2d5eee43d..ed98b6cd83 100644 --- a/dcapi/local/Makefile.am +++ b/dcapi/local/Makefile.am @@ -16,11 +16,24 @@ AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) noinst_HEADERS = common_defs.h dc_local.h libdc_local_la_SOURCES = \ - dc.c \ - rm.c \ - events.c \ - result.c + local_master.c \ + local_events.c \ + local_result.c libdc_local_la_LIBADD = ../common/libdc-common-master.la $(GLIB_LIBS) -libdc_client_local_la_SOURCES = client.c +libdc_client_local_la_SOURCES = local_client.c libdc_client_local_la_LIBADD = ../common/libdc-common-client.la + +#appdir = $(libdir)/dcapi/local +#app_PROGRAMS = lss lm + +#lss_SOURCES = ../condor/tss.c ../condor/tc.c +#lss_LDADD = ../common/libdc-common-client.la libdc-client-local.la + +#lm_SOURCES = ../condor/tm.c ../condor/tc.c +#lm_LDADD = ../common/libdc-common-master.la libdc-local.la -L. -ldl -luuid -lstdc++ + +#dd: all install_local + +#install_local: +# ssh root@emma 'make -C /home/staff/drdani/prj/szdg/dcapi/trunk/local install' diff --git a/dcapi/local/dc.c b/dcapi/local/dc.c deleted file mode 100644 index 00bc29ac93..0000000000 --- a/dcapi/local/dc.c +++ /dev/null @@ -1,105 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include - -#include "dc_local.h" - -/******************************************************************** - * Global variables - */ - -DC_ResultCallback _dc_resultcb; -DC_SubresultCallback _dc_subresultcb; -DC_MessageCallback _dc_messagecb; - -char project_uuid_str[37]; -uuid_t project_uuid; -int sleep_interval; - -/******************************************************************** - * API functions - */ - -int DC_initMaster(const char *config_file) -{ - char *cfgval; - int ret; - - if (!config_file) - config_file = DC_CONFIG_FILE; - - ret = _DC_parseCfg(config_file); - if (ret) - { - DC_log(LOG_ERR, "The DC-API cannot be initialized without a " - "config file"); - return ret; - } - - /* Check the working directory */ - cfgval = DC_getCfgStr(CFG_WORKDIR); - if (!cfgval) - { - DC_log(LOG_ERR, "%s is not specified in the config file", - CFG_WORKDIR); - return DC_ERR_CONFIG; - } - free(cfgval); - - /* Check sleep interval */ - sleep_interval = DC_getCfgInt(CFG_SLEEPINTERVAL, DEFAULT_SLEEP_INTERVAL); - if (sleep_interval < 1) - sleep_interval = 1; - - /* Check the project UUID */ - cfgval = DC_getCfgStr(CFG_INSTANCEUUID); - if (!cfgval) - { - DC_log(LOG_ERR, "%s is not set in the config file", - CFG_INSTANCEUUID); - return DC_ERR_CONFIG; - } - - ret = uuid_parse((char *)cfgval, project_uuid); - if (ret) - { - DC_log(LOG_ERR, "Invalid project UUID"); - free(cfgval); - return DC_ERR_CONFIG; - } - free(cfgval); - - /* Enforce a canonical string representation of the UUID */ - uuid_unparse_lower(project_uuid, project_uuid_str); - - return DC_OK; -} - -int DC_getMaxMessageSize(void) -{ - return MAX_MESSAGE_SIZE; -} - -int DC_getMaxSubresults(void) -{ - return MAX_SUBRESULTS; -} - -unsigned DC_getGridCapabilities(void) -{ - return DC_GC_STDOUT | DC_GC_STDERR; -} - -void DC_setMasterCb(DC_ResultCallback resultcb, DC_SubresultCallback subresultcb, - DC_MessageCallback msgcb) -{ - _dc_resultcb = resultcb; - _dc_subresultcb = subresultcb; - _dc_messagecb = msgcb; -} diff --git a/dcapi/local/client.c b/dcapi/local/local_client.c similarity index 100% rename from dcapi/local/client.c rename to dcapi/local/local_client.c diff --git a/dcapi/local/events.c b/dcapi/local/local_events.c similarity index 100% rename from dcapi/local/events.c rename to dcapi/local/local_events.c diff --git a/dcapi/local/rm.c b/dcapi/local/local_master.c similarity index 87% rename from dcapi/local/rm.c rename to dcapi/local/local_master.c index 07379a82cc..43cf38b4c4 100644 --- a/dcapi/local/rm.c +++ b/dcapi/local/local_master.c @@ -14,8 +14,103 @@ #include "dc_local.h" +/******************************************************************** + * Global variables + */ + +DC_ResultCallback _dc_resultcb; +DC_SubresultCallback _dc_subresultcb; +DC_MessageCallback _dc_messagecb; + +char project_uuid_str[37]; +uuid_t project_uuid; +int sleep_interval; + static GHashTable *wu_table; +/******************************************************************** + * API functions + */ + +int DC_initMaster(const char *config_file) +{ + char *cfgval; + int ret; + + if (!config_file) + config_file = DC_CONFIG_FILE; + + ret = _DC_parseCfg(config_file); + if (ret) + { + DC_log(LOG_ERR, "The DC-API cannot be initialized without a " + "config file"); + return ret; + } + + /* Check the working directory */ + cfgval = DC_getCfgStr(CFG_WORKDIR); + if (!cfgval) + { + DC_log(LOG_ERR, "%s is not specified in the config file", + CFG_WORKDIR); + return DC_ERR_CONFIG; + } + free(cfgval); + + /* Check sleep interval */ + sleep_interval = DC_getCfgInt(CFG_SLEEPINTERVAL, DEFAULT_SLEEP_INTERVAL); + if (sleep_interval < 1) + sleep_interval = 1; + + /* Check the project UUID */ + cfgval = DC_getCfgStr(CFG_INSTANCEUUID); + if (!cfgval) + { + DC_log(LOG_ERR, "%s is not set in the config file", + CFG_INSTANCEUUID); + return DC_ERR_CONFIG; + } + + ret = uuid_parse((char *)cfgval, project_uuid); + if (ret) + { + DC_log(LOG_ERR, "Invalid project UUID"); + free(cfgval); + return DC_ERR_CONFIG; + } + free(cfgval); + + /* Enforce a canonical string representation of the UUID */ + uuid_unparse_lower(project_uuid, project_uuid_str); + + return DC_OK; +} + +int DC_getMaxMessageSize(void) +{ + return MAX_MESSAGE_SIZE; +} + +int DC_getMaxSubresults(void) +{ + return MAX_SUBRESULTS; +} + +unsigned DC_getGridCapabilities(void) +{ + return DC_GC_STDOUT | DC_GC_STDERR; +} + +void DC_setMasterCb(DC_ResultCallback resultcb, DC_SubresultCallback subresultcb, + DC_MessageCallback msgcb) +{ + _dc_resultcb = resultcb; + _dc_subresultcb = subresultcb; + _dc_messagecb = msgcb; +} + + /******************************************************************** * Functions */ diff --git a/dcapi/local/result.c b/dcapi/local/local_result.c similarity index 100% rename from dcapi/local/result.c rename to dcapi/local/local_result.c