aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_time_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_time_lib.h')
-rw-r--r--src/include/gnunet_time_lib.h140
1 files changed, 68 insertions, 72 deletions
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index d0da267a9..28a76e3ef 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -16,7 +16,7 @@
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19*/ 19 */
20 20
21/** 21/**
22 * @author Christian Grothoff 22 * @author Christian Grothoff
@@ -45,8 +45,7 @@ extern "C"
45/** 45/**
46 * Time for absolute times used by GNUnet, in microseconds. 46 * Time for absolute times used by GNUnet, in microseconds.
47 */ 47 */
48struct GNUNET_TIME_Absolute 48struct GNUNET_TIME_Absolute {
49{
50 /** 49 /**
51 * The actual value. 50 * The actual value.
52 */ 51 */
@@ -57,8 +56,7 @@ struct GNUNET_TIME_Absolute
57 * Time for relative time used by GNUnet, in microseconds. 56 * Time for relative time used by GNUnet, in microseconds.
58 * Always positive, so we can only refer to future time. 57 * Always positive, so we can only refer to future time.
59 */ 58 */
60struct GNUNET_TIME_Relative 59struct GNUNET_TIME_Relative {
61{
62 /** 60 /**
63 * The actual value. 61 * The actual value.
64 */ 62 */
@@ -70,8 +68,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
70/** 68/**
71 * Time for relative time used by GNUnet, in microseconds and in network byte order. 69 * Time for relative time used by GNUnet, in microseconds and in network byte order.
72 */ 70 */
73struct GNUNET_TIME_RelativeNBO 71struct GNUNET_TIME_RelativeNBO {
74{
75 /** 72 /**
76 * The actual value (in network byte order). 73 * The actual value (in network byte order).
77 */ 74 */
@@ -82,8 +79,7 @@ struct GNUNET_TIME_RelativeNBO
82/** 79/**
83 * Time for absolute time used by GNUnet, in microseconds and in network byte order. 80 * Time for absolute time used by GNUnet, in microseconds and in network byte order.
84 */ 81 */
85struct GNUNET_TIME_AbsoluteNBO 82struct GNUNET_TIME_AbsoluteNBO {
86{
87 /** 83 /**
88 * The actual value (in network byte order). 84 * The actual value (in network byte order).
89 */ 85 */
@@ -129,41 +125,41 @@ GNUNET_NETWORK_STRUCT_END
129/** 125/**
130 * One day. 126 * One day.
131 */ 127 */
132#define GNUNET_TIME_UNIT_DAYS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 24) 128#define GNUNET_TIME_UNIT_DAYS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 24)
133 129
134/** 130/**
135 * One week. 131 * One week.
136 */ 132 */
137#define GNUNET_TIME_UNIT_WEEKS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 7) 133#define GNUNET_TIME_UNIT_WEEKS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 7)
138 134
139/** 135/**
140 * One month (30 days). 136 * One month (30 days).
141 */ 137 */
142#define GNUNET_TIME_UNIT_MONTHS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 30) 138#define GNUNET_TIME_UNIT_MONTHS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 30)
143 139
144/** 140/**
145 * One year (365 days). 141 * One year (365 days).
146 */ 142 */
147#define GNUNET_TIME_UNIT_YEARS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 365) 143#define GNUNET_TIME_UNIT_YEARS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 365)
148 144
149/** 145/**
150 * Constant used to specify "forever". This constant 146 * Constant used to specify "forever". This constant
151 * will be treated specially in all time operations. 147 * will be treated specially in all time operations.
152 */ 148 */
153#define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever_ () 149#define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever_()
154 150
155/** 151/**
156 * Constant used to specify "forever". This constant 152 * Constant used to specify "forever". This constant
157 * will be treated specially in all time operations. 153 * will be treated specially in all time operations.
158 */ 154 */
159#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ () 155#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_()
160 156
161 157
162 158
163/** 159/**
164 * Threshold after which exponential backoff should not increase (15 m). 160 * Threshold after which exponential backoff should not increase (15 m).
165 */ 161 */
166#define GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) 162#define GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 15)
167 163
168 164
169/** 165/**
@@ -172,8 +168,8 @@ GNUNET_NETWORK_STRUCT_END
172 * 168 *
173 * @param r current backoff time, initially zero 169 * @param r current backoff time, initially zero
174 */ 170 */
175#define GNUNET_TIME_STD_BACKOFF(r) GNUNET_TIME_relative_min (GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD, \ 171#define GNUNET_TIME_STD_BACKOFF(r) GNUNET_TIME_relative_min(GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD, \
176 GNUNET_TIME_relative_multiply (GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, (r)), 2)); 172 GNUNET_TIME_relative_multiply(GNUNET_TIME_relative_max(GNUNET_TIME_UNIT_MILLISECONDS, (r)), 2));
177 173
178 174
179/** 175/**
@@ -191,10 +187,10 @@ GNUNET_TIME_randomized_backoff(struct GNUNET_TIME_Relative rt, struct GNUNET_TIM
191 187
192/** 188/**
193 * Return a random time value between 0.5*r and 1.5*r. 189 * Return a random time value between 0.5*r and 1.5*r.
194 * 190 *
195 * @param r input time for scaling 191 * @param r input time for scaling
196 * @return randomized time 192 * @return randomized time
197 */ 193 */
198struct GNUNET_TIME_Relative 194struct GNUNET_TIME_Relative
199GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r); 195GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r);
200 196
@@ -203,63 +199,63 @@ GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r);
203 * Return relative time of 0ms. 199 * Return relative time of 0ms.
204 */ 200 */
205struct GNUNET_TIME_Relative 201struct GNUNET_TIME_Relative
206GNUNET_TIME_relative_get_zero_ (void); 202GNUNET_TIME_relative_get_zero_(void);
207 203
208 204
209/** 205/**
210 * Return absolute time of 0ms. 206 * Return absolute time of 0ms.
211 */ 207 */
212struct GNUNET_TIME_Absolute 208struct GNUNET_TIME_Absolute
213GNUNET_TIME_absolute_get_zero_ (void); 209GNUNET_TIME_absolute_get_zero_(void);
214 210
215 211
216/** 212/**
217 * Return relative time of 1 microsecond. 213 * Return relative time of 1 microsecond.
218 */ 214 */
219struct GNUNET_TIME_Relative 215struct GNUNET_TIME_Relative
220GNUNET_TIME_relative_get_unit_ (void); 216GNUNET_TIME_relative_get_unit_(void);
221 217
222 218
223/** 219/**
224 * Return relative time of 1ms. 220 * Return relative time of 1ms.
225 */ 221 */
226struct GNUNET_TIME_Relative 222struct GNUNET_TIME_Relative
227GNUNET_TIME_relative_get_millisecond_ (void); 223GNUNET_TIME_relative_get_millisecond_(void);
228 224
229 225
230/** 226/**
231 * Return relative time of 1s. 227 * Return relative time of 1s.
232 */ 228 */
233struct GNUNET_TIME_Relative 229struct GNUNET_TIME_Relative
234GNUNET_TIME_relative_get_second_ (void); 230GNUNET_TIME_relative_get_second_(void);
235 231
236 232
237/** 233/**
238 * Return relative time of 1 minute. 234 * Return relative time of 1 minute.
239 */ 235 */
240struct GNUNET_TIME_Relative 236struct GNUNET_TIME_Relative
241GNUNET_TIME_relative_get_minute_ (void); 237GNUNET_TIME_relative_get_minute_(void);
242 238
243 239
244/** 240/**
245 * Return relative time of 1 hour. 241 * Return relative time of 1 hour.
246 */ 242 */
247struct GNUNET_TIME_Relative 243struct GNUNET_TIME_Relative
248GNUNET_TIME_relative_get_hour_ (void); 244GNUNET_TIME_relative_get_hour_(void);
249 245
250 246
251/** 247/**
252 * Return "forever". 248 * Return "forever".
253 */ 249 */
254struct GNUNET_TIME_Relative 250struct GNUNET_TIME_Relative
255GNUNET_TIME_relative_get_forever_ (void); 251GNUNET_TIME_relative_get_forever_(void);
256 252
257 253
258/** 254/**
259 * Return "forever". 255 * Return "forever".
260 */ 256 */
261struct GNUNET_TIME_Absolute 257struct GNUNET_TIME_Absolute
262GNUNET_TIME_absolute_get_forever_ (void); 258GNUNET_TIME_absolute_get_forever_(void);
263 259
264 260
265/** 261/**
@@ -268,7 +264,7 @@ GNUNET_TIME_absolute_get_forever_ (void);
268 * @return the current time 264 * @return the current time
269 */ 265 */
270struct GNUNET_TIME_Absolute 266struct GNUNET_TIME_Absolute
271GNUNET_TIME_absolute_get (void); 267GNUNET_TIME_absolute_get(void);
272 268
273 269
274/** 270/**
@@ -279,7 +275,7 @@ GNUNET_TIME_absolute_get (void);
279 * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) 275 * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow)
280 */ 276 */
281struct GNUNET_TIME_Absolute 277struct GNUNET_TIME_Absolute
282GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel); 278GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel);
283 279
284 280
285/** 281/**
@@ -291,7 +287,7 @@ GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel);
291 * it was just now rounded 287 * it was just now rounded
292 */ 288 */
293int 289int
294GNUNET_TIME_round_abs (struct GNUNET_TIME_Absolute *at); 290GNUNET_TIME_round_abs(struct GNUNET_TIME_Absolute *at);
295 291
296 292
297/** 293/**
@@ -303,7 +299,7 @@ GNUNET_TIME_round_abs (struct GNUNET_TIME_Absolute *at);
303 * it was just now rounded 299 * it was just now rounded
304 */ 300 */
305int 301int
306GNUNET_TIME_round_rel (struct GNUNET_TIME_Relative *rt); 302GNUNET_TIME_round_rel(struct GNUNET_TIME_Relative *rt);
307 303
308 304
309/** 305/**
@@ -314,8 +310,8 @@ GNUNET_TIME_round_rel (struct GNUNET_TIME_Relative *rt);
314 * @return timestamp that is smaller 310 * @return timestamp that is smaller
315 */ 311 */
316struct GNUNET_TIME_Relative 312struct GNUNET_TIME_Relative
317GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1, 313GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1,
318 struct GNUNET_TIME_Relative t2); 314 struct GNUNET_TIME_Relative t2);
319 315
320 316
321 317
@@ -327,8 +323,8 @@ GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1,
327 * @return timestamp that is larger 323 * @return timestamp that is larger
328 */ 324 */
329struct GNUNET_TIME_Relative 325struct GNUNET_TIME_Relative
330GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1, 326GNUNET_TIME_relative_max(struct GNUNET_TIME_Relative t1,
331 struct GNUNET_TIME_Relative t2); 327 struct GNUNET_TIME_Relative t2);
332 328
333 329
334/** 330/**
@@ -339,8 +335,8 @@ GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1,
339 * @return timestamp that is smaller 335 * @return timestamp that is smaller
340 */ 336 */
341struct GNUNET_TIME_Absolute 337struct GNUNET_TIME_Absolute
342GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1, 338GNUNET_TIME_absolute_min(struct GNUNET_TIME_Absolute t1,
343 struct GNUNET_TIME_Absolute t2); 339 struct GNUNET_TIME_Absolute t2);
344 340
345 341
346/** 342/**
@@ -351,8 +347,8 @@ GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1,
351 * @return timestamp that is smaller 347 * @return timestamp that is smaller
352 */ 348 */
353struct GNUNET_TIME_Absolute 349struct GNUNET_TIME_Absolute
354GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, 350GNUNET_TIME_absolute_max(struct GNUNET_TIME_Absolute t1,
355 struct GNUNET_TIME_Absolute t2); 351 struct GNUNET_TIME_Absolute t2);
356 352
357 353
358/** 354/**
@@ -363,7 +359,7 @@ GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1,
363 * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. 359 * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER.
364 */ 360 */
365struct GNUNET_TIME_Relative 361struct GNUNET_TIME_Relative
366GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); 362GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future);
367 363
368 364
369/** 365/**
@@ -377,9 +373,9 @@ GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future);
377 * assuming it continues at the same speed 373 * assuming it continues at the same speed
378 */ 374 */
379struct GNUNET_TIME_Relative 375struct GNUNET_TIME_Relative
380GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, 376GNUNET_TIME_calculate_eta(struct GNUNET_TIME_Absolute start,
381 uint64_t finished, 377 uint64_t finished,
382 uint64_t total); 378 uint64_t total);
383 379
384 380
385/** 381/**
@@ -392,8 +388,8 @@ GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start,
392 * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start 388 * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start
393 */ 389 */
394struct GNUNET_TIME_Relative 390struct GNUNET_TIME_Relative
395GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, 391GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start,
396 struct GNUNET_TIME_Absolute end); 392 struct GNUNET_TIME_Absolute end);
397 393
398 394
399/** 395/**
@@ -404,7 +400,7 @@ GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start,
404 * @return 0 if hence > now, otherwise now-hence. 400 * @return 0 if hence > now, otherwise now-hence.
405 */ 401 */
406struct GNUNET_TIME_Relative 402struct GNUNET_TIME_Relative
407GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence); 403GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence);
408 404
409 405
410/** 406/**
@@ -416,8 +412,8 @@ GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence);
416 * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise 412 * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise
417 */ 413 */
418struct GNUNET_TIME_Absolute 414struct GNUNET_TIME_Absolute
419GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start, 415GNUNET_TIME_absolute_add(struct GNUNET_TIME_Absolute start,
420 struct GNUNET_TIME_Relative duration); 416 struct GNUNET_TIME_Relative duration);
421 417
422 418
423/** 419/**
@@ -429,8 +425,8 @@ GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start,
429 * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise 425 * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise
430 */ 426 */
431struct GNUNET_TIME_Absolute 427struct GNUNET_TIME_Absolute
432GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start, 428GNUNET_TIME_absolute_subtract(struct GNUNET_TIME_Absolute start,
433 struct GNUNET_TIME_Relative duration); 429 struct GNUNET_TIME_Relative duration);
434 430
435 431
436/** 432/**
@@ -441,8 +437,8 @@ GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start,
441 * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor 437 * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
442 */ 438 */
443struct GNUNET_TIME_Relative 439struct GNUNET_TIME_Relative
444GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, 440GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel,
445 unsigned long long factor); 441 unsigned long long factor);
446 442
447 443
448/** 444/**
@@ -453,8 +449,8 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
453 * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor 449 * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
454 */ 450 */
455struct GNUNET_TIME_Relative 451struct GNUNET_TIME_Relative
456GNUNET_TIME_relative_saturating_multiply (struct GNUNET_TIME_Relative rel, 452GNUNET_TIME_relative_saturating_multiply(struct GNUNET_TIME_Relative rel,
457 unsigned long long factor); 453 unsigned long long factor);
458 454
459 455
460/** 456/**
@@ -465,8 +461,8 @@ GNUNET_TIME_relative_saturating_multiply (struct GNUNET_TIME_Relative rel,
465 * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor 461 * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor
466 */ 462 */
467struct GNUNET_TIME_Relative 463struct GNUNET_TIME_Relative
468GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, 464GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel,
469 unsigned long long factor); 465 unsigned long long factor);
470 466
471 467
472/** 468/**
@@ -477,8 +473,8 @@ GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
477 * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise 473 * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise
478 */ 474 */
479struct GNUNET_TIME_Relative 475struct GNUNET_TIME_Relative
480GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, 476GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1,
481 struct GNUNET_TIME_Relative a2); 477 struct GNUNET_TIME_Relative a2);
482 478
483 479
484/** 480/**
@@ -489,8 +485,8 @@ GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1,
489 * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise 485 * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise
490 */ 486 */
491struct GNUNET_TIME_Relative 487struct GNUNET_TIME_Relative
492GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, 488GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1,
493 struct GNUNET_TIME_Relative a2); 489 struct GNUNET_TIME_Relative a2);
494 490
495 491
496/** 492/**
@@ -500,7 +496,7 @@ GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1,
500 * @return converted time value 496 * @return converted time value
501 */ 497 */
502struct GNUNET_TIME_RelativeNBO 498struct GNUNET_TIME_RelativeNBO
503GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a); 499GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a);
504 500
505 501
506/** 502/**
@@ -510,7 +506,7 @@ GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a);
510 * @return converted time value 506 * @return converted time value
511 */ 507 */
512struct GNUNET_TIME_Relative 508struct GNUNET_TIME_Relative
513GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a); 509GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a);
514 510
515 511
516/** 512/**
@@ -520,7 +516,7 @@ GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a);
520 * @return converted time value 516 * @return converted time value
521 */ 517 */
522struct GNUNET_TIME_AbsoluteNBO 518struct GNUNET_TIME_AbsoluteNBO
523GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a); 519GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a);
524 520
525 521
526/** 522/**
@@ -530,7 +526,7 @@ GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a);
530 * @return converted time value 526 * @return converted time value
531 */ 527 */
532struct GNUNET_TIME_Absolute 528struct GNUNET_TIME_Absolute
533GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a); 529GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a);
534 530
535 531
536/** 532/**
@@ -539,7 +535,7 @@ GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a);
539 * @param offset the offset to skew the locale time by 535 * @param offset the offset to skew the locale time by
540 */ 536 */
541void 537void
542GNUNET_TIME_set_offset (long long offset); 538GNUNET_TIME_set_offset(long long offset);
543 539
544 540
545/** 541/**
@@ -548,14 +544,14 @@ GNUNET_TIME_set_offset (long long offset);
548 * @return the offset we currently skew the locale time by 544 * @return the offset we currently skew the locale time by
549 */ 545 */
550long long 546long long
551GNUNET_TIME_get_offset (void); 547GNUNET_TIME_get_offset(void);
552 548
553 549
554/** 550/**
555 * Return the current year (i.e. '2011'). 551 * Return the current year (i.e. '2011').
556 */ 552 */
557unsigned int 553unsigned int
558GNUNET_TIME_get_current_year (void); 554GNUNET_TIME_get_current_year(void);
559 555
560 556
561/** 557/**
@@ -565,7 +561,7 @@ GNUNET_TIME_get_current_year (void);
565 * @return absolute time for January 1st of that year. 561 * @return absolute time for January 1st of that year.
566 */ 562 */
567struct GNUNET_TIME_Absolute 563struct GNUNET_TIME_Absolute
568GNUNET_TIME_year_to_time (unsigned int year); 564GNUNET_TIME_year_to_time(unsigned int year);
569 565
570 566
571/** 567/**
@@ -575,7 +571,7 @@ GNUNET_TIME_year_to_time (unsigned int year);
575 * @return year a year (after 1970), 0 on error 571 * @return year a year (after 1970), 0 on error
576 */ 572 */
577unsigned int 573unsigned int
578GNUNET_TIME_time_to_year (struct GNUNET_TIME_Absolute at); 574GNUNET_TIME_time_to_year(struct GNUNET_TIME_Absolute at);
579 575
580 576
581/** 577/**
@@ -603,7 +599,7 @@ struct GNUNET_CONFIGURATION_Handle;
603 * @return monotonically increasing time 599 * @return monotonically increasing time
604 */ 600 */
605struct GNUNET_TIME_Absolute 601struct GNUNET_TIME_Absolute
606GNUNET_TIME_absolute_get_monotonic (const struct GNUNET_CONFIGURATION_Handle *cfg); 602GNUNET_TIME_absolute_get_monotonic(const struct GNUNET_CONFIGURATION_Handle *cfg);
607 603
608 604
609#if 0 /* keep Emacsens' auto-indent happy */ 605#if 0 /* keep Emacsens' auto-indent happy */