From 6cb466305064733d04e32bf452fc80d6ab3233db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Fri, 10 Dec 2004 12:27:57 +0000 Subject: [PATCH] import of CE statistics --- org.glite.lb.common/src/xml_conversions.c | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/org.glite.lb.common/src/xml_conversions.c b/org.glite.lb.common/src/xml_conversions.c index 515a6d6..d914cce 100644 --- a/org.glite.lb.common/src/xml_conversions.c +++ b/org.glite.lb.common/src/xml_conversions.c @@ -1,6 +1,7 @@ #ident "$Header$" #include +#include #include #include "trio.h" @@ -64,6 +65,16 @@ void edg_wll_initXMLCtx(edg_wll_XML_ctx *c) { c->attrsGlobal = NULL; c->errCode = 0; c->bound = 0; + c->statsFunction = NULL; + c->statsConditions = NULL; + c->statsMajor = EDG_WLL_JOB_UNDEF; + c->statsMinor = 0; + c->statsRate = 0; + c->statsDuration = 0; + c->statsFrom = 0; + c->statsTo = 0; + c->statsResFrom = 0; + c->statsResTo = 0; c->errDesc = NULL; c->stat_begin = 0; c->jobQueryRec_begin = 0; @@ -136,6 +147,22 @@ void edg_wll_add_int_to_XMLBody(char **body, const int toAdd, const char *tag, c } +/* edg_wll_add_float_to_XMLBody(&body, rate, "rate", 0) */ + +void edg_wll_add_float_to_XMLBody(char **body, const float toAdd, const char *tag, const float null) +{ + if (toAdd != null) { + char *newBody; + + trio_asprintf(&newBody,"%s\t\t\t<%s>%|Xf\r\n", *body, tag, toAdd, tag); + + free(*body); + *body = newBody; + } +} + + + /* edg_wll_add_timeval_to_XMLBody(&body, eventsOut[i].any.tv, "timestamp", -1) */ void edg_wll_add_timeval_to_XMLBody(char **body, struct timeval toAdd, const char *tag, const struct timeval null) @@ -543,6 +570,21 @@ int edg_wll_from_string_to_int(edg_wll_XML_ctx *XMLCtx) } + +/* XMLCtx->eventsOutGlobal[XMLCtx->position].jobClear.clearReason = + edg_wll_from_string_to_int(XMLCtx); */ +float edg_wll_from_string_to_float(edg_wll_XML_ctx *XMLCtx) +{ + float out; + + out = strtof(XMLCtx->char_buf, (char **) NULL); + edg_wll_freeBuf(XMLCtx); + + return(out); +} + + + long edg_wll_from_string_to_long(edg_wll_XML_ctx *XMLCtx) { long out; -- 1.8.2.3