void process_point(point_line_t *plt) { static int code_state = INT32_MAX; static int points = 0; static point_line_t *plta = NULL; if (!plt) { printf("WARNING: Unexpected call to process_point with a NULL point structure\n"); return; } /* state change, we're either starting or ending */ if (code_state != plt->code) { if (points > 0) { process_multi_group(&plta, points, TOL); printf("END OF BLOCK %d\n", code_state); /* finish up this batch */ bu_free((genptr_t)plta, "end point_line_t group"); plta = NULL; } if (plt->type) printf("BEGIN OF BLOCK %s (%d)\n", plt->type, plt->code); /* get ready for the new batch */ code_state = plt->code; points = 0; } /* allocate room for the new point */ if (!plta) plta = (point_line_t *) bu_malloc(sizeof(point_line_t), "begin point_line_t group"); else plta = (point_line_t *) bu_realloc(plta, sizeof(point_line_t) * (points + 1), "add point_line_t"); COPY_POINT_LINE_T(plta[points], *plt); points++; }
int process_handles(struct http_data *data){ return process_multi_group(data); }