void glite_jp_attr_free(glite_jp_attr_t *,int);
void glite_jp_attrset_free(glite_jp_attr_t *a,int);
+int glite_jp_attr_cmp(const glite_jp_attr_t *,const glite_jp_attr_t *);
+
void glite_jp_attr_union(const glite_jp_attr_t *, const glite_jp_attr_t *,
glite_jp_attr_t **);
if (f) free(a);
}
-static int attr_cmp(const void *va,const void *vb)
+int glite_jp_attr_cmp(const glite_jp_attr_t *a,const glite_jp_attr_t *b)
{
int c;
- const glite_jp_attr_t *a = va, *b = vb;
if (a->type < b->type) return -1;
if (a->type > b->type) return 1;
}
}
+static int void_attr_cmp(const void *va, const void *vb)
+{
+ return glite_jp_attr_cmp(va,vb);
+}
+
void glite_jp_attr_union(const glite_jp_attr_t *a, const glite_jp_attr_t *b,
glite_jp_attr_t **out)
{
memcpy(res,a,ac * sizeof *a);
memcpy(res+ac,b,bc * sizeof *b);
memset(res+ac+bc,0,sizeof *res);
- qsort(res,c,sizeof *res,attr_cmp);
+ qsort(res,c,sizeof *res,void_attr_cmp);
for (i=0; i<c; i++) {
for (j=i+1; !attr_cmp(res+i,res+j); j++);