Lines Matching refs:one

29 static void swap_times(timelib_time **one, timelib_time **two, timelib_rel_time *rt)  in swap_times()  argument
34 *two = *one; in swap_times()
35 *one = swp; in swap_times()
58 static void sort_old_to_new(timelib_time **one, timelib_time **two, timelib_rel_time *rt) in sort_old_to_new() argument
63 (*one)->zone_type == TIMELIB_ZONETYPE_ID && in sort_old_to_new()
65 (strcmp((*one)->tz_info->name, (*two)->tz_info->name) == 0) in sort_old_to_new()
68 ((*one)->y > (*two)->y) || in sort_old_to_new()
69 ((*one)->y == (*two)->y && (*one)->m > (*two)->m) || in sort_old_to_new()
70 ((*one)->y == (*two)->y && (*one)->m == (*two)->m && (*one)->d > (*two)->d) || in sort_old_to_new()
71 …((*one)->y == (*two)->y && (*one)->m == (*two)->m && (*one)->d == (*two)->d && (*one)->h > (*two)-… in sort_old_to_new()
72 …((*one)->y == (*two)->y && (*one)->m == (*two)->m && (*one)->d == (*two)->d && (*one)->h == (*two)… in sort_old_to_new()
73 …((*one)->y == (*two)->y && (*one)->m == (*two)->m && (*one)->d == (*two)->d && (*one)->h == (*two)… in sort_old_to_new()
74one)->y == (*two)->y && (*one)->m == (*two)->m && (*one)->d == (*two)->d && (*one)->h == (*two)->h… in sort_old_to_new()
76 swap_times(one, two, rt); in sort_old_to_new()
83 ((*one)->sse > (*two)->sse) || in sort_old_to_new()
84 ((*one)->sse == (*two)->sse && (*one)->us > (*two)->us) in sort_old_to_new()
86 swap_times(one, two, rt); in sort_old_to_new()
90 static timelib_rel_time *timelib_diff_with_tzid(timelib_time *one, timelib_time *two) in timelib_diff_with_tzid() argument
99 sort_old_to_new(&one, &two, rt); in timelib_diff_with_tzid()
102 dst_corr = two->z - one->z; in timelib_diff_with_tzid()
106 rt->y = two->y - one->y; in timelib_diff_with_tzid()
107 rt->m = two->m - one->m; in timelib_diff_with_tzid()
108 rt->d = two->d - one->d; in timelib_diff_with_tzid()
109 rt->h = two->h - one->h; in timelib_diff_with_tzid()
110 rt->i = two->i - one->i; in timelib_diff_with_tzid()
111 rt->s = two->s - one->s; in timelib_diff_with_tzid()
112 rt->us = two->us - one->us; in timelib_diff_with_tzid()
114 rt->days = timelib_diff_days(one, two); in timelib_diff_with_tzid()
117 if (one->dst == 1 && two->dst == 0) { in timelib_diff_with_tzid()
119 if (one->zone_type == TIMELIB_ZONETYPE_ID && two->zone_type == TIMELIB_ZONETYPE_ID) { in timelib_diff_with_tzid()
122 if (one->sse < trans->transition_time && one->sse >= trans->transition_time + dst_corr) { in timelib_diff_with_tzid()
142 timelib_do_rel_normalize(rt->invert ? one : two, rt); in timelib_diff_with_tzid()
145 …if (one->zone_type == TIMELIB_ZONETYPE_ID && two->zone_type == TIMELIB_ZONETYPE_ID && strcmp(one->… in timelib_diff_with_tzid()
146 if (one->dst == 1 && two->dst == 0) { /* Fall Back */ in timelib_diff_with_tzid()
153 ((two->sse - one->sse + dst_corr) % SECS_PER_DAY) > (two->sse - trans->transition_time) in timelib_diff_with_tzid()
159 } else if (one->dst == 0 && two->dst == 1) { /* Spring Forward */ in timelib_diff_with_tzid()
165 …!((one->sse + SECS_PER_DAY > trans->transition_time) && (one->sse + SECS_PER_DAY <= (trans->transi… in timelib_diff_with_tzid()
167 ((two->sse - one->sse + dst_corr) % SECS_PER_DAY) > (two->sse - trans->transition_time) in timelib_diff_with_tzid()
173 } else if (two->sse - one->sse >= SECS_PER_DAY) { in timelib_diff_with_tzid()
176 dst_corr = one->z - trans->offset; in timelib_diff_with_tzid()
189 timelib_do_rel_normalize(rt->invert ? one : two, rt); in timelib_diff_with_tzid()
199 timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) in timelib_diff() argument
203 …if (one->zone_type == TIMELIB_ZONETYPE_ID && two->zone_type == TIMELIB_ZONETYPE_ID && strcmp(one->… in timelib_diff()
204 return timelib_diff_with_tzid(one, two); in timelib_diff()
210 sort_old_to_new(&one, &two, rt); in timelib_diff()
212 rt->y = two->y - one->y; in timelib_diff()
213 rt->m = two->m - one->m; in timelib_diff()
214 rt->d = two->d - one->d; in timelib_diff()
215 rt->h = two->h - one->h; in timelib_diff()
216 if (one->zone_type != TIMELIB_ZONETYPE_ID) { in timelib_diff()
217 rt->h = rt->h + one->dst; in timelib_diff()
222 rt->i = two->i - one->i; in timelib_diff()
223 rt->s = two->s - one->s - two->z + one->z; in timelib_diff()
224 rt->us = two->us - one->us; in timelib_diff()
226 rt->days = timelib_diff_days(one, two); in timelib_diff()
228 timelib_do_rel_normalize(rt->invert ? one : two, rt); in timelib_diff()
234 int timelib_diff_days(timelib_time *one, timelib_time *two) in timelib_diff_days() argument
238 if (timelib_same_timezone(one, two)) { in timelib_diff_days()
242 if (timelib_time_compare(one, two) < 0) { in timelib_diff_days()
243 earliest = one; in timelib_diff_days()
247 latest = one; in timelib_diff_days()
252 days = llabs(timelib_epoch_days_from_time(one) - timelib_epoch_days_from_time(two)); in timelib_diff_days()
257 days = fabs(floor(one->sse - two->sse) / 86400); in timelib_diff_days()