21 unit = line->
data[len - 1];
60 unit = line->
data[len - 1];
78 scale = 1024 * 1024 * 1024;
118 step = is_sec ? st_start : st_month;
119 scale = is_sec ? 1 : 1000;
122 last = p + line->
len;
126 if (*p >=
'0' && *p <=
'9') {
127 value = value * 10 + (*p++ -
'0');
135 if (step > st_start) {
140 scale = 60 * 60 * 24 * 365;
144 if (step >= st_month) {
149 scale = 60 * 60 * 24 * 30;
153 if (step >= st_week) {
158 scale = 60 * 60 * 24 * 7;
162 if (step >= st_day) {
167 scale = 60 * 60 * 24;
171 if (step >= st_hour) {
181 if (is_sec || step >= st_msec) {
191 if (step >= st_min) {
200 if (step >= st_sec) {
209 if (step >= st_sec) {
221 if (step != st_msec && !is_sec) {
230 total += value * scale;
237 scale = is_sec ? 1 : 1000;
239 while (p < last && *p ==
' ') {
245 return total + value * scale;