8 xrow_t*r = rfx_calloc(sizeof(xrow_t));
10 r->x = rfx_alloc(sizeof(r->x[0])*r->size);
14 void xrow_add(xrow_t*r, int32_t x)
16 if(r->num && r->lastx==x)
19 if(r->num >= r->size) {
21 r->x = rfx_realloc(r->x, sizeof(r->x[0])*r->size);
26 int compare_int32(const void*_i1,const void*_i2)
28 int32_t*i1 = (int32_t*)_i1;
29 int32_t*i2 = (int32_t*)_i2;
33 void xrow_sort(xrow_t*r)
37 qsort(r->x, r->num, sizeof(r->x[0]), compare_int32);
40 int32_t lastx=r->x[0];
41 for(t=1;t<r->num;t++) {
43 r->x[pos++] = lastx = r->x[t];
49 void xrow_reset(xrow_t*r)
54 void xrow_dump(xrow_t*xrow)
56 fprintf(stderr, "x: ");
58 for(t=0;t<xrow->num;t++) {
60 fprintf(stderr, ", ");
61 fprintf(stderr, "%d", xrow->x[t]);
63 fprintf(stderr, "\n");
66 void xrow_destroy(xrow_t*r)