diff options
Diffstat (limited to 'src/fs/fs_tree.h')
-rw-r--r-- | src/fs/fs_tree.h | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h index 532c9e9aa..b39a47cd3 100644 --- a/src/fs/fs_tree.h +++ b/src/fs/fs_tree.h | |||
@@ -40,7 +40,8 @@ | |||
40 | * @param flen file length for which to compute the depth | 40 | * @param flen file length for which to compute the depth |
41 | * @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK. | 41 | * @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK. |
42 | */ | 42 | */ |
43 | unsigned int GNUNET_FS_compute_depth (uint64_t flen); | 43 | unsigned int |
44 | GNUNET_FS_compute_depth (uint64_t flen); | ||
44 | 45 | ||
45 | 46 | ||
46 | /** | 47 | /** |
@@ -52,7 +53,8 @@ unsigned int GNUNET_FS_compute_depth (uint64_t flen); | |||
52 | * @param depth depth of the block. depth==0 is a DBLOCK. | 53 | * @param depth depth of the block. depth==0 is a DBLOCK. |
53 | * @return number of bytes of payload a subtree of this depth may correspond to | 54 | * @return number of bytes of payload a subtree of this depth may correspond to |
54 | */ | 55 | */ |
55 | uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); | 56 | uint64_t |
57 | GNUNET_FS_tree_compute_tree_size (unsigned int depth); | ||
56 | 58 | ||
57 | 59 | ||
58 | /** | 60 | /** |
@@ -66,8 +68,9 @@ uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); | |||
66 | * @param depth depth of the node in the tree, 0 for DBLOCK | 68 | * @param depth depth of the node in the tree, 0 for DBLOCK |
67 | * @return number of bytes stored in this node | 69 | * @return number of bytes stored in this node |
68 | */ | 70 | */ |
69 | size_t GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, | 71 | size_t |
70 | unsigned int depth); | 72 | GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, |
73 | unsigned int depth); | ||
71 | 74 | ||
72 | 75 | ||
73 | /** | 76 | /** |
@@ -134,18 +137,12 @@ typedef void (*GNUNET_FS_TreeProgressCallback) (void *cls, uint64_t offset, | |||
134 | * @param cont function to call when done | 137 | * @param cont function to call when done |
135 | * @return tree encoder context | 138 | * @return tree encoder context |
136 | */ | 139 | */ |
137 | struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct | 140 | struct GNUNET_FS_TreeEncoder * |
138 | GNUNET_FS_Handle | 141 | GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size, |
139 | *h, uint64_t size, | 142 | void *cls, GNUNET_FS_DataReader reader, |
140 | void *cls, | 143 | GNUNET_FS_TreeBlockProcessor proc, |
141 | GNUNET_FS_DataReader | 144 | GNUNET_FS_TreeProgressCallback progress, |
142 | reader, | 145 | GNUNET_SCHEDULER_Task cont); |
143 | GNUNET_FS_TreeBlockProcessor | ||
144 | proc, | ||
145 | GNUNET_FS_TreeProgressCallback | ||
146 | progress, | ||
147 | GNUNET_SCHEDULER_Task | ||
148 | cont); | ||
149 | 146 | ||
150 | 147 | ||
151 | /** | 148 | /** |
@@ -156,7 +153,8 @@ struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct | |||
156 | * | 153 | * |
157 | * @param te tree encoder to use | 154 | * @param te tree encoder to use |
158 | */ | 155 | */ |
159 | void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | 156 | void |
157 | GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | ||
160 | 158 | ||
161 | 159 | ||
162 | /** | 160 | /** |
@@ -170,8 +168,9 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | |||
170 | * prior to completion and prior to an internal error, | 168 | * prior to completion and prior to an internal error, |
171 | * both "*uri" and "*emsg" will be set to NULL). | 169 | * both "*uri" and "*emsg" will be set to NULL). |
172 | */ | 170 | */ |
173 | void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, | 171 | void |
174 | struct GNUNET_FS_Uri **uri, char **emsg); | 172 | GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, |
173 | struct GNUNET_FS_Uri **uri, char **emsg); | ||
175 | 174 | ||
176 | 175 | ||
177 | #if 0 | 176 | #if 0 |
@@ -185,8 +184,9 @@ void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, | |||
185 | * @param data set to the resume data | 184 | * @param data set to the resume data |
186 | * @param size set to the size of the resume data | 185 | * @param size set to the size of the resume data |
187 | */ | 186 | */ |
188 | void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder | 187 | void |
189 | *te, void **data, size_t * size); | 188 | GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder *te, |
189 | void **data, size_t * size); | ||
190 | 190 | ||
191 | 191 | ||
192 | /** | 192 | /** |
@@ -197,8 +197,9 @@ void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder | |||
197 | * @param data the resume data | 197 | * @param data the resume data |
198 | * @param size the size of the resume data | 198 | * @param size the size of the resume data |
199 | */ | 199 | */ |
200 | void GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, | 200 | void |
201 | const void *data, size_t size); | 201 | GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, |
202 | const void *data, size_t size); | ||
202 | #endif | 203 | #endif |
203 | 204 | ||
204 | #endif | 205 | #endif |