*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
#include "cc.h"
#include <math.h>
+void
+cc_timedata_limits(struct cc_timedata *d, double min_time, double max_time, int *start, int *stop)
+{
+ int i;
+
+ *start = -1;
+ for (i = 0; i < d->num; i++) {
+ if (*start < 0 && min_time <= d->data[i].time)
+ *start = i;
+ if (d->data[i].time <= max_time)
+ *stop = i;
+ }
+}
+
int
cc_timedata_min(struct cc_timedata *d, double min_time, double max_time)
{