#define UNUSED_VAR
#endif
-#define RET_FAIL 0
-#define RET_OK 1
-#define RET_FATAL RET_FAIL
-#define RET_SOON 2
-#define RET_LATE 3
-#define RET_BADSEQ 4
-#define RET_SUSPECT 5
-#define RET_IGNORE 6
-#define RET_BADBRANCH 7
-#define RET_GOODBRANCH 8
-#define RET_TOOOLD 9
-#define RET_INTERNAL 100
#define rep(a,b) { free(a); a = (b == NULL) ? NULL : strdup(b); }
#define mov(a,b) { free(a); a = b; b = NULL; }
static int eval_expect_update(intJobStat *, int *, char **);
#endif
-static int processEvent(intJobStat *, edg_wll_Event *, int, int, char **);
-
static char* matched_substr(char *, regmatch_t) UNUSED_VAR;
static char* matched_substr(char *in, regmatch_t match)
#define LRMS_STATE(state) ((state) == EDG_WLL_JOB_RUNNING || (state) == EDG_WLL_JOB_DONE)
-static int processEvent(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char **errstring)
+int processEvent(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char **errstring)
{
edg_wll_JobStatCode old_state = js->pub.state;
#define INTSTAT_VERSION "release-3.0_shallow"
+
+// Internal error codes
+
+#define RET_FAIL 0
+#define RET_OK 1
+#define RET_FATAL RET_FAIL
+#define RET_SOON 2
+#define RET_LATE 3
+#define RET_BADSEQ 4
+#define RET_SUSPECT 5
+#define RET_IGNORE 6
+#define RET_BADBRANCH 7
+#define RET_GOODBRANCH 8
+#define RET_TOOOLD 9
+#define RET_INTERNAL 100
+
+
// shallow resubmission container - holds state of each branch
// (useful when state restore is needed after ReallyRunning event)
//
int before_deep_resubmission(const char *, const char *);
int same_branch(const char *, const char *);
int component_seqcode(const char *a, edg_wll_Source index);
+int processEvent(intJobStat *, edg_wll_Event *, int, int, char **);
i = 0;
while (events[i])
{
- if (!processEvent(js, events[i], 0, be_strict, &errstring)) {
- // XXX: better way would be to export definitions
- // of intermal job_status error codes and test
- // it againts RET_FATAL
+ if (processEvent(js, events[i], 0, be_strict, &errstring) == RET_FATAL) {
goto err;
}
i++;