diff options
Diffstat (limited to 'src/include/gnunet_time_lib.h')
-rw-r--r-- | src/include/gnunet_time_lib.h | 140 |
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 | */ |
48 | struct GNUNET_TIME_Absolute | 48 | struct 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 | */ |
60 | struct GNUNET_TIME_Relative | 59 | struct 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 | */ |
73 | struct GNUNET_TIME_RelativeNBO | 71 | struct 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 | */ |
85 | struct GNUNET_TIME_AbsoluteNBO | 82 | struct 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 | */ |
198 | struct GNUNET_TIME_Relative | 194 | struct GNUNET_TIME_Relative |
199 | GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r); | 195 | GNUNET_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 | */ |
205 | struct GNUNET_TIME_Relative | 201 | struct GNUNET_TIME_Relative |
206 | GNUNET_TIME_relative_get_zero_ (void); | 202 | GNUNET_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 | */ |
212 | struct GNUNET_TIME_Absolute | 208 | struct GNUNET_TIME_Absolute |
213 | GNUNET_TIME_absolute_get_zero_ (void); | 209 | GNUNET_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 | */ |
219 | struct GNUNET_TIME_Relative | 215 | struct GNUNET_TIME_Relative |
220 | GNUNET_TIME_relative_get_unit_ (void); | 216 | GNUNET_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 | */ |
226 | struct GNUNET_TIME_Relative | 222 | struct GNUNET_TIME_Relative |
227 | GNUNET_TIME_relative_get_millisecond_ (void); | 223 | GNUNET_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 | */ |
233 | struct GNUNET_TIME_Relative | 229 | struct GNUNET_TIME_Relative |
234 | GNUNET_TIME_relative_get_second_ (void); | 230 | GNUNET_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 | */ |
240 | struct GNUNET_TIME_Relative | 236 | struct GNUNET_TIME_Relative |
241 | GNUNET_TIME_relative_get_minute_ (void); | 237 | GNUNET_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 | */ |
247 | struct GNUNET_TIME_Relative | 243 | struct GNUNET_TIME_Relative |
248 | GNUNET_TIME_relative_get_hour_ (void); | 244 | GNUNET_TIME_relative_get_hour_(void); |
249 | 245 | ||
250 | 246 | ||
251 | /** | 247 | /** |
252 | * Return "forever". | 248 | * Return "forever". |
253 | */ | 249 | */ |
254 | struct GNUNET_TIME_Relative | 250 | struct GNUNET_TIME_Relative |
255 | GNUNET_TIME_relative_get_forever_ (void); | 251 | GNUNET_TIME_relative_get_forever_(void); |
256 | 252 | ||
257 | 253 | ||
258 | /** | 254 | /** |
259 | * Return "forever". | 255 | * Return "forever". |
260 | */ | 256 | */ |
261 | struct GNUNET_TIME_Absolute | 257 | struct GNUNET_TIME_Absolute |
262 | GNUNET_TIME_absolute_get_forever_ (void); | 258 | GNUNET_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 | */ |
270 | struct GNUNET_TIME_Absolute | 266 | struct GNUNET_TIME_Absolute |
271 | GNUNET_TIME_absolute_get (void); | 267 | GNUNET_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 | */ |
281 | struct GNUNET_TIME_Absolute | 277 | struct GNUNET_TIME_Absolute |
282 | GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel); | 278 | GNUNET_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 | */ |
293 | int | 289 | int |
294 | GNUNET_TIME_round_abs (struct GNUNET_TIME_Absolute *at); | 290 | GNUNET_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 | */ |
305 | int | 301 | int |
306 | GNUNET_TIME_round_rel (struct GNUNET_TIME_Relative *rt); | 302 | GNUNET_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 | */ |
316 | struct GNUNET_TIME_Relative | 312 | struct GNUNET_TIME_Relative |
317 | GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1, | 313 | GNUNET_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 | */ |
329 | struct GNUNET_TIME_Relative | 325 | struct GNUNET_TIME_Relative |
330 | GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1, | 326 | GNUNET_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 | */ |
341 | struct GNUNET_TIME_Absolute | 337 | struct GNUNET_TIME_Absolute |
342 | GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1, | 338 | GNUNET_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 | */ |
353 | struct GNUNET_TIME_Absolute | 349 | struct GNUNET_TIME_Absolute |
354 | GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, | 350 | GNUNET_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 | */ |
365 | struct GNUNET_TIME_Relative | 361 | struct GNUNET_TIME_Relative |
366 | GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); | 362 | GNUNET_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 | */ |
379 | struct GNUNET_TIME_Relative | 375 | struct GNUNET_TIME_Relative |
380 | GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, | 376 | GNUNET_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 | */ |
394 | struct GNUNET_TIME_Relative | 390 | struct GNUNET_TIME_Relative |
395 | GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, | 391 | GNUNET_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 | */ |
406 | struct GNUNET_TIME_Relative | 402 | struct GNUNET_TIME_Relative |
407 | GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence); | 403 | GNUNET_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 | */ |
418 | struct GNUNET_TIME_Absolute | 414 | struct GNUNET_TIME_Absolute |
419 | GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start, | 415 | GNUNET_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 | */ |
431 | struct GNUNET_TIME_Absolute | 427 | struct GNUNET_TIME_Absolute |
432 | GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start, | 428 | GNUNET_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 | */ |
443 | struct GNUNET_TIME_Relative | 439 | struct GNUNET_TIME_Relative |
444 | GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, | 440 | GNUNET_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 | */ |
455 | struct GNUNET_TIME_Relative | 451 | struct GNUNET_TIME_Relative |
456 | GNUNET_TIME_relative_saturating_multiply (struct GNUNET_TIME_Relative rel, | 452 | GNUNET_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 | */ |
467 | struct GNUNET_TIME_Relative | 463 | struct GNUNET_TIME_Relative |
468 | GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, | 464 | GNUNET_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 | */ |
479 | struct GNUNET_TIME_Relative | 475 | struct GNUNET_TIME_Relative |
480 | GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, | 476 | GNUNET_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 | */ |
491 | struct GNUNET_TIME_Relative | 487 | struct GNUNET_TIME_Relative |
492 | GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, | 488 | GNUNET_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 | */ |
502 | struct GNUNET_TIME_RelativeNBO | 498 | struct GNUNET_TIME_RelativeNBO |
503 | GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a); | 499 | GNUNET_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 | */ |
512 | struct GNUNET_TIME_Relative | 508 | struct GNUNET_TIME_Relative |
513 | GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a); | 509 | GNUNET_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 | */ |
522 | struct GNUNET_TIME_AbsoluteNBO | 518 | struct GNUNET_TIME_AbsoluteNBO |
523 | GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a); | 519 | GNUNET_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 | */ |
532 | struct GNUNET_TIME_Absolute | 528 | struct GNUNET_TIME_Absolute |
533 | GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a); | 529 | GNUNET_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 | */ |
541 | void | 537 | void |
542 | GNUNET_TIME_set_offset (long long offset); | 538 | GNUNET_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 | */ |
550 | long long | 546 | long long |
551 | GNUNET_TIME_get_offset (void); | 547 | GNUNET_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 | */ |
557 | unsigned int | 553 | unsigned int |
558 | GNUNET_TIME_get_current_year (void); | 554 | GNUNET_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 | */ |
567 | struct GNUNET_TIME_Absolute | 563 | struct GNUNET_TIME_Absolute |
568 | GNUNET_TIME_year_to_time (unsigned int year); | 564 | GNUNET_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 | */ |
577 | unsigned int | 573 | unsigned int |
578 | GNUNET_TIME_time_to_year (struct GNUNET_TIME_Absolute at); | 574 | GNUNET_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 | */ |
605 | struct GNUNET_TIME_Absolute | 601 | struct GNUNET_TIME_Absolute |
606 | GNUNET_TIME_absolute_get_monotonic (const struct GNUNET_CONFIGURATION_Handle *cfg); | 602 | GNUNET_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 */ |