diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-04 21:07:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-04 21:07:31 +0000 |
commit | 237a4538616beadd40d3e918ad4b6597b4eb8561 (patch) | |
tree | 0dd47c4e5eb9f55d3dc5c9ccad0b0117cb7f31ae /src/fs/fs_api.h | |
parent | bbdae1a7c4614fcd38b321c1c0ee1096ffa59686 (diff) | |
download | gnunet-237a4538616beadd40d3e918ad4b6597b4eb8561.tar.gz gnunet-237a4538616beadd40d3e918ad4b6597b4eb8561.zip |
-add priorities to download queue
Diffstat (limited to 'src/fs/fs_api.h')
-rw-r--r-- | src/fs/fs_api.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h index de66ac661..154e63893 100644 --- a/src/fs/fs_api.h +++ b/src/fs/fs_api.h | |||
@@ -417,6 +417,24 @@ typedef void (*GNUNET_FS_QueueStart) (void *cls, | |||
417 | typedef void (*GNUNET_FS_QueueStop) (void *cls); | 417 | typedef void (*GNUNET_FS_QueueStop) (void *cls); |
418 | 418 | ||
419 | 419 | ||
420 | |||
421 | /** | ||
422 | * Priorities for the queue. | ||
423 | */ | ||
424 | enum GNUNET_FS_QueuePriority | ||
425 | { | ||
426 | /** | ||
427 | * This is a probe (low priority). | ||
428 | */ | ||
429 | GNUNET_FS_QUEUE_PRIORITY_PROBE, | ||
430 | |||
431 | /** | ||
432 | * Default priority. | ||
433 | */ | ||
434 | GNUNET_FS_QUEUE_PRIORITY_NORMAL | ||
435 | }; | ||
436 | |||
437 | |||
420 | /** | 438 | /** |
421 | * Entry in the job queue. | 439 | * Entry in the job queue. |
422 | */ | 440 | */ |
@@ -479,6 +497,11 @@ struct GNUNET_FS_QueueEntry | |||
479 | unsigned int blocks; | 497 | unsigned int blocks; |
480 | 498 | ||
481 | /** | 499 | /** |
500 | * How important is this download? | ||
501 | */ | ||
502 | enum GNUNET_FS_QueuePriority priority; | ||
503 | |||
504 | /** | ||
482 | * How often have we (re)started this download? | 505 | * How often have we (re)started this download? |
483 | */ | 506 | */ |
484 | unsigned int start_times; | 507 | unsigned int start_times; |
@@ -599,11 +622,13 @@ struct GNUNET_FS_SearchResult | |||
599 | * @param stop function to call to pause the job, or on dequeue (if the job was running) | 622 | * @param stop function to call to pause the job, or on dequeue (if the job was running) |
600 | * @param cls closure for start and stop | 623 | * @param cls closure for start and stop |
601 | * @param blocks number of blocks this download has | 624 | * @param blocks number of blocks this download has |
625 | * @param priority how important is this download | ||
602 | * @return queue handle | 626 | * @return queue handle |
603 | */ | 627 | */ |
604 | struct GNUNET_FS_QueueEntry * | 628 | struct GNUNET_FS_QueueEntry * |
605 | GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, | 629 | GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, |
606 | GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks); | 630 | GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks, |
631 | enum GNUNET_FS_QueuePriority priority); | ||
607 | 632 | ||
608 | 633 | ||
609 | /** | 634 | /** |