9 xrow_t*r = rfx_calloc(sizeof(xrow_t));
11 r->x = rfx_alloc(sizeof(r->x[0])*r->size);
15 void xrow_add(xrow_t*r, int32_t x)
17 if(r->num && r->lastx==x)
20 if(r->num >= r->size) {
22 r->x = rfx_realloc(r->x, sizeof(r->x[0])*r->size);
27 int compare_int32(const void*_i1,const void*_i2)
29 int32_t*i1 = (int32_t*)_i1;
30 int32_t*i2 = (int32_t*)_i2;
34 void xrow_sort(xrow_t*r)
38 qsort(r->x, r->num, sizeof(r->x[0]), compare_int32);
41 int32_t lastx=r->x[0];
42 for(t=1;t<r->num;t++) {
44 r->x[pos++] = lastx = r->x[t];
50 void xrow_reset(xrow_t*r)
55 void xrow_dump(xrow_t*xrow)
57 fprintf(stderr, "x: ");
59 for(t=0;t<xrow->num;t++) {
61 fprintf(stderr, ", ");
62 fprintf(stderr, "%d", xrow->x[t]);
64 fprintf(stderr, "\n");
67 void xrow_destroy(xrow_t*r)