diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-04-30 13:16:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-04-30 13:16:03 +0000 |
commit | d59ea5663203392637e84dea69feb9671ca2a3de (patch) | |
tree | 2898909b01cc22b9b031bb76b99d6cd262ab3ee3 /src/fs/fs.h | |
parent | 4f2b474c1a9e51d71abe8d692fedddcb1d1e0ede (diff) | |
download | gnunet-d59ea5663203392637e84dea69feb9671ca2a3de.tar.gz gnunet-d59ea5663203392637e84dea69feb9671ca2a3de.zip |
finishing initial coding of fs-publish serialization/deserialization
Diffstat (limited to 'src/fs/fs.h')
-rw-r--r-- | src/fs/fs.h | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/fs/fs.h b/src/fs/fs.h index fa36b8f02..953e1e51b 100644 --- a/src/fs/fs.h +++ b/src/fs/fs.h | |||
@@ -431,11 +431,6 @@ struct GNUNET_FS_FileInformation | |||
431 | } data; | 431 | } data; |
432 | 432 | ||
433 | /** | 433 | /** |
434 | * Is this struct for a file or directory? | ||
435 | */ | ||
436 | int is_directory; | ||
437 | |||
438 | /** | ||
439 | * Desired anonymity level. | 434 | * Desired anonymity level. |
440 | */ | 435 | */ |
441 | uint32_t anonymity; | 436 | uint32_t anonymity; |
@@ -445,6 +440,16 @@ struct GNUNET_FS_FileInformation | |||
445 | */ | 440 | */ |
446 | uint32_t priority; | 441 | uint32_t priority; |
447 | 442 | ||
443 | /** | ||
444 | * Is this struct for a file or directory? | ||
445 | */ | ||
446 | int is_directory; | ||
447 | |||
448 | /** | ||
449 | * Are we done publishing this file? | ||
450 | */ | ||
451 | int is_published; | ||
452 | |||
448 | }; | 453 | }; |
449 | 454 | ||
450 | 455 | ||
@@ -563,6 +568,39 @@ void | |||
563 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | 568 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); |
564 | 569 | ||
565 | 570 | ||
571 | /** | ||
572 | * Function that provides data by reading from a file. | ||
573 | * | ||
574 | * @param cls closure (points to the file information) | ||
575 | * @param offset offset to read from; it is possible | ||
576 | * that the caller might need to go backwards | ||
577 | * a bit at times | ||
578 | * @param max maximum number of bytes that should be | ||
579 | * copied to buf; readers are not allowed | ||
580 | * to provide less data unless there is an error; | ||
581 | * a value of "0" will be used at the end to allow | ||
582 | * the reader to clean up its internal state | ||
583 | * @param buf where the reader should write the data | ||
584 | * @param emsg location for the reader to store an error message | ||
585 | * @return number of bytes written, usually "max", 0 on error | ||
586 | */ | ||
587 | size_t | ||
588 | GNUNET_FS_data_reader_file_(void *cls, | ||
589 | uint64_t offset, | ||
590 | size_t max, | ||
591 | void *buf, | ||
592 | char **emsg); | ||
593 | |||
594 | |||
595 | /** | ||
596 | * Create the closure for the 'GNUNET_FS_data_reader_file_' callback. | ||
597 | * | ||
598 | * @param filename file to read | ||
599 | * @return closure to use | ||
600 | */ | ||
601 | void * | ||
602 | GNUNET_FS_make_file_reader_context_ (const char *filename); | ||
603 | |||
566 | 604 | ||
567 | /** | 605 | /** |
568 | * Notification of FS that a search probe has made progress. | 606 | * Notification of FS that a search probe has made progress. |