X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Ffs_tree.h;h=5b1c2024f41515f73ab1da5da4890fa10504efbe;hb=1f09f4f7716db5939ec1c9a278b5661616dd72d6;hp=c2b7de48c40666d8d46855e40738459828bbfa51;hpb=502af2167f7c218366666ca4944bd7cc54b5b19a;p=oweals%2Fgnunet.git diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h index c2b7de48c..5b1c2024f 100644 --- a/src/fs/fs_tree.h +++ b/src/fs/fs_tree.h @@ -32,15 +32,16 @@ #ifndef GNUNET_FS_TREE_H #define GNUNET_FS_TREE_H -#include "fs.h" +#include "fs_api.h" /** - * Compute the depth of the CHK tree. + * Compute the depth of the CHK tree. * * @param flen file length for which to compute the depth * @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK. */ -unsigned int GNUNET_FS_compute_depth (uint64_t flen); +unsigned int +GNUNET_FS_compute_depth (uint64_t flen); /** @@ -52,7 +53,8 @@ unsigned int GNUNET_FS_compute_depth (uint64_t flen); * @param depth depth of the block. depth==0 is a DBLOCK. * @return number of bytes of payload a subtree of this depth may correspond to */ -uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); +uint64_t +GNUNET_FS_tree_compute_tree_size (unsigned int depth); /** @@ -67,8 +69,8 @@ uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); * @return number of bytes stored in this node */ size_t -GNUNET_FS_tree_calculate_block_size (uint64_t fsize, - uint64_t offset, unsigned int depth); +GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, + unsigned int depth); /** @@ -111,8 +113,7 @@ typedef void (*GNUNET_FS_TreeBlockProcessor) (void *cls, * @param pt_size size of pt_block * @param depth depth of the block in the tree, 0 for DBLOCKS */ -typedef void (*GNUNET_FS_TreeProgressCallback) (void *cls, - uint64_t offset, +typedef void (*GNUNET_FS_TreeProgressCallback) (void *cls, uint64_t offset, const void *pt_block, size_t pt_size, unsigned int depth); @@ -132,39 +133,34 @@ typedef void (*GNUNET_FS_TreeProgressCallback) (void *cls, * @param cls closure for reader, proc, progress and cont * @param reader function to call to read plaintext data * @param proc function to call on each encrypted block - * @param progress function to call with progress information + * @param progress function to call with progress information * @param cont function to call when done * @return tree encoder context */ -struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct - GNUNET_FS_Handle - *h, uint64_t size, - void *cls, - GNUNET_FS_DataReader - reader, - GNUNET_FS_TreeBlockProcessor - proc, - GNUNET_FS_TreeProgressCallback - progress, - GNUNET_SCHEDULER_Task - cont); +struct GNUNET_FS_TreeEncoder * +GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size, + void *cls, GNUNET_FS_DataReader reader, + GNUNET_FS_TreeBlockProcessor proc, + GNUNET_FS_TreeProgressCallback progress, + GNUNET_SCHEDULER_Task cont); /** - * Encrypt the next block of the file (and - * call proc and progress accordingly; or + * Encrypt the next block of the file (and + * call proc and progress accordingly; or * of course "cont" if we have already completed * encoding of the entire file). * * @param te tree encoder to use */ -void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); +void +GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); /** * Clean up a tree encoder and return information * about the resulting URI or an error message. - * + * * @param te the tree encoder to clean up * @param uri set to the resulting URI (if encoding finished) * @param emsg set to an error message (if an error occured @@ -172,8 +168,9 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); * prior to completion and prior to an internal error, * both "*uri" and "*emsg" will be set to NULL). */ -void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, - struct GNUNET_FS_Uri **uri, char **emsg); +void +GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, + struct GNUNET_FS_Uri **uri, char **emsg); #if 0 @@ -182,25 +179,27 @@ void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, /** * Get data that would be needed to resume * the encoding later. - * + * * @param te encoding to resume * @param data set to the resume data * @param size set to the size of the resume data */ -void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder - *te, void **data, size_t * size); +void +GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder *te, + void **data, size_t * size); /** * Reset tree encoder to point previously * obtained for resuming. - * + * * @param te encoding to resume * @param data the resume data * @param size the size of the resume data */ -void GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, - const void *data, size_t size); +void +GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, + const void *data, size_t size); #endif #endif