summaryrefslogtreecommitdiff
path: root/ao-tools/lib/cc-analyse.c
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2009-09-20 09:19:28 -0600
committerBdale Garbee <bdale@gag.com>2009-09-20 09:19:28 -0600
commitdf42ccaaf468cdc5d93cbd1c001f58df58419722 (patch)
tree8699b949083d347bc00219bbbbefdf8ead3b8e16 /ao-tools/lib/cc-analyse.c
parent0b24e4034f93010372a3d084668d10f0e4a2c2e1 (diff)
parent078e9cdbdb388b22c6151f76ff0660fc14b8ef55 (diff)
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'ao-tools/lib/cc-analyse.c')
-rw-r--r--ao-tools/lib/cc-analyse.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ao-tools/lib/cc-analyse.c b/ao-tools/lib/cc-analyse.c
index cdb16f02..27c416a6 100644
--- a/ao-tools/lib/cc-analyse.c
+++ b/ao-tools/lib/cc-analyse.c
@@ -18,6 +18,20 @@
#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)
{