#endif
int edg_wll_get_event_flesh(edg_wll_Context,int,edg_wll_Event *);
+
int edg_wll_QueryEventsServer(edg_wll_Context,int,const edg_wll_QueryRec **,const edg_wll_QueryRec **,edg_wll_Event **);
int edg_wll_QueryJobsServer(edg_wll_Context, const edg_wll_QueryRec **, int, edg_wlc_JobId **, edg_wll_JobStat **);
void edg_wll_SortEvents(edg_wll_Event *);
+void edg_wll_SortPEvents(edg_wll_Event **);
+
#ifdef __cplusplus
}
#endif
static int compare_events_by_seq(const void *a, const void *b)
{
- const edg_wll_Event *e = (edg_wll_Event *)a;
- const edg_wll_Event *f = (edg_wll_Event *)b;
+ const edg_wll_Event *e = (edg_wll_Event *) a;
+ const edg_wll_Event *f = (edg_wll_Event *) b;
int ret;
ret = edg_wll_compare_seq(e->any.seqcode, f->any.seqcode);
return 0;
}
+static int compare_pevents_by_seq(const void *a, const void *b)
+{
+ const edg_wll_Event **e = (edg_wll_Event **) a;
+ const edg_wll_Event **f = (edg_wll_Event **) b;
+ return compare_events_by_seq(*e,*f);
+}
+
void edg_wll_SortEvents(edg_wll_Event *e)
{
int n;
if (!e) return;
for (n=0; e[n].type; n++);
- qsort(e,n,sizeof *e,compare_events_by_seq);
+ qsort(e,n,sizeof(*e),compare_events_by_seq);
+}
+
+void edg_wll_SortPEvents(edg_wll_Event **e)
+{
+ edg_wll_Event **p;
+ int n;
+
+ if (!e) return;
+ p = e;
+ for (n=0; *p; n++) {
+ p++;
+ }
+ qsort(e,n,sizeof(*e),compare_pevents_by_seq);
}