#include #include #include #include "util.h" vector read_events(const char *path) { FILE *f = fopen(path, "r"); if(!f) { fprintf(stderr, "cannot open file %s\n", path); exit(-1); } char *line_buf = 0; size_t buf_sz = 0; vector evts; while(getline(&line_buf, &buf_sz, f) >= 0) evts.push_back(EventPoint(line_buf)); free(line_buf); return evts; } // read_events