megoldas a loggerre, egyeb javitasok
[gp-arc-client-c.git] / src / submit.cpp
index d7337bb..bd25b14 100644 (file)
@@ -8,9 +8,8 @@
  */
 
 #include "submit.h"
-#include "common_utils.h"
 #include "logger.h"
-#include "config.h"
+#include "config.h" //TBD: Kell ez?
 // -*- indent-tabs-mode: nil -*-
 
 #ifdef HAVE_CONFIG_H
 #include <unistd.h>
 
 #include "arc_libs.h"
-#pragma GCC visibility push(default)
-extern "C" {
+
+
 submit_result_t* submit(int argc, char **argv) {
        
+       
+       
+       
+       
+       
+       
+       
        submit_result_t* result = (submit_result_t*)malloc(sizeof(submit_result_t));
        if (!result) {
                return NULL;//TBD: throw sth?
        }
        result->message = NULL;
        result->job_id = NULL;
+       
+       
 
        //TODO: what necessary here?
        Arc::OptionParser options(istring("[filename ...]"),
@@ -99,15 +107,13 @@ submit_result_t* submit(int argc, char **argv) {
        
        std::list<std::string> params = options.Parse(argc, argv);
        
-       std::cout << "conffile:";
-       std::cout << conffile.size();//TODO: clean
+       
        Arc::UserConfig usercfg(conffile);
        if (!usercfg) {
                result->message = new_str("Failed configuration initialization");
-               return result;
+               return result;  
        }
        
-       
        if (timeout > 0)
                usercfg.Timeout(timeout);
        
@@ -162,7 +168,7 @@ submit_result_t* submit(int argc, char **argv) {
                result->message = ostringstream2cstring(sstream);
                return result;
        }
-       logger->msg(Arc::INFO, "Broker %s loaded", usercfg.Broker().first);
+       logger.msg(Arc::INFO, "Broker %s loaded", usercfg.Broker().first);
        
                
        ChosenBroker->PreFilterTargets(targen.ModifyFoundTargets(), jobdesc);
@@ -184,18 +190,18 @@ submit_result_t* submit(int argc, char **argv) {
                //submit the job
                Arc::URL jobid = submitter->Submit(jobdesc, *target);
                if (!jobid) {
-                       logger->msg(Arc::INFO, "Submission to %s failed, trying next target", target->url.str());
+                       logger.msg(Arc::INFO, "Submission to %s failed, trying next target", target->url.str());
                        continue;
                }
                
                ChosenBroker->RegisterJobsubmission();
                result->job_id = new_str(jobid.str().c_str());
-               logger->msg(Arc::DEBUG, "Job submitted with jobid: %s", jobid.str());
+               logger.msg(Arc::DEBUG, "Job submitted with jobid: %s", jobid.str());
                
                break;
        } //end loop over all possible targets
        
        return result;
 }
-}
+