+
+time_t blerg_get_timestamp(struct blerg *blerg, int record) {
+ if (record < 0) {
+ printf("Invalid record\n");
+ return 0;
+ }
+
+ int segment = record / RECORDS_PER_SEGMENT;
+ if (segment != blerg->current_segment)
+ blerg_segment_switch(blerg, segment);
+ int seg_rec = record % RECORDS_PER_SEGMENT;
+
+ if ((blerg->index[seg_rec].flags & 0x1) == 0) {
+ printf("Invalid record\n");
+ return 0;
+ }
+
+ return blerg->index[seg_rec].timestamp;
+}