*(edg_wll_Source*)o->value = s;
}
+/* FIXME: parse timeval from string correctly */
+static void read_timeval(const edg_wll_Args* o, char* arg, char* par)
+{
+ int v = 0;
+ if (!par)
+ {
+ printf("Option: %s - missing timeval value\n", arg);
+ exit(1);
+ }
+ sscanf(par, "%i", &v);
+ if (o->min != o->max)
+ {
+ if (v < o->min && v > o->max)
+ {
+ printf("Option: %s - value: %d out of range <%d, %d>",
+ arg, v, o->min, o->max);
+ exit(1);
+ }
+ }
+ if (o->value)
+ *(int*)o->value = v;
+}
+
static void show_help(const edg_wll_Args* o, int prefix)
{
unsigned max = 0;
exit(0);
//case EDG_WLL_ARGS_SUBOPTIONS:
//parse_suboptions((const edg_wll_Args*)o->value, arg, par, regname);
+ case EDG_WLL_ARGS_TIMEVAL:
+ read_timeval(o, arg, par);
+ break;
default:
printf("FIXME: unhandle option type %d\n", o->type);
break;
#define ENABLE_REASON_LENGTH
static int flesh_seq(int);
+static const struct timeval null_timeval = {0,0};
int main(int argc, char *argv[])
{
"glite_jobid_t", "EDG_WLL_ARGS_JOBID",
"edg_wll_NotifId", "EDG_WLL_ARGS_NOTIFID",
"edg_wll_Source", "EDG_WLL_ARGS_SOURCE",
- "uint16_t", "EDG_WLL_ARGS_UINT16"
+ "uint16_t", "EDG_WLL_ARGS_UINT16",
+ "struct timeval", "EDG_WLL_ARGS_TIMEVAL"
);
my %vars = ();
for my $t (sort { $event->{order}->{$a} <=> $event->{order}->{$b} }