From: Petteri Aimonen Date: Tue, 20 Nov 2012 19:02:14 +0000 (+0200) Subject: Add support for fs and ps to sr_parse_period. X-Git-Tag: dsupstream~537 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8c012adbc15fcb00aee23f472b08b108d46b818b;p=libsigrok.git Add support for fs and ps to sr_parse_period. These time units are used in VCD files. --- diff --git a/strutil.c b/strutil.c index c5e7dce8..2c4d5c81 100644 --- a/strutil.c +++ b/strutil.c @@ -403,7 +403,11 @@ SR_API int sr_parse_period(const char *periodstr, struct sr_rational *r) if (s && *s) { while (*s == ' ') s++; - if (!strcmp(s, "ns")) + if (!strcmp(s, "fs")) + r->q = 1000000000000000L; + else if (!strcmp(s, "ps")) + r->q = 1000000000000L; + else if (!strcmp(s, "ns")) r->q = 1000000000L; else if (!strcmp(s, "us")) r->q = 1000000;