diff options
Diffstat (limited to 'src/include/gnunet_scheduler_lib.h')
-rw-r--r-- | src/include/gnunet_scheduler_lib.h | 214 |
1 files changed, 101 insertions, 113 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index 3f0350f54..39b16a1b4 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
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 | ||
@@ -52,8 +52,7 @@ struct GNUNET_SCHEDULER_Task; | |||
52 | * Reasons why the schedule may have triggered | 52 | * Reasons why the schedule may have triggered |
53 | * the task now. | 53 | * the task now. |
54 | */ | 54 | */ |
55 | enum GNUNET_SCHEDULER_Reason | 55 | enum GNUNET_SCHEDULER_Reason { |
56 | { | ||
57 | /** | 56 | /** |
58 | * This task is not ready. | 57 | * This task is not ready. |
59 | */ | 58 | */ |
@@ -100,9 +99,7 @@ enum GNUNET_SCHEDULER_Reason | |||
100 | * Possible events on FDs, used as a bitmask. | 99 | * Possible events on FDs, used as a bitmask. |
101 | * Modelled after GPollFD. | 100 | * Modelled after GPollFD. |
102 | */ | 101 | */ |
103 | enum GNUNET_SCHEDULER_EventType | 102 | enum GNUNET_SCHEDULER_EventType { |
104 | { | ||
105 | |||
106 | /** | 103 | /** |
107 | * No event (useful for timeout). | 104 | * No event (useful for timeout). |
108 | */ | 105 | */ |
@@ -137,16 +134,13 @@ enum GNUNET_SCHEDULER_EventType | |||
137 | * | 134 | * |
138 | */ | 135 | */ |
139 | GNUNET_SCHEDULER_ET_NVAL = 32 | 136 | GNUNET_SCHEDULER_ET_NVAL = 32 |
140 | |||
141 | }; | 137 | }; |
142 | 138 | ||
143 | 139 | ||
144 | /** | 140 | /** |
145 | * Information about an event relating to a file descriptor/socket. | 141 | * Information about an event relating to a file descriptor/socket. |
146 | */ | 142 | */ |
147 | struct GNUNET_SCHEDULER_FdInfo | 143 | struct GNUNET_SCHEDULER_FdInfo { |
148 | { | ||
149 | |||
150 | /** | 144 | /** |
151 | * GNUnet network socket the event is about, matches @a sock, | 145 | * GNUnet network socket the event is about, matches @a sock, |
152 | * NULL if this is about a file handle or if no network | 146 | * NULL if this is about a file handle or if no network |
@@ -170,15 +164,13 @@ struct GNUNET_SCHEDULER_FdInfo | |||
170 | * Underlying OS handle the event was about. | 164 | * Underlying OS handle the event was about. |
171 | */ | 165 | */ |
172 | int sock; | 166 | int sock; |
173 | |||
174 | }; | 167 | }; |
175 | 168 | ||
176 | 169 | ||
177 | /** | 170 | /** |
178 | * Context information passed to each scheduler task. | 171 | * Context information passed to each scheduler task. |
179 | */ | 172 | */ |
180 | struct GNUNET_SCHEDULER_TaskContext | 173 | struct GNUNET_SCHEDULER_TaskContext { |
181 | { | ||
182 | /** | 174 | /** |
183 | * Reason why the task is run now | 175 | * Reason why the task is run now |
184 | */ | 176 | */ |
@@ -210,7 +202,6 @@ struct GNUNET_SCHEDULER_TaskContext | |||
210 | * @deprecated | 202 | * @deprecated |
211 | */ | 203 | */ |
212 | const struct GNUNET_NETWORK_FDSet *write_ready; | 204 | const struct GNUNET_NETWORK_FDSet *write_ready; |
213 | |||
214 | }; | 205 | }; |
215 | 206 | ||
216 | 207 | ||
@@ -228,8 +219,8 @@ struct GNUNET_SCHEDULER_TaskContext | |||
228 | * @param fdi information about the related FD | 219 | * @param fdi information about the related FD |
229 | */ | 220 | */ |
230 | void | 221 | void |
231 | GNUNET_SCHEDULER_task_ready (struct GNUNET_SCHEDULER_Task *task, | 222 | GNUNET_SCHEDULER_task_ready(struct GNUNET_SCHEDULER_Task *task, |
232 | struct GNUNET_SCHEDULER_FdInfo *fdi); | 223 | struct GNUNET_SCHEDULER_FdInfo *fdi); |
233 | 224 | ||
234 | 225 | ||
235 | /** | 226 | /** |
@@ -241,7 +232,7 @@ struct GNUNET_SCHEDULER_Handle; | |||
241 | /** | 232 | /** |
242 | * Function called by external event loop implementations to tell the | 233 | * Function called by external event loop implementations to tell the |
243 | * scheduler to run some of the tasks that are ready. Must be called | 234 | * scheduler to run some of the tasks that are ready. Must be called |
244 | * only after #GNUNET_SCHEDULER_driver_init has been called and before | 235 | * only after #GNUNET_SCHEDULER_driver_init has been called and before |
245 | * #GNUNET_SCHEDULER_driver_done is called. | 236 | * #GNUNET_SCHEDULER_driver_done is called. |
246 | * This function may return even though there are tasks left to run | 237 | * This function may return even though there are tasks left to run |
247 | * just to give other tasks a chance as well. If we return #GNUNET_YES, | 238 | * just to give other tasks a chance as well. If we return #GNUNET_YES, |
@@ -259,23 +250,21 @@ struct GNUNET_SCHEDULER_Handle; | |||
259 | * if we are done running tasks (yield to block) | 250 | * if we are done running tasks (yield to block) |
260 | */ | 251 | */ |
261 | int | 252 | int |
262 | GNUNET_SCHEDULER_do_work (struct GNUNET_SCHEDULER_Handle *sh); | 253 | GNUNET_SCHEDULER_do_work(struct GNUNET_SCHEDULER_Handle *sh); |
263 | 254 | ||
264 | 255 | ||
265 | /** | 256 | /** |
266 | * API an external event loop has to implement for | 257 | * API an external event loop has to implement for |
267 | * #GNUNET_SCHEDULER_driver_init. | 258 | * #GNUNET_SCHEDULER_driver_init. |
268 | */ | 259 | */ |
269 | struct GNUNET_SCHEDULER_Driver | 260 | struct GNUNET_SCHEDULER_Driver { |
270 | { | ||
271 | |||
272 | /** | 261 | /** |
273 | * Closure to pass to the functions in this struct. | 262 | * Closure to pass to the functions in this struct. |
274 | */ | 263 | */ |
275 | void *cls; | 264 | void *cls; |
276 | 265 | ||
277 | /** | 266 | /** |
278 | * Add a @a task to be run if the conditions specified in the | 267 | * Add a @a task to be run if the conditions specified in the |
279 | * et field of the given @a fdi are satisfied. The et field will | 268 | * et field of the given @a fdi are satisfied. The et field will |
280 | * be cleared after this call and the driver is expected to set | 269 | * be cleared after this call and the driver is expected to set |
281 | * the type of the actual event before passing @a fdi to | 270 | * the type of the actual event before passing @a fdi to |
@@ -289,7 +278,7 @@ struct GNUNET_SCHEDULER_Driver | |||
289 | */ | 278 | */ |
290 | int | 279 | int |
291 | (*add)(void *cls, | 280 | (*add)(void *cls, |
292 | struct GNUNET_SCHEDULER_Task *task, | 281 | struct GNUNET_SCHEDULER_Task *task, |
293 | struct GNUNET_SCHEDULER_FdInfo *fdi); | 282 | struct GNUNET_SCHEDULER_FdInfo *fdi); |
294 | 283 | ||
295 | /** | 284 | /** |
@@ -304,7 +293,7 @@ struct GNUNET_SCHEDULER_Driver | |||
304 | */ | 293 | */ |
305 | int | 294 | int |
306 | (*del)(void *cls, | 295 | (*del)(void *cls, |
307 | struct GNUNET_SCHEDULER_Task *task); | 296 | struct GNUNET_SCHEDULER_Task *task); |
308 | 297 | ||
309 | /** | 298 | /** |
310 | * Set time at which we definitively want to get a wakeup call. | 299 | * Set time at which we definitively want to get a wakeup call. |
@@ -314,8 +303,7 @@ struct GNUNET_SCHEDULER_Driver | |||
314 | */ | 303 | */ |
315 | void | 304 | void |
316 | (*set_wakeup)(void *cls, | 305 | (*set_wakeup)(void *cls, |
317 | struct GNUNET_TIME_Absolute dt); | 306 | struct GNUNET_TIME_Absolute dt); |
318 | |||
319 | }; | 307 | }; |
320 | 308 | ||
321 | 309 | ||
@@ -332,7 +320,7 @@ typedef void | |||
332 | * Function called by external event loop implementations to initialize | 320 | * Function called by external event loop implementations to initialize |
333 | * the scheduler. An external implementation has to provide @a driver | 321 | * the scheduler. An external implementation has to provide @a driver |
334 | * which contains callbacks for the scheduler (see definition of struct | 322 | * which contains callbacks for the scheduler (see definition of struct |
335 | * #GNUNET_SCHEDULER_Driver). The callbacks are used to instruct the | 323 | * #GNUNET_SCHEDULER_Driver). The callbacks are used to instruct the |
336 | * external implementation to watch for events. If it detects any of | 324 | * external implementation to watch for events. If it detects any of |
337 | * those events it is expected to call #GNUNET_SCHEDULER_do_work to let | 325 | * those events it is expected to call #GNUNET_SCHEDULER_do_work to let |
338 | * the scheduler handle it. If an event is related to a specific task | 326 | * the scheduler handle it. If an event is related to a specific task |
@@ -341,11 +329,11 @@ typedef void | |||
341 | * before by calling #GNUNET_SCHEDULER_task_ready. | 329 | * before by calling #GNUNET_SCHEDULER_task_ready. |
342 | * | 330 | * |
343 | * This function has to be called before any tasks are scheduled and | 331 | * This function has to be called before any tasks are scheduled and |
344 | * before GNUNET_SCHEDULER_do_work is called for the first time. It | 332 | * before GNUNET_SCHEDULER_do_work is called for the first time. It |
345 | * allocates resources that have to be freed again by calling | 333 | * allocates resources that have to be freed again by calling |
346 | * #GNUNET_SCHEDULER_driver_done. | 334 | * #GNUNET_SCHEDULER_driver_done. |
347 | * | 335 | * |
348 | * This function installs the same signal handlers as | 336 | * This function installs the same signal handlers as |
349 | * #GNUNET_SCHEDULER_run. This means SIGTERM (and other similar signals) | 337 | * #GNUNET_SCHEDULER_run. This means SIGTERM (and other similar signals) |
350 | * will induce a call to #GNUNET_SCHEDULER_shutdown during the next | 338 | * will induce a call to #GNUNET_SCHEDULER_shutdown during the next |
351 | * call to #GNUNET_SCHEDULER_do_work. As a result, SIGTERM causes all | 339 | * call to #GNUNET_SCHEDULER_do_work. As a result, SIGTERM causes all |
@@ -360,7 +348,7 @@ typedef void | |||
360 | * #GNUNET_SCHEDULER_driver_done | 348 | * #GNUNET_SCHEDULER_driver_done |
361 | */ | 349 | */ |
362 | struct GNUNET_SCHEDULER_Handle * | 350 | struct GNUNET_SCHEDULER_Handle * |
363 | GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver); | 351 | GNUNET_SCHEDULER_driver_init(const struct GNUNET_SCHEDULER_Driver *driver); |
364 | 352 | ||
365 | 353 | ||
366 | /** | 354 | /** |
@@ -368,7 +356,7 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver); | |||
368 | * by external event loop implementations after the scheduler has | 356 | * by external event loop implementations after the scheduler has |
369 | * shut down. This is the case if both of the following conditions | 357 | * shut down. This is the case if both of the following conditions |
370 | * are met: | 358 | * are met: |
371 | * | 359 | * |
372 | * - all tasks the scheduler has added through the driver's add | 360 | * - all tasks the scheduler has added through the driver's add |
373 | * callback have been removed again through the driver's del | 361 | * callback have been removed again through the driver's del |
374 | * callback | 362 | * callback |
@@ -378,7 +366,7 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver); | |||
378 | * @param sh the handle returned by #GNUNET_SCHEDULER_driver_init | 366 | * @param sh the handle returned by #GNUNET_SCHEDULER_driver_init |
379 | */ | 367 | */ |
380 | void | 368 | void |
381 | GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh); | 369 | GNUNET_SCHEDULER_driver_done(struct GNUNET_SCHEDULER_Handle *sh); |
382 | 370 | ||
383 | 371 | ||
384 | /** | 372 | /** |
@@ -387,7 +375,7 @@ GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh); | |||
387 | * @return NULL on error | 375 | * @return NULL on error |
388 | */ | 376 | */ |
389 | struct GNUNET_SCHEDULER_Driver * | 377 | struct GNUNET_SCHEDULER_Driver * |
390 | GNUNET_SCHEDULER_driver_select (void); | 378 | GNUNET_SCHEDULER_driver_select(void); |
391 | 379 | ||
392 | 380 | ||
393 | /** | 381 | /** |
@@ -424,8 +412,8 @@ typedef int | |||
424 | * @param task_cls closure of @a task | 412 | * @param task_cls closure of @a task |
425 | */ | 413 | */ |
426 | void | 414 | void |
427 | GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task, | 415 | GNUNET_SCHEDULER_run(GNUNET_SCHEDULER_TaskCallback task, |
428 | void *task_cls); | 416 | void *task_cls); |
429 | 417 | ||
430 | /** | 418 | /** |
431 | * Initialize and run scheduler. This function will return when all | 419 | * Initialize and run scheduler. This function will return when all |
@@ -439,9 +427,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task, | |||
439 | * @param task_cls closure of @a task | 427 | * @param task_cls closure of @a task |
440 | */ | 428 | */ |
441 | void | 429 | void |
442 | GNUNET_SCHEDULER_run_with_optional_signals (int install_signals, | 430 | GNUNET_SCHEDULER_run_with_optional_signals(int install_signals, |
443 | GNUNET_SCHEDULER_TaskCallback task, | 431 | GNUNET_SCHEDULER_TaskCallback task, |
444 | void *task_cls); | 432 | void *task_cls); |
445 | 433 | ||
446 | 434 | ||
447 | /** | 435 | /** |
@@ -451,7 +439,7 @@ GNUNET_SCHEDULER_run_with_optional_signals (int install_signals, | |||
451 | * will be delayed until the next shutdown signal. | 439 | * will be delayed until the next shutdown signal. |
452 | */ | 440 | */ |
453 | void | 441 | void |
454 | GNUNET_SCHEDULER_shutdown (void); | 442 | GNUNET_SCHEDULER_shutdown(void); |
455 | 443 | ||
456 | 444 | ||
457 | /** | 445 | /** |
@@ -466,7 +454,7 @@ GNUNET_SCHEDULER_shutdown (void); | |||
466 | * @return number of tasks pending right now | 454 | * @return number of tasks pending right now |
467 | */ | 455 | */ |
468 | unsigned int | 456 | unsigned int |
469 | GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | 457 | GNUNET_SCHEDULER_get_load(enum GNUNET_SCHEDULER_Priority p); |
470 | 458 | ||
471 | 459 | ||
472 | /** | 460 | /** |
@@ -476,7 +464,7 @@ GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | |||
476 | * @return task context with information why the current task is run | 464 | * @return task context with information why the current task is run |
477 | */ | 465 | */ |
478 | const struct GNUNET_SCHEDULER_TaskContext * | 466 | const struct GNUNET_SCHEDULER_TaskContext * |
479 | GNUNET_SCHEDULER_get_task_context (void); | 467 | GNUNET_SCHEDULER_get_task_context(void); |
480 | 468 | ||
481 | 469 | ||
482 | /** | 470 | /** |
@@ -492,7 +480,7 @@ GNUNET_SCHEDULER_get_task_context (void); | |||
492 | * @return original closure of the task | 480 | * @return original closure of the task |
493 | */ | 481 | */ |
494 | void * | 482 | void * |
495 | GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task); | 483 | GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task); |
496 | 484 | ||
497 | 485 | ||
498 | /** | 486 | /** |
@@ -506,10 +494,10 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task); | |||
506 | * @param priority priority to use for the task | 494 | * @param priority priority to use for the task |
507 | */ | 495 | */ |
508 | void | 496 | void |
509 | GNUNET_SCHEDULER_add_with_reason_and_priority (GNUNET_SCHEDULER_TaskCallback task, | 497 | GNUNET_SCHEDULER_add_with_reason_and_priority(GNUNET_SCHEDULER_TaskCallback task, |
510 | void *task_cls, | 498 | void *task_cls, |
511 | enum GNUNET_SCHEDULER_Reason reason, | 499 | enum GNUNET_SCHEDULER_Reason reason, |
512 | enum GNUNET_SCHEDULER_Priority priority); | 500 | enum GNUNET_SCHEDULER_Priority priority); |
513 | 501 | ||
514 | 502 | ||
515 | /** | 503 | /** |
@@ -522,9 +510,9 @@ GNUNET_SCHEDULER_add_with_reason_and_priority (GNUNET_SCHEDULER_TaskCallback tas | |||
522 | * only valid until @a task is started! | 510 | * only valid until @a task is started! |
523 | */ | 511 | */ |
524 | struct GNUNET_SCHEDULER_Task * | 512 | struct GNUNET_SCHEDULER_Task * |
525 | GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, | 513 | GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, |
526 | GNUNET_SCHEDULER_TaskCallback task, | 514 | GNUNET_SCHEDULER_TaskCallback task, |
527 | void *task_cls); | 515 | void *task_cls); |
528 | 516 | ||
529 | 517 | ||
530 | /** | 518 | /** |
@@ -543,8 +531,8 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, | |||
543 | * only valid until @a task is started! | 531 | * only valid until @a task is started! |
544 | */ | 532 | */ |
545 | struct GNUNET_SCHEDULER_Task * | 533 | struct GNUNET_SCHEDULER_Task * |
546 | GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_TaskCallback task, | 534 | GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, |
547 | void *task_cls); | 535 | void *task_cls); |
548 | 536 | ||
549 | 537 | ||
550 | /** | 538 | /** |
@@ -558,8 +546,8 @@ GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_TaskCallback task, | |||
558 | * only valid until @a task is started! | 546 | * only valid until @a task is started! |
559 | */ | 547 | */ |
560 | struct GNUNET_SCHEDULER_Task * | 548 | struct GNUNET_SCHEDULER_Task * |
561 | GNUNET_SCHEDULER_add_shutdown (GNUNET_SCHEDULER_TaskCallback task, | 549 | GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, |
562 | void *task_cls); | 550 | void *task_cls); |
563 | 551 | ||
564 | 552 | ||
565 | /** | 553 | /** |
@@ -577,9 +565,9 @@ GNUNET_SCHEDULER_add_shutdown (GNUNET_SCHEDULER_TaskCallback task, | |||
577 | * only valid until @a task is started! | 565 | * only valid until @a task is started! |
578 | */ | 566 | */ |
579 | struct GNUNET_SCHEDULER_Task * | 567 | struct GNUNET_SCHEDULER_Task * |
580 | GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, | 568 | GNUNET_SCHEDULER_add_now_with_lifeness(int lifeness, |
581 | GNUNET_SCHEDULER_TaskCallback task, | 569 | GNUNET_SCHEDULER_TaskCallback task, |
582 | void *task_cls); | 570 | void *task_cls); |
583 | 571 | ||
584 | 572 | ||
585 | /** | 573 | /** |
@@ -594,9 +582,9 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, | |||
594 | * only valid until @a task is started! | 582 | * only valid until @a task is started! |
595 | */ | 583 | */ |
596 | struct GNUNET_SCHEDULER_Task * | 584 | struct GNUNET_SCHEDULER_Task * |
597 | GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, | 585 | GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, |
598 | GNUNET_SCHEDULER_TaskCallback task, | 586 | GNUNET_SCHEDULER_TaskCallback task, |
599 | void *task_cls); | 587 | void *task_cls); |
600 | 588 | ||
601 | 589 | ||
602 | /** | 590 | /** |
@@ -611,9 +599,9 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, | |||
611 | * only valid until @a task is started! | 599 | * only valid until @a task is started! |
612 | */ | 600 | */ |
613 | struct GNUNET_SCHEDULER_Task * | 601 | struct GNUNET_SCHEDULER_Task * |
614 | GNUNET_SCHEDULER_add_at (struct GNUNET_TIME_Absolute at, | 602 | GNUNET_SCHEDULER_add_at(struct GNUNET_TIME_Absolute at, |
615 | GNUNET_SCHEDULER_TaskCallback task, | 603 | GNUNET_SCHEDULER_TaskCallback task, |
616 | void *task_cls); | 604 | void *task_cls); |
617 | 605 | ||
618 | 606 | ||
619 | /** | 607 | /** |
@@ -628,10 +616,10 @@ GNUNET_SCHEDULER_add_at (struct GNUNET_TIME_Absolute at, | |||
628 | * only valid until @a task is started! | 616 | * only valid until @a task is started! |
629 | */ | 617 | */ |
630 | struct GNUNET_SCHEDULER_Task * | 618 | struct GNUNET_SCHEDULER_Task * |
631 | GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, | 619 | GNUNET_SCHEDULER_add_delayed_with_priority(struct GNUNET_TIME_Relative delay, |
632 | enum GNUNET_SCHEDULER_Priority priority, | 620 | enum GNUNET_SCHEDULER_Priority priority, |
633 | GNUNET_SCHEDULER_TaskCallback task, | 621 | GNUNET_SCHEDULER_TaskCallback task, |
634 | void *task_cls); | 622 | void *task_cls); |
635 | 623 | ||
636 | 624 | ||
637 | /** | 625 | /** |
@@ -646,10 +634,10 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, | |||
646 | * only valid until @a task is started! | 634 | * only valid until @a task is started! |
647 | */ | 635 | */ |
648 | struct GNUNET_SCHEDULER_Task * | 636 | struct GNUNET_SCHEDULER_Task * |
649 | GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at, | 637 | GNUNET_SCHEDULER_add_at_with_priority(struct GNUNET_TIME_Absolute at, |
650 | enum GNUNET_SCHEDULER_Priority priority, | 638 | enum GNUNET_SCHEDULER_Priority priority, |
651 | GNUNET_SCHEDULER_TaskCallback task, | 639 | GNUNET_SCHEDULER_TaskCallback task, |
652 | void *task_cls); | 640 | void *task_cls); |
653 | 641 | ||
654 | 642 | ||
655 | /** | 643 | /** |
@@ -673,10 +661,10 @@ GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at, | |||
673 | * only valid until @a task is started! | 661 | * only valid until @a task is started! |
674 | */ | 662 | */ |
675 | struct GNUNET_SCHEDULER_Task * | 663 | struct GNUNET_SCHEDULER_Task * |
676 | GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, | 664 | GNUNET_SCHEDULER_add_read_net(struct GNUNET_TIME_Relative delay, |
677 | struct GNUNET_NETWORK_Handle *rfd, | 665 | struct GNUNET_NETWORK_Handle *rfd, |
678 | GNUNET_SCHEDULER_TaskCallback task, | 666 | GNUNET_SCHEDULER_TaskCallback task, |
679 | void *task_cls); | 667 | void *task_cls); |
680 | 668 | ||
681 | 669 | ||
682 | /** | 670 | /** |
@@ -702,11 +690,11 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, | |||
702 | * only valid until @a task is started! | 690 | * only valid until @a task is started! |
703 | */ | 691 | */ |
704 | struct GNUNET_SCHEDULER_Task * | 692 | struct GNUNET_SCHEDULER_Task * |
705 | GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay, | 693 | GNUNET_SCHEDULER_add_read_net_with_priority(struct GNUNET_TIME_Relative delay, |
706 | enum GNUNET_SCHEDULER_Priority priority, | 694 | enum GNUNET_SCHEDULER_Priority priority, |
707 | struct GNUNET_NETWORK_Handle *rfd, | 695 | struct GNUNET_NETWORK_Handle *rfd, |
708 | GNUNET_SCHEDULER_TaskCallback task, | 696 | GNUNET_SCHEDULER_TaskCallback task, |
709 | void *task_cls); | 697 | void *task_cls); |
710 | 698 | ||
711 | 699 | ||
712 | /** | 700 | /** |
@@ -731,10 +719,10 @@ GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay, | |||
731 | * only valid until @a task is started! | 719 | * only valid until @a task is started! |
732 | */ | 720 | */ |
733 | struct GNUNET_SCHEDULER_Task * | 721 | struct GNUNET_SCHEDULER_Task * |
734 | GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, | 722 | GNUNET_SCHEDULER_add_write_net(struct GNUNET_TIME_Relative delay, |
735 | struct GNUNET_NETWORK_Handle *wfd, | 723 | struct GNUNET_NETWORK_Handle *wfd, |
736 | GNUNET_SCHEDULER_TaskCallback task, | 724 | GNUNET_SCHEDULER_TaskCallback task, |
737 | void *task_cls); | 725 | void *task_cls); |
738 | 726 | ||
739 | 727 | ||
740 | /** | 728 | /** |
@@ -761,13 +749,13 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, | |||
761 | * only valid until "task" is started! | 749 | * only valid until "task" is started! |
762 | */ | 750 | */ |
763 | struct GNUNET_SCHEDULER_Task * | 751 | struct GNUNET_SCHEDULER_Task * |
764 | GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay, | 752 | GNUNET_SCHEDULER_add_net_with_priority(struct GNUNET_TIME_Relative delay, |
765 | enum GNUNET_SCHEDULER_Priority priority, | 753 | enum GNUNET_SCHEDULER_Priority priority, |
766 | struct GNUNET_NETWORK_Handle *fd, | 754 | struct GNUNET_NETWORK_Handle *fd, |
767 | int on_read, | 755 | int on_read, |
768 | int on_write, | 756 | int on_write, |
769 | GNUNET_SCHEDULER_TaskCallback task, | 757 | GNUNET_SCHEDULER_TaskCallback task, |
770 | void *task_cls); | 758 | void *task_cls); |
771 | 759 | ||
772 | 760 | ||
773 | /** | 761 | /** |
@@ -791,10 +779,10 @@ GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay, | |||
791 | * only valid until @a task is started! | 779 | * only valid until @a task is started! |
792 | */ | 780 | */ |
793 | struct GNUNET_SCHEDULER_Task * | 781 | struct GNUNET_SCHEDULER_Task * |
794 | GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, | 782 | GNUNET_SCHEDULER_add_read_file(struct GNUNET_TIME_Relative delay, |
795 | const struct GNUNET_DISK_FileHandle *rfd, | 783 | const struct GNUNET_DISK_FileHandle *rfd, |
796 | GNUNET_SCHEDULER_TaskCallback task, | 784 | GNUNET_SCHEDULER_TaskCallback task, |
797 | void *task_cls); | 785 | void *task_cls); |
798 | 786 | ||
799 | 787 | ||
800 | /** | 788 | /** |
@@ -818,10 +806,10 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, | |||
818 | * only valid until @a task is started! | 806 | * only valid until @a task is started! |
819 | */ | 807 | */ |
820 | struct GNUNET_SCHEDULER_Task * | 808 | struct GNUNET_SCHEDULER_Task * |
821 | GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, | 809 | GNUNET_SCHEDULER_add_write_file(struct GNUNET_TIME_Relative delay, |
822 | const struct GNUNET_DISK_FileHandle *wfd, | 810 | const struct GNUNET_DISK_FileHandle *wfd, |
823 | GNUNET_SCHEDULER_TaskCallback task, | 811 | GNUNET_SCHEDULER_TaskCallback task, |
824 | void *task_cls); | 812 | void *task_cls); |
825 | 813 | ||
826 | 814 | ||
827 | /** | 815 | /** |
@@ -848,12 +836,12 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, | |||
848 | * only valid until @a task is started! | 836 | * only valid until @a task is started! |
849 | */ | 837 | */ |
850 | struct GNUNET_SCHEDULER_Task * | 838 | struct GNUNET_SCHEDULER_Task * |
851 | GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay, | 839 | GNUNET_SCHEDULER_add_file_with_priority(struct GNUNET_TIME_Relative delay, |
852 | enum GNUNET_SCHEDULER_Priority priority, | 840 | enum GNUNET_SCHEDULER_Priority priority, |
853 | const struct GNUNET_DISK_FileHandle *fd, | 841 | const struct GNUNET_DISK_FileHandle *fd, |
854 | int on_read, int on_write, | 842 | int on_read, int on_write, |
855 | GNUNET_SCHEDULER_TaskCallback task, | 843 | GNUNET_SCHEDULER_TaskCallback task, |
856 | void *task_cls); | 844 | void *task_cls); |
857 | 845 | ||
858 | 846 | ||
859 | /** | 847 | /** |
@@ -888,12 +876,12 @@ GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay, | |||
888 | * only valid until @a task is started! | 876 | * only valid until @a task is started! |
889 | */ | 877 | */ |
890 | struct GNUNET_SCHEDULER_Task * | 878 | struct GNUNET_SCHEDULER_Task * |
891 | GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | 879 | GNUNET_SCHEDULER_add_select(enum GNUNET_SCHEDULER_Priority prio, |
892 | struct GNUNET_TIME_Relative delay, | 880 | struct GNUNET_TIME_Relative delay, |
893 | const struct GNUNET_NETWORK_FDSet *rs, | 881 | const struct GNUNET_NETWORK_FDSet *rs, |
894 | const struct GNUNET_NETWORK_FDSet *ws, | 882 | const struct GNUNET_NETWORK_FDSet *ws, |
895 | GNUNET_SCHEDULER_TaskCallback task, | 883 | GNUNET_SCHEDULER_TaskCallback task, |
896 | void *task_cls); | 884 | void *task_cls); |
897 | 885 | ||
898 | /** | 886 | /** |
899 | * Sets the select function to use in the scheduler (scheduler_select). | 887 | * Sets the select function to use in the scheduler (scheduler_select). |
@@ -902,8 +890,8 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | |||
902 | * @param new_select_cls closure for @a new_select | 890 | * @param new_select_cls closure for @a new_select |
903 | */ | 891 | */ |
904 | void | 892 | void |
905 | GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, | 893 | GNUNET_SCHEDULER_set_select(GNUNET_SCHEDULER_select new_select, |
906 | void *new_select_cls); | 894 | void *new_select_cls); |
907 | 895 | ||
908 | 896 | ||
909 | 897 | ||
@@ -920,7 +908,7 @@ GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, | |||
920 | * @param aid the asynchronous scope id to enter | 908 | * @param aid the asynchronous scope id to enter |
921 | */ | 909 | */ |
922 | void | 910 | void |
923 | GNUNET_SCHEDULER_begin_async_scope (struct GNUNET_AsyncScopeId *aid); | 911 | GNUNET_SCHEDULER_begin_async_scope(struct GNUNET_AsyncScopeId *aid); |
924 | 912 | ||
925 | 913 | ||
926 | 914 | ||