diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
commit | 502af2167f7c218366666ca4944bd7cc54b5b19a (patch) | |
tree | a91fec5cc9769d260640bd91c6633cb9cf395524 /src/fs/fs_tree.h | |
parent | 03af5a603b7cc53432249d5854cd412aa90dde0d (diff) | |
download | gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.tar.gz gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.zip |
indentation
Diffstat (limited to 'src/fs/fs_tree.h')
-rw-r--r-- | src/fs/fs_tree.h | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h index 5cd4d0afe..c2b7de48c 100644 --- a/src/fs/fs_tree.h +++ b/src/fs/fs_tree.h | |||
@@ -40,8 +40,7 @@ | |||
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 | 43 | unsigned int GNUNET_FS_compute_depth (uint64_t flen); |
44 | GNUNET_FS_compute_depth (uint64_t flen); | ||
45 | 44 | ||
46 | 45 | ||
47 | /** | 46 | /** |
@@ -53,8 +52,7 @@ GNUNET_FS_compute_depth (uint64_t flen); | |||
53 | * @param depth depth of the block. depth==0 is a DBLOCK. | 52 | * @param depth depth of the block. depth==0 is a DBLOCK. |
54 | * @return number of bytes of payload a subtree of this depth may correspond to | 53 | * @return number of bytes of payload a subtree of this depth may correspond to |
55 | */ | 54 | */ |
56 | uint64_t | 55 | uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); |
57 | GNUNET_FS_tree_compute_tree_size (unsigned int depth); | ||
58 | 56 | ||
59 | 57 | ||
60 | /** | 58 | /** |
@@ -70,8 +68,7 @@ GNUNET_FS_tree_compute_tree_size (unsigned int depth); | |||
70 | */ | 68 | */ |
71 | size_t | 69 | size_t |
72 | GNUNET_FS_tree_calculate_block_size (uint64_t fsize, | 70 | GNUNET_FS_tree_calculate_block_size (uint64_t fsize, |
73 | uint64_t offset, | 71 | uint64_t offset, unsigned int depth); |
74 | unsigned int depth); | ||
75 | 72 | ||
76 | 73 | ||
77 | /** | 74 | /** |
@@ -95,14 +92,14 @@ struct GNUNET_FS_TreeEncoder; | |||
95 | * @param block the (encrypted) block | 92 | * @param block the (encrypted) block |
96 | * @param block_size size of block (in bytes) | 93 | * @param block_size size of block (in bytes) |
97 | */ | 94 | */ |
98 | typedef void (*GNUNET_FS_TreeBlockProcessor)(void *cls, | 95 | typedef void (*GNUNET_FS_TreeBlockProcessor) (void *cls, |
99 | const struct ContentHashKey *chk, | 96 | const struct ContentHashKey * chk, |
100 | uint64_t offset, | 97 | uint64_t offset, |
101 | unsigned int depth, | 98 | unsigned int depth, |
102 | enum GNUNET_BLOCK_Type type, | 99 | enum GNUNET_BLOCK_Type type, |
103 | const void *block, | 100 | const void *block, |
104 | uint16_t block_size); | 101 | uint16_t block_size); |
105 | 102 | ||
106 | 103 | ||
107 | /** | 104 | /** |
108 | * Function called with information about our | 105 | * Function called with information about our |
@@ -114,12 +111,12 @@ typedef void (*GNUNET_FS_TreeBlockProcessor)(void *cls, | |||
114 | * @param pt_size size of pt_block | 111 | * @param pt_size size of pt_block |
115 | * @param depth depth of the block in the tree, 0 for DBLOCKS | 112 | * @param depth depth of the block in the tree, 0 for DBLOCKS |
116 | */ | 113 | */ |
117 | typedef void (*GNUNET_FS_TreeProgressCallback)(void *cls, | 114 | typedef void (*GNUNET_FS_TreeProgressCallback) (void *cls, |
118 | uint64_t offset, | 115 | uint64_t offset, |
119 | const void *pt_block, | 116 | const void *pt_block, |
120 | size_t pt_size, | 117 | size_t pt_size, |
121 | unsigned int depth); | 118 | unsigned int depth); |
122 | 119 | ||
123 | 120 | ||
124 | /** | 121 | /** |
125 | * Initialize a tree encoder. This function will call "proc" and | 122 | * Initialize a tree encoder. This function will call "proc" and |
@@ -139,14 +136,18 @@ typedef void (*GNUNET_FS_TreeProgressCallback)(void *cls, | |||
139 | * @param cont function to call when done | 136 | * @param cont function to call when done |
140 | * @return tree encoder context | 137 | * @return tree encoder context |
141 | */ | 138 | */ |
142 | struct GNUNET_FS_TreeEncoder * | 139 | struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct |
143 | GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, | 140 | GNUNET_FS_Handle |
144 | uint64_t size, | 141 | *h, uint64_t size, |
145 | void *cls, | 142 | void *cls, |
146 | GNUNET_FS_DataReader reader, | 143 | GNUNET_FS_DataReader |
147 | GNUNET_FS_TreeBlockProcessor proc, | 144 | reader, |
148 | GNUNET_FS_TreeProgressCallback progress, | 145 | GNUNET_FS_TreeBlockProcessor |
149 | GNUNET_SCHEDULER_Task cont); | 146 | proc, |
147 | GNUNET_FS_TreeProgressCallback | ||
148 | progress, | ||
149 | GNUNET_SCHEDULER_Task | ||
150 | cont); | ||
150 | 151 | ||
151 | 152 | ||
152 | /** | 153 | /** |
@@ -157,7 +158,7 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, | |||
157 | * | 158 | * |
158 | * @param te tree encoder to use | 159 | * @param te tree encoder to use |
159 | */ | 160 | */ |
160 | void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder * te); | 161 | void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); |
161 | 162 | ||
162 | 163 | ||
163 | /** | 164 | /** |
@@ -172,8 +173,7 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder * te); | |||
172 | * both "*uri" and "*emsg" will be set to NULL). | 173 | * both "*uri" and "*emsg" will be set to NULL). |
173 | */ | 174 | */ |
174 | void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, | 175 | void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, |
175 | struct GNUNET_FS_Uri **uri, | 176 | struct GNUNET_FS_Uri **uri, char **emsg); |
176 | char **emsg); | ||
177 | 177 | ||
178 | 178 | ||
179 | #if 0 | 179 | #if 0 |
@@ -187,9 +187,8 @@ void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, | |||
187 | * @param data set to the resume data | 187 | * @param data set to the resume data |
188 | * @param size set to the size of the resume data | 188 | * @param size set to the size of the resume data |
189 | */ | 189 | */ |
190 | void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder *te, | 190 | void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder |
191 | void **data, | 191 | *te, void **data, size_t * size); |
192 | size_t *size); | ||
193 | 192 | ||
194 | 193 | ||
195 | /** | 194 | /** |
@@ -201,8 +200,7 @@ void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder | |||
201 | * @param size the size of the resume data | 200 | * @param size the size of the resume data |
202 | */ | 201 | */ |
203 | void GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, | 202 | void GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, |
204 | const void *data, | 203 | const void *data, size_t size); |
205 | size_t size); | ||
206 | #endif | 204 | #endif |
207 | 205 | ||
208 | #endif | 206 | #endif |