diff options
Diffstat (limited to 'src/include/gnunet_time_lib.h')
-rw-r--r-- | src/include/gnunet_time_lib.h | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index 386f6d609..be35ff131 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -199,10 +199,10 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct | |||
199 | * @return timestamp that is smaller | 199 | * @return timestamp that is smaller |
200 | */ | 200 | */ |
201 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct | 201 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct |
202 | GNUNET_TIME_Relative | 202 | GNUNET_TIME_Relative |
203 | t1, | 203 | t1, |
204 | struct | 204 | struct |
205 | GNUNET_TIME_Relative t2); | 205 | GNUNET_TIME_Relative t2); |
206 | 206 | ||
207 | 207 | ||
208 | /** | 208 | /** |
@@ -213,10 +213,10 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct | |||
213 | * @return timestamp that is larger | 213 | * @return timestamp that is larger |
214 | */ | 214 | */ |
215 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct | 215 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct |
216 | GNUNET_TIME_Relative | 216 | GNUNET_TIME_Relative |
217 | t1, | 217 | t1, |
218 | struct | 218 | struct |
219 | GNUNET_TIME_Relative t2); | 219 | GNUNET_TIME_Relative t2); |
220 | 220 | ||
221 | /** | 221 | /** |
222 | * Return the minimum of two absolute time values. | 222 | * Return the minimum of two absolute time values. |
@@ -226,10 +226,10 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct | |||
226 | * @return timestamp that is smaller | 226 | * @return timestamp that is smaller |
227 | */ | 227 | */ |
228 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct | 228 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct |
229 | GNUNET_TIME_Absolute | 229 | GNUNET_TIME_Absolute |
230 | t1, | 230 | t1, |
231 | struct | 231 | struct |
232 | GNUNET_TIME_Absolute t2); | 232 | GNUNET_TIME_Absolute t2); |
233 | 233 | ||
234 | /** | 234 | /** |
235 | * Return the maximum of two absolute time values. | 235 | * Return the maximum of two absolute time values. |
@@ -239,10 +239,10 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct | |||
239 | * @return timestamp that is smaller | 239 | * @return timestamp that is smaller |
240 | */ | 240 | */ |
241 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct | 241 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct |
242 | GNUNET_TIME_Absolute | 242 | GNUNET_TIME_Absolute |
243 | t1, | 243 | t1, |
244 | struct | 244 | struct |
245 | GNUNET_TIME_Absolute t2); | 245 | GNUNET_TIME_Absolute t2); |
246 | 246 | ||
247 | /** | 247 | /** |
248 | * Given a timestamp in the future, how much time | 248 | * Given a timestamp in the future, how much time |
@@ -266,9 +266,10 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining (struct | |||
266 | * @return remaining duration for the operation, | 266 | * @return remaining duration for the operation, |
267 | * assuming it continues at the same speed | 267 | * assuming it continues at the same speed |
268 | */ | 268 | */ |
269 | struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, | 269 | struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct |
270 | uint64_t finished, | 270 | GNUNET_TIME_Absolute |
271 | uint64_t total); | 271 | start, uint64_t finished, |
272 | uint64_t total); | ||
272 | 273 | ||
273 | 274 | ||
274 | /** | 275 | /** |
@@ -324,11 +325,11 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct | |||
324 | * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise | 325 | * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise |
325 | */ | 326 | */ |
326 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct | 327 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct |
327 | GNUNET_TIME_Absolute | 328 | GNUNET_TIME_Absolute |
328 | start, | 329 | start, |
329 | struct | 330 | struct |
330 | GNUNET_TIME_Relative | 331 | GNUNET_TIME_Relative |
331 | duration); | 332 | duration); |
332 | 333 | ||
333 | /** | 334 | /** |
334 | * Multiply relative time by a given factor. | 335 | * Multiply relative time by a given factor. |
@@ -340,8 +341,7 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct | |||
340 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct | 341 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct |
341 | GNUNET_TIME_Relative | 342 | GNUNET_TIME_Relative |
342 | rel, | 343 | rel, |
343 | unsigned int | 344 | unsigned int factor); |
344 | factor); | ||
345 | 345 | ||
346 | /** | 346 | /** |
347 | * Divide relative time by a given factor. | 347 | * Divide relative time by a given factor. |
@@ -351,10 +351,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct | |||
351 | * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor | 351 | * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor |
352 | */ | 352 | */ |
353 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct | 353 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct |
354 | GNUNET_TIME_Relative | 354 | GNUNET_TIME_Relative |
355 | rel, | 355 | rel, |
356 | unsigned int | 356 | unsigned int factor); |
357 | factor); | ||
358 | 357 | ||
359 | /** | 358 | /** |
360 | * Add relative times together. | 359 | * Add relative times together. |
@@ -366,8 +365,7 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct | |||
366 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct | 365 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct |
367 | GNUNET_TIME_Relative a1, | 366 | GNUNET_TIME_Relative a1, |
368 | struct | 367 | struct |
369 | GNUNET_TIME_Relative | 368 | GNUNET_TIME_Relative a2); |
370 | a2); | ||
371 | 369 | ||
372 | /** | 370 | /** |
373 | * Subtract relative timestamp from the other. | 371 | * Subtract relative timestamp from the other. |
@@ -378,7 +376,7 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct | |||
378 | */ | 376 | */ |
379 | struct GNUNET_TIME_Relative | 377 | struct GNUNET_TIME_Relative |
380 | GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, | 378 | GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, |
381 | struct GNUNET_TIME_Relative a2); | 379 | struct GNUNET_TIME_Relative a2); |
382 | 380 | ||
383 | 381 | ||
384 | /** | 382 | /** |
@@ -429,16 +427,14 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh (struct | |||
429 | * | 427 | * |
430 | * @return string form of the time (as milliseconds) | 428 | * @return string form of the time (as milliseconds) |
431 | */ | 429 | */ |
432 | const char * | 430 | const char *GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); |
433 | GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); | ||
434 | 431 | ||
435 | /** | 432 | /** |
436 | * Set the timestamp offset for this instance. | 433 | * Set the timestamp offset for this instance. |
437 | * | 434 | * |
438 | * @param offset the offset to skew the locale time by | 435 | * @param offset the offset to skew the locale time by |
439 | */ | 436 | */ |
440 | void | 437 | void GNUNET_TIME_set_offset (long long offset); |
441 | GNUNET_TIME_set_offset(long long offset); | ||
442 | 438 | ||
443 | #if 0 /* keep Emacsens' auto-indent happy */ | 439 | #if 0 /* keep Emacsens' auto-indent happy */ |
444 | { | 440 | { |