X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fstd.c;h=4219042ea7ac75cbcdacd93eadbc99aee67f2d13;hb=1f488f50b91a67ffc85aa36cea63f09b580aa36e;hp=7add7dd9c1ebdcebd6dfd9acea89f65f18430afa;hpb=697fb6ddfc2522b2e6d35511c7837e2c61d8ae73;p=libsigrok.git diff --git a/src/std.c b/src/std.c index 7add7dd9..4219042e 100644 --- a/src/std.c +++ b/src/std.c @@ -828,3 +828,14 @@ SR_PRIV int std_double_tuple_idx_d0(const double d, const double a[][2], unsigne return -1; } + +SR_PRIV int std_cg_idx(const struct sr_channel_group *cg, struct sr_channel_group *a[], unsigned int n) +{ + unsigned int i; + + for (i = 0; i < n; i++) + if (cg == a[i]) + return i; + + return -1; +}