first working .l
authorAleš Křenek <ljocha@ics.muni.cz>
Thu, 10 Sep 2009 10:36:52 +0000 (10:36 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Thu, 10 Sep 2009 10:36:52 +0000 (10:36 +0000)
org.glite.lb.client/examples/gen_begin
org.glite.lb.client/src/EventAttrNames.pl
org.glite.lb.client/src/logevent.c.T
org.glite.lb.common/interface/events.h.T
org.glite.lb.common/src/context.c
org.glite.lb.state-machine/src/seqcode_aux.c
org.glite.lb.types/MultiStruct.pm
org.glite.lb.types/events.T

index 67f44d0..fe96c1b 100755 (executable)
@@ -42,11 +42,13 @@ done
 
 test \( -z "$BKSERVER_HOST" \) -a \( -z "$EDG_JOBID" \) && usage
 
+if [[ $0 =~ "cream_" ]]; then TYPE=-c; fi
+
 if [ -z "$EDG_JOBID" ] 
 then
        # initial sequence code & jobid (normaly returned by job_reg)
        EDG_JOBID=
-       SCRIPT=`$JOB_REG $LBPROXY_REG -m $BKSERVER_HOST -s UserInterface | tail -n 2`
+       SCRIPT=`$JOB_REG $TYPE $LBPROXY_REG -m $BKSERVER_HOST -s UserInterface | tail -n 2`
        eval $SCRIPT
        test -z "$EDG_JOBID" && exit 4
        echo EDG_JOBID=$EDG_JOBID
index f424919..78de8ad 100644 (file)
@@ -84,4 +84,5 @@
        COMMAND
        CMDID
        CALLEE
+       DESTID
 /;
index 190d303..634abf8 100644 (file)
@@ -67,7 +67,9 @@ int main(int argc, char *argv[])
            };
 
            $type = { type=>'char *',defval=>'NULL' } if $f->{codes};
-
+            warn "$fn: $vars{$fn}->{type} to $type->{type}\n"
+                        if $vars{$fn} && ($vars{$fn}->{type} ne $type->{type}
+                               || $vars{$fn}->{defval} ne $type->{defval});
            $vars{$fn} = $type;
        }
     }
index 6339be4..030c1a2 100644 (file)
@@ -43,6 +43,14 @@ extern "C" {
  */
 typedef char *edg_wll_LogLine;
 
+enum edg_wll_CREAMCommand {
+       EDG_WLL_CREAM_CMD_UNDEFINED = 0,
+       EDG_WLL_CREAM_CMD_START = 0,
+       EDG_WLL_CREAM_CMD_CANCEL = 0,
+       EDG_WLL_CREAM_CMD_PURGE = 0,
+       EDG_WLL_CREAM_CMD_SUSPEND = 0,
+       EDG_WLL_CREAM_CMD_RESUME = 0,
+};
 
 /**
  * \typedef edg_wll_EventCode
@@ -154,6 +162,8 @@ extern char *edg_wll_KeyNameToString(edg_wll_KeyNameCode key);
  * related StringTo_code and _code_ToString function prototypes
  */
 @@@{
+
+%enum_done = ();
 $indent = "\t";
 selectType $event '_common_';
 for ($event->getFieldsOrdered) {
@@ -164,6 +174,9 @@ for ($event->getFieldsOrdered) {
                my $c = "${fn}"; # new code
                my $enum = "enum edg_wll\_$c"; # new enum name
 
+               next if $enum_done{$enum};
+               $enum_done{$enum} = 1;
+
 # enum
                gen qq{
 /**
@@ -213,6 +226,8 @@ for my $t (sort { $event->{order}->{$a} <=> $event->{order}->{$b} }
                        my $c = "$t${fn}"; # new code
                        my $enum = "enum edg_wll\_$c"; # new enum name
 
+                       next if $enum_done{$enum};
+                       $enum_done{$enum} = 1;
 # enum
                        gen qq{
 /**
@@ -231,7 +246,12 @@ $enum \{
                                $main::defined_undefs{$tu} = 1;
                        }
                        for (@{$f->{codes}}) {
-                               gen $indent."EDG_WLL_$tu$_->{name},\t/**< $_->{comment} */ \n";
+                               my $alias = '';
+                               if ($f->{ptype} ne $t) {
+                                       my $ptu = uc($f->{ptype}) .'_';
+                                       $alias = " = EDG_WLL_$ptu$_->{name}";
+                               } 
+                               gen $indent."EDG_WLL_$tu$_->{name}$alias,\t/**< $_->{comment} */ \n";
                        }
                        gen "};\n";
 
index 2792837..daccea9 100644 (file)
@@ -354,7 +354,7 @@ char *edg_wll_GetSequenceCode(const edg_wll_Context ctx)
                        ret = strdup(ctx->p_seqcode.condor);
                        break;
                case EDG_WLL_SEQ_CREAM:
-                       ret = strdup("");       /* XXX: not yet */
+                       ret = strdup("no_seqcodes_with_CREAM"); /* XXX: not yet */
                        break;
                default:
                        edg_wll_SetError(ctx,EINVAL,"edg_wll_GetSequenceCode(): sequence code type");
index c20c627..002e21f 100644 (file)
@@ -219,8 +219,6 @@ int edg_wll_compare_seq(const char *a, const char *b)
        if (!strstr(b, "LBS")) snprintf(scb,EDG_WLL_SEQ_SIZE,"%s:LBS=000000",b);
        else snprintf(scb,EDG_WLL_SEQ_SIZE,"%s",b);
 
-       assert(EDG_WLL_SOURCE__LAST == 10);
-
        res =  sscanf(sca, "UI=%d:NS=%d:WM=%d:BH=%d:JSS=%d:LM=%d:LRMS=%d:APP=%d:LBS=%d",
                        &c[EDG_WLL_SOURCE_USER_INTERFACE],
                        &c[EDG_WLL_SOURCE_NETWORK_SERVER],
@@ -231,7 +229,7 @@ int edg_wll_compare_seq(const char *a, const char *b)
                        &c[EDG_WLL_SOURCE_LRMS],
                        &c[EDG_WLL_SOURCE_APPLICATION],
                        &c[EDG_WLL_SOURCE_LB_SERVER]);
-       if (res != EDG_WLL_SOURCE__LAST-1) {
+       if (res != 9) {
 /* FIXME:              syslog(LOG_ERR, "unparsable sequence code %s\n", sca); */
                fprintf(stderr, "unparsable sequence code %s\n", sca);
                return -1;
@@ -247,7 +245,7 @@ int edg_wll_compare_seq(const char *a, const char *b)
                        &d[EDG_WLL_SOURCE_LRMS],
                        &d[EDG_WLL_SOURCE_APPLICATION],
                        &d[EDG_WLL_SOURCE_LB_SERVER]);
-       if (res != EDG_WLL_SOURCE__LAST-1) {
+       if (res != 9) {
 /* FIXME:              syslog(LOG_ERR, "unparsable sequence code %s\n", scb); */
                fprintf(stderr, "unparsable sequence code %s\n", scb);
                return 1;
index 7c009d7..0f6efb3 100644 (file)
@@ -39,10 +39,15 @@ sub selectField {
 sub addField {
        my $self = shift;
        my $field = shift;
+
        
        die "unselected type" unless $self->{type};
        $self->{fields}->{$self->{type}}->{$field->{name}} = $field;
        $self->selectField($field->{name});
+
+       my $f = $self->{field};
+       my $t = $self->{type};
+       push @{$field->{refs}},"$t:$f";
        1;
 }
 
@@ -102,12 +107,17 @@ sub load {
                        my $f = $self->getField();
                        $f->{index} = 1;
                }
+               elsif ($ftype eq '_ref_') {
+                       my ($rt,$rf) = split /:/,$fname;
+                       $self->addField(my $f = $self->{fields}->{$rt}->{$rf});
+               }
                elsif ($ftype eq '_pad_') {
                        my $f = $self->getField();
                        $f->{pad} = $fname;
                }
                else {
                        my $f = new StructField $fname,$ftype,$comment,$.;
+                       $f->{ptype} = $self->{type};
                        $self->addField($f);
                }
        }
index af5ec3a..64213ed 100644 (file)
 
 @type CREAMCall        Processing command and calling BLAH or LRMS
        logsrc  callee  
-       int     command         The command
+       _ref_   CREAMStore:command
        string  cmdid           Id of the command, as stored previously
        _optional_
+       string  destid  
+       _optional_
        int     result
        _code_  START
        _code_  OK