Add support for fs and ps to sr_parse_period.

These time units are used in VCD files.
This commit is contained in:
Petteri Aimonen 2012-11-20 21:02:14 +02:00
parent ac913e5c35
commit 8c012adbc1
1 changed files with 5 additions and 1 deletions

View File

@ -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;