Support for jobid type options in logevent.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 11 Oct 2010 12:49:10 +0000 (12:49 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 11 Oct 2010 12:49:10 +0000 (12:49 +0000)
org.glite.lb.client/src/args.c.T

index 72daeb2..88eddcf 100644 (file)
@@ -321,6 +321,18 @@ static void read_timeval(const edg_wll_Args* o, char* arg, char* par)
         *(int*)o->value = v;
 }
 
+static void read_jobid(const edg_wll_Args* o, char* arg, char* par)
+{
+       glite_jobid_t jobid = NULL;
+
+       if (glite_jobid_parse(par, &jobid) != 0) {
+               fprintf(stderr, "ERROR %s  can't parse %s: %s\n", arg, par, strerror(errno));
+               exit(1);
+       }
+       if (o->value) *(glite_jobid_t *)o->value = jobid;
+       else glite_jobid_free(jobid);
+}
+
 static void show_help(const edg_wll_Args* o, int prefix)
 {
     unsigned max = 0;
@@ -542,6 +554,9 @@ static int findOpt(opt_ctx_t* ctx, int olong)
     case EDG_WLL_ARGS_TIMEVAL:
        read_timeval(o, arg, par);
        break;
+    case EDG_WLL_ARGS_JOBID:
+       read_jobid(o, arg, par);
+       break;
     default:
        printf("FIXME: unhandle option type %d\n", o->type);
         break;