aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_fs_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_fs_service.h')
-rw-r--r--src/include/gnunet_fs_service.h1053
1 files changed, 474 insertions, 579 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 5ee863d12..688c6d489 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -11,12 +11,12 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19*/ 19 */
20/** 20/**
21 * @author Christian Grothoff 21 * @author Christian Grothoff
22 * 22 *
@@ -80,7 +80,7 @@ extern "C"
80 * How often do we signal applications that a probe for a particular 80 * How often do we signal applications that a probe for a particular
81 * search result is running? (used to visualize probes). 81 * search result is running? (used to visualize probes).
82 */ 82 */
83#define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250) 83#define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250)
84 84
85/** 85/**
86 * A Universal Resource Identifier (URI), opaque. 86 * A Universal Resource Identifier (URI), opaque.
@@ -112,8 +112,8 @@ typedef int
112 * @return #GNUNET_OK on success 112 * @return #GNUNET_OK on success
113 */ 113 */
114int 114int
115GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, 115GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri,
116 struct GNUNET_HashCode *key); 116 struct GNUNET_HashCode *key);
117 117
118 118
119/** 119/**
@@ -123,7 +123,7 @@ GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
123 * @return the UTF-8 string 123 * @return the UTF-8 string
124 */ 124 */
125char * 125char *
126GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); 126GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri);
127 127
128 128
129/** 129/**
@@ -134,7 +134,7 @@ GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri);
134 * @return string with the keywords 134 * @return string with the keywords
135 */ 135 */
136char * 136char *
137GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); 137GNUNET_FS_uri_ksk_to_string_fancy(const struct GNUNET_FS_Uri *uri);
138 138
139 139
140/** 140/**
@@ -146,9 +146,9 @@ GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri);
146 * @param is_mandatory is this keyword mandatory? 146 * @param is_mandatory is this keyword mandatory?
147 */ 147 */
148void 148void
149GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, 149GNUNET_FS_uri_ksk_add_keyword(struct GNUNET_FS_Uri *uri,
150 const char *keyword, 150 const char *keyword,
151 int is_mandatory); 151 int is_mandatory);
152 152
153 153
154/** 154/**
@@ -159,8 +159,8 @@ GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri,
159 * @param keyword keyword to add 159 * @param keyword keyword to add
160 */ 160 */
161void 161void
162GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, 162GNUNET_FS_uri_ksk_remove_keyword(struct GNUNET_FS_Uri *uri,
163 const char *keyword); 163 const char *keyword);
164 164
165 165
166/** 166/**
@@ -171,8 +171,8 @@ GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri,
171 * @return NULL on error 171 * @return NULL on error
172 */ 172 */
173struct GNUNET_FS_Uri * 173struct GNUNET_FS_Uri *
174GNUNET_FS_uri_parse (const char *uri, 174GNUNET_FS_uri_parse(const char *uri,
175 char **emsg); 175 char **emsg);
176 176
177 177
178/** 178/**
@@ -181,7 +181,7 @@ GNUNET_FS_uri_parse (const char *uri,
181 * @param uri uri to free 181 * @param uri uri to free
182 */ 182 */
183void 183void
184GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); 184GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri);
185 185
186 186
187/** 187/**
@@ -191,7 +191,7 @@ GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri);
191 * @return 0 if this is not a keyword URI 191 * @return 0 if this is not a keyword URI
192 */ 192 */
193unsigned int 193unsigned int
194GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); 194GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri);
195 195
196 196
197/** 197/**
@@ -204,9 +204,9 @@ GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri);
204 * keywords iterated over until iterator aborted 204 * keywords iterated over until iterator aborted
205 */ 205 */
206int 206int
207GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, 207GNUNET_FS_uri_ksk_get_keywords(const struct GNUNET_FS_Uri *uri,
208 GNUNET_FS_KeywordIterator iterator, 208 GNUNET_FS_KeywordIterator iterator,
209 void *iterator_cls); 209 void *iterator_cls);
210 210
211 211
212/** 212/**
@@ -217,8 +217,8 @@ GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri,
217 * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK 217 * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK
218 */ 218 */
219int 219int
220GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, 220GNUNET_FS_uri_loc_get_peer_identity(const struct GNUNET_FS_Uri *uri,
221 struct GNUNET_PeerIdentity *peer); 221 struct GNUNET_PeerIdentity *peer);
222 222
223 223
224/** 224/**
@@ -228,7 +228,7 @@ GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
228 * @return NULL if argument is not a location URI 228 * @return NULL if argument is not a location URI
229 */ 229 */
230struct GNUNET_FS_Uri * 230struct GNUNET_FS_Uri *
231GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri); 231GNUNET_FS_uri_loc_get_uri(const struct GNUNET_FS_Uri *uri);
232 232
233 233
234/** 234/**
@@ -238,7 +238,7 @@ GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri);
238 * @return expiration time of the URI 238 * @return expiration time of the URI
239 */ 239 */
240struct GNUNET_TIME_Absolute 240struct GNUNET_TIME_Absolute
241GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); 241GNUNET_FS_uri_loc_get_expiration(const struct GNUNET_FS_Uri *uri);
242 242
243 243
244/** 244/**
@@ -254,9 +254,9 @@ GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri);
254 * @return the location URI, NULL on error 254 * @return the location URI, NULL on error
255 */ 255 */
256struct GNUNET_FS_Uri * 256struct GNUNET_FS_Uri *
257GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri, 257GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri,
258 const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key, 258 const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key,
259 struct GNUNET_TIME_Absolute expiration_time); 259 struct GNUNET_TIME_Absolute expiration_time);
260 260
261 261
262/** 262/**
@@ -267,8 +267,8 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri,
267 * @return merged URI, NULL on error 267 * @return merged URI, NULL on error
268 */ 268 */
269struct GNUNET_FS_Uri * 269struct GNUNET_FS_Uri *
270GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, 270GNUNET_FS_uri_ksk_merge(const struct GNUNET_FS_Uri *u1,
271 const struct GNUNET_FS_Uri *u2); 271 const struct GNUNET_FS_Uri *u2);
272 272
273 273
274/** 274/**
@@ -278,7 +278,7 @@ GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
278 * @return copy of the URI 278 * @return copy of the URI
279 */ 279 */
280struct GNUNET_FS_Uri * 280struct GNUNET_FS_Uri *
281GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); 281GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri);
282 282
283 283
284/** 284/**
@@ -299,8 +299,8 @@ GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri);
299 * if keywords is not legal (i.e. empty). 299 * if keywords is not legal (i.e. empty).
300 */ 300 */
301struct GNUNET_FS_Uri * 301struct GNUNET_FS_Uri *
302GNUNET_FS_uri_ksk_create (const char *keywords, 302GNUNET_FS_uri_ksk_create(const char *keywords,
303 char **emsg); 303 char **emsg);
304 304
305 305
306/** 306/**
@@ -321,8 +321,8 @@ GNUNET_FS_uri_ksk_create (const char *keywords,
321 * if keywords is not legal (i.e. empty). 321 * if keywords is not legal (i.e. empty).
322 */ 322 */
323struct GNUNET_FS_Uri * 323struct GNUNET_FS_Uri *
324GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, 324GNUNET_FS_uri_ksk_create_from_args(unsigned int argc,
325 const char **argv); 325 const char **argv);
326 326
327 327
328/** 328/**
@@ -333,8 +333,8 @@ GNUNET_FS_uri_ksk_create_from_args (unsigned int argc,
333 * @return #GNUNET_YES if the URIs are equal 333 * @return #GNUNET_YES if the URIs are equal
334 */ 334 */
335int 335int
336GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, 336GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1,
337 const struct GNUNET_FS_Uri *u2); 337 const struct GNUNET_FS_Uri *u2);
338 338
339 339
340/** 340/**
@@ -344,7 +344,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
344 * @return #GNUNET_YES if this is an SKS uri 344 * @return #GNUNET_YES if this is an SKS uri
345 */ 345 */
346int 346int
347GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); 347GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri);
348 348
349 349
350/** 350/**
@@ -355,8 +355,8 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
355 * @return an FS URI for the given namespace and identifier 355 * @return an FS URI for the given namespace and identifier
356 */ 356 */
357struct GNUNET_FS_Uri * 357struct GNUNET_FS_Uri *
358GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, 358GNUNET_FS_uri_sks_create(const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
359 const char *id); 359 const char *id);
360 360
361 361
362/** 362/**
@@ -368,8 +368,8 @@ GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
368 * @return #GNUNET_OK on success 368 * @return #GNUNET_OK on success
369 */ 369 */
370int 370int
371GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, 371GNUNET_FS_uri_sks_get_namespace(const struct GNUNET_FS_Uri *uri,
372 struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym); 372 struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym);
373 373
374 374
375/** 375/**
@@ -379,7 +379,7 @@ GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
379 * @return NULL on error (not a valid SKS URI) 379 * @return NULL on error (not a valid SKS URI)
380 */ 380 */
381char * 381char *
382GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); 382GNUNET_FS_uri_sks_get_content_id(const struct GNUNET_FS_Uri *uri);
383 383
384 384
385/** 385/**
@@ -389,7 +389,7 @@ GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri);
389 * @return #GNUNET_YES if this is a KSK uri 389 * @return #GNUNET_YES if this is a KSK uri
390 */ 390 */
391int 391int
392GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); 392GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri);
393 393
394 394
395/** 395/**
@@ -399,7 +399,7 @@ GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri);
399 * @return #GNUNET_YES if this is a CHK uri 399 * @return #GNUNET_YES if this is a CHK uri
400 */ 400 */
401int 401int
402GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); 402GNUNET_FS_uri_test_chk(const struct GNUNET_FS_Uri *uri);
403 403
404 404
405/** 405/**
@@ -410,7 +410,7 @@ GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri);
410 * @return size of the file as specified in the CHK URI 410 * @return size of the file as specified in the CHK URI
411 */ 411 */
412uint64_t 412uint64_t
413GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); 413GNUNET_FS_uri_chk_get_file_size(const struct GNUNET_FS_Uri *uri);
414 414
415 415
416/** 416/**
@@ -420,7 +420,7 @@ GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri);
420 * @return #GNUNET_YES if this is a LOC uri 420 * @return #GNUNET_YES if this is a LOC uri
421 */ 421 */
422int 422int
423GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); 423GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri);
424 424
425 425
426/** 426/**
@@ -432,8 +432,8 @@ GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri);
432 * @return NULL on error, otherwise a KSK URI 432 * @return NULL on error, otherwise a KSK URI
433 */ 433 */
434struct GNUNET_FS_Uri * 434struct GNUNET_FS_Uri *
435GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData 435GNUNET_FS_uri_ksk_create_from_meta_data(const struct GNUNET_CONTAINER_MetaData
436 *md); 436 *md);
437 437
438 438
439/* ******************** command-line option parsing API *********************** */ 439/* ******************** command-line option parsing API *********************** */
@@ -448,11 +448,11 @@ GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData
448 * @param[out] topKeywords set to the desired value 448 * @param[out] topKeywords set to the desired value
449 */ 449 */
450struct GNUNET_GETOPT_CommandLineOption 450struct GNUNET_GETOPT_CommandLineOption
451GNUNET_FS_GETOPT_KEYWORDS (char shortName, 451GNUNET_FS_GETOPT_KEYWORDS(char shortName,
452 const char *name, 452 const char *name,
453 const char *argumentHelp, 453 const char *argumentHelp,
454 const char *description, 454 const char *description,
455 struct GNUNET_FS_Uri **topKeywords); 455 struct GNUNET_FS_Uri **topKeywords);
456 456
457/** 457/**
458 * Allow user to specify metadata. 458 * Allow user to specify metadata.
@@ -464,11 +464,11 @@ GNUNET_FS_GETOPT_KEYWORDS (char shortName,
464 * @param[out] metadata set to the desired value 464 * @param[out] metadata set to the desired value
465 */ 465 */
466struct GNUNET_GETOPT_CommandLineOption 466struct GNUNET_GETOPT_CommandLineOption
467GNUNET_FS_GETOPT_METADATA (char shortName, 467GNUNET_FS_GETOPT_METADATA(char shortName,
468 const char *name, 468 const char *name,
469 const char *argumentHelp, 469 const char *argumentHelp,
470 const char *description, 470 const char *description,
471 struct GNUNET_CONTAINER_MetaData **meta); 471 struct GNUNET_CONTAINER_MetaData **meta);
472 472
473/** 473/**
474 * Command-line option parser function that allows the user to specify 474 * Command-line option parser function that allows the user to specify
@@ -483,10 +483,10 @@ GNUNET_FS_GETOPT_METADATA (char shortName,
483 * @return #GNUNET_OK on success 483 * @return #GNUNET_OK on success
484 */ 484 */
485int 485int
486GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 486GNUNET_FS_getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
487 void *scls, 487 void *scls,
488 const char *option, 488 const char *option,
489 const char *value); 489 const char *value);
490 490
491 491
492 492
@@ -504,8 +504,7 @@ GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext
504 * are typically generated either due to explicit client requests 504 * are typically generated either due to explicit client requests
505 * or because of suspend/resume operations. 505 * or because of suspend/resume operations.
506 */ 506 */
507enum GNUNET_FS_Status 507enum GNUNET_FS_Status {
508{
509 /** 508 /**
510 * Notification that we have started to publish a file structure. 509 * Notification that we have started to publish a file structure.
511 */ 510 */
@@ -724,7 +723,6 @@ enum GNUNET_FS_Status
724 * Notification that we are making progress sharing a directory. 723 * Notification that we are making progress sharing a directory.
725 */ 724 */
726 GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY = 37 725 GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY = 37
727
728}; 726};
729 727
730 728
@@ -772,21 +770,15 @@ struct GNUNET_FS_FileInformation;
772 * Argument given to the progress callback with 770 * Argument given to the progress callback with
773 * information about what is going on. 771 * information about what is going on.
774 */ 772 */
775struct GNUNET_FS_ProgressInfo 773struct GNUNET_FS_ProgressInfo {
776{
777
778 /** 774 /**
779 * Values that depend on the event type. 775 * Values that depend on the event type.
780 */ 776 */
781 union 777 union {
782 {
783
784 /** 778 /**
785 * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events. 779 * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events.
786 */ 780 */
787 struct 781 struct {
788 {
789
790 /** 782 /**
791 * Context for controlling the upload. 783 * Context for controlling the upload.
792 */ 784 */
@@ -848,54 +840,47 @@ struct GNUNET_FS_ProgressInfo
848 /** 840 /**
849 * Additional values for specific events. 841 * Additional values for specific events.
850 */ 842 */
851 union 843 union {
852 {
853
854 /** 844 /**
855 * These values are only valid for 845 * These values are only valid for
856 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events. 846 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events.
857 */ 847 */
858 struct 848 struct {
859 {
860
861 /** 849 /**
862 * Data block we just published. 850 * Data block we just published.
863 */ 851 */
864 const void *data; 852 const void *data;
865 853
866 /** 854 /**
867 * At what offset in the file is "data"? 855 * At what offset in the file is "data"?
868 */ 856 */
869 uint64_t offset; 857 uint64_t offset;
870 858
871 /** 859 /**
872 * Length of the data block. 860 * Length of the data block.
873 */ 861 */
874 uint64_t data_len; 862 uint64_t data_len;
875 863
876 /** 864 /**
877 * Depth of the given block in the tree; 865 * Depth of the given block in the tree;
878 * 0 would be the lowest level (DBLOCKs). 866 * 0 would be the lowest level (DBLOCKs).
879 */ 867 */
880 unsigned int depth; 868 unsigned int depth;
881
882 } progress; 869 } progress;
883 870
884 /** 871 /**
885 * These values are only valid for 872 * These values are only valid for
886 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events. 873 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events.
887 */ 874 */
888 struct 875 struct {
889 {
890
891 /** 876 /**
892 * How far are we along in the overall directory? 877 * How far are we along in the overall directory?
893 */ 878 */
894 uint64_t completed; 879 uint64_t completed;
895 880
896 /** 881 /**
897 * How big do we estimate the entire directory to be? 882 * How big do we estimate the entire directory to be?
898 */ 883 */
899 uint64_t total; 884 uint64_t total;
900 885
901 /** 886 /**
@@ -905,77 +890,63 @@ struct GNUNET_FS_ProgressInfo
905 * "publish"-level of this struct.) 890 * "publish"-level of this struct.)
906 */ 891 */
907 struct GNUNET_TIME_Relative eta; 892 struct GNUNET_TIME_Relative eta;
908
909 } progress_directory; 893 } progress_directory;
910 894
911 /** 895 /**
912 * These values are only valid for 896 * These values are only valid for
913 * #GNUNET_FS_STATUS_PUBLISH_RESUME events. 897 * #GNUNET_FS_STATUS_PUBLISH_RESUME events.
914 */ 898 */
915 struct 899 struct {
916 {
917
918 /** 900 /**
919 * Error message, NULL if no error was encountered so far. 901 * Error message, NULL if no error was encountered so far.
920 */ 902 */
921 const char *message; 903 const char *message;
922 904
923 /** 905 /**
924 * URI of the file (if the download had been completed) 906 * URI of the file (if the download had been completed)
925 */ 907 */
926 const struct GNUNET_FS_Uri *chk_uri; 908 const struct GNUNET_FS_Uri *chk_uri;
927 909
928 /** 910 /**
929 * SKS URI of the file (if the download had been completed) 911 * SKS URI of the file (if the download had been completed)
930 */ 912 */
931 const struct GNUNET_FS_Uri *sks_uri; 913 const struct GNUNET_FS_Uri *sks_uri;
932
933 } resume; 914 } resume;
934 915
935 /** 916 /**
936 * These values are only valid for 917 * These values are only valid for
937 * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events. 918 * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events.
938 */ 919 */
939 struct 920 struct {
940 {
941
942 /** 921 /**
943 * CHK URI of the file. 922 * CHK URI of the file.
944 */ 923 */
945 const struct GNUNET_FS_Uri *chk_uri; 924 const struct GNUNET_FS_Uri *chk_uri;
946 925
947 /** 926 /**
948 * SKS URI of the file (if the download had been completed) 927 * SKS URI of the file (if the download had been completed)
949 */ 928 */
950 const struct GNUNET_FS_Uri *sks_uri; 929 const struct GNUNET_FS_Uri *sks_uri;
951
952 } completed; 930 } completed;
953 931
954 /** 932 /**
955 * These values are only valid for 933 * These values are only valid for
956 * #GNUNET_FS_STATUS_PUBLISH_ERROR events. 934 * #GNUNET_FS_STATUS_PUBLISH_ERROR events.
957 */ 935 */
958 struct 936 struct {
959 {
960
961 /** 937 /**
962 * Error message, never NULL. 938 * Error message, never NULL.
963 */ 939 */
964 const char *message; 940 const char *message;
965
966 } error; 941 } error;
967
968 } specifics; 942 } specifics;
969
970 } publish; 943 } publish;
971 944
972 945
973 /** 946 /**
974 * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events. 947 * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events.
975 */ 948 */
976 struct 949 struct {
977 {
978
979 /** 950 /**
980 * Context for controlling the download. 951 * Context for controlling the download.
981 */ 952 */
@@ -1049,121 +1020,103 @@ struct GNUNET_FS_ProgressInfo
1049 /** 1020 /**
1050 * Additional values for specific events. 1021 * Additional values for specific events.
1051 */ 1022 */
1052 union 1023 union {
1053 {
1054
1055 /** 1024 /**
1056 * These values are only valid for 1025 * These values are only valid for
1057 * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events. 1026 * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events.
1058 */ 1027 */
1059 struct 1028 struct {
1060 {
1061
1062 /** 1029 /**
1063 * Data block we just obtained, can be NULL (even if 1030 * Data block we just obtained, can be NULL (even if
1064 * data_len > 0) if we found the entire block 'intact' on 1031 * data_len > 0) if we found the entire block 'intact' on
1065 * disk. In this case, it is also possible for 'data_len' 1032 * disk. In this case, it is also possible for 'data_len'
1066 * to be larger than an individual (32k) block. 1033 * to be larger than an individual (32k) block.
1067 */ 1034 */
1068 const void *data; 1035 const void *data;
1069 1036
1070 /** 1037 /**
1071 * At what offset in the file is "data"? 1038 * At what offset in the file is "data"?
1072 */ 1039 */
1073 uint64_t offset; 1040 uint64_t offset;
1074 1041
1075 /** 1042 /**
1076 * Length of the data block. 1043 * Length of the data block.
1077 */ 1044 */
1078 uint64_t data_len; 1045 uint64_t data_len;
1079 1046
1080 /** 1047 /**
1081 * How much time passed between us asking for this block and 1048 * How much time passed between us asking for this block and
1082 * actually getting it? #GNUNET_TIME_UNIT_FOREVER_REL if unknown. 1049 * actually getting it? #GNUNET_TIME_UNIT_FOREVER_REL if unknown.
1083 */ 1050 */
1084 struct GNUNET_TIME_Relative block_download_duration; 1051 struct GNUNET_TIME_Relative block_download_duration;
1085 1052
1086 /** 1053 /**
1087 * Depth of the given block in the tree; 1054 * Depth of the given block in the tree;
1088 * 0 would be the lowest level (DBLOCKS). 1055 * 0 would be the lowest level (DBLOCKS).
1089 */ 1056 */
1090 unsigned int depth; 1057 unsigned int depth;
1091 1058
1092 /** 1059 /**
1093 * How much respect did we offer for downloading this block? (estimate, 1060 * How much respect did we offer for downloading this block? (estimate,
1094 * because we might have the same request pending for multiple clients, 1061 * because we might have the same request pending for multiple clients,
1095 * and of course because a transmission may have failed at a lower 1062 * and of course because a transmission may have failed at a lower
1096 * layer). 1063 * layer).
1097 */ 1064 */
1098 uint32_t respect_offered; 1065 uint32_t respect_offered;
1099 1066
1100 /** 1067 /**
1101 * How often did we transmit the request? (estimate, 1068 * How often did we transmit the request? (estimate,
1102 * because we might have the same request pending for multiple clients, 1069 * because we might have the same request pending for multiple clients,
1103 * and of course because a transmission may have failed at a lower 1070 * and of course because a transmission may have failed at a lower
1104 * layer). 1071 * layer).
1105 */ 1072 */
1106 uint32_t num_transmissions; 1073 uint32_t num_transmissions;
1107
1108 } progress; 1074 } progress;
1109 1075
1110 /** 1076 /**
1111 * These values are only valid for 1077 * These values are only valid for
1112 * #GNUNET_FS_STATUS_DOWNLOAD_START events. 1078 * #GNUNET_FS_STATUS_DOWNLOAD_START events.
1113 */ 1079 */
1114 struct 1080 struct {
1115 {
1116
1117 /** 1081 /**
1118 * Known metadata for the download. 1082 * Known metadata for the download.
1119 */ 1083 */
1120 const struct GNUNET_CONTAINER_MetaData *meta; 1084 const struct GNUNET_CONTAINER_MetaData *meta;
1121
1122 } start; 1085 } start;
1123 1086
1124 /** 1087 /**
1125 * These values are only valid for 1088 * These values are only valid for
1126 * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events. 1089 * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events.
1127 */ 1090 */
1128 struct 1091 struct {
1129 {
1130
1131 /** 1092 /**
1132 * Known metadata for the download. 1093 * Known metadata for the download.
1133 */ 1094 */
1134 const struct GNUNET_CONTAINER_MetaData *meta; 1095 const struct GNUNET_CONTAINER_MetaData *meta;
1135 1096
1136 /** 1097 /**
1137 * Error message, NULL if we have not encountered any error yet. 1098 * Error message, NULL if we have not encountered any error yet.
1138 */ 1099 */
1139 const char *message; 1100 const char *message;
1140
1141 } resume; 1101 } resume;
1142 1102
1143 /** 1103 /**
1144 * These values are only valid for 1104 * These values are only valid for
1145 * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events. 1105 * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events.
1146 */ 1106 */
1147 struct 1107 struct {
1148 {
1149
1150 /** 1108 /**
1151 * Error message. 1109 * Error message.
1152 */ 1110 */
1153 const char *message; 1111 const char *message;
1154
1155 } error; 1112 } error;
1156
1157 } specifics; 1113 } specifics;
1158
1159 } download; 1114 } download;
1160 1115
1161 /** 1116 /**
1162 * Values for all "GNUNET_FS_STATUS_SEARCH_*" events. 1117 * Values for all "GNUNET_FS_STATUS_SEARCH_*" events.
1163 */ 1118 */
1164 struct 1119 struct {
1165 {
1166
1167 /** 1120 /**
1168 * Context for controlling the search, NULL for 1121 * Context for controlling the search, NULL for
1169 * searches that were not explicitly triggered 1122 * searches that were not explicitly triggered
@@ -1211,262 +1164,232 @@ struct GNUNET_FS_ProgressInfo
1211 /** 1164 /**
1212 * Additional values for specific events. 1165 * Additional values for specific events.
1213 */ 1166 */
1214 union 1167 union {
1215 {
1216
1217 /** 1168 /**
1218 * These values are only valid for 1169 * These values are only valid for
1219 * #GNUNET_FS_STATUS_SEARCH_RESULT events. 1170 * #GNUNET_FS_STATUS_SEARCH_RESULT events.
1220 */ 1171 */
1221 struct 1172 struct {
1222 {
1223
1224 /** 1173 /**
1225 * Metadata for the search result. 1174 * Metadata for the search result.
1226 */ 1175 */
1227 const struct GNUNET_CONTAINER_MetaData *meta; 1176 const struct GNUNET_CONTAINER_MetaData *meta;
1228 1177
1229 /** 1178 /**
1230 * URI for the search result. 1179 * URI for the search result.
1231 */ 1180 */
1232 const struct GNUNET_FS_Uri *uri; 1181 const struct GNUNET_FS_Uri *uri;
1233 1182
1234 /** 1183 /**
1235 * Handle to the result (for starting downloads). 1184 * Handle to the result (for starting downloads).
1236 */ 1185 */
1237 struct GNUNET_FS_SearchResult *result; 1186 struct GNUNET_FS_SearchResult *result;
1238 1187
1239 /** 1188 /**
1240 * Applicability rank (the larger, the better the result 1189 * Applicability rank (the larger, the better the result
1241 * fits the search criteria). 1190 * fits the search criteria).
1242 */ 1191 */
1243 uint32_t applicability_rank; 1192 uint32_t applicability_rank;
1244
1245 } result; 1193 } result;
1246 1194
1247 /** 1195 /**
1248 * These values are only valid for 1196 * These values are only valid for
1249 * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events. 1197 * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events.
1250 */ 1198 */
1251 struct 1199 struct {
1252 {
1253
1254 /** 1200 /**
1255 * Metadata for the search result. 1201 * Metadata for the search result.
1256 */ 1202 */
1257 const struct GNUNET_CONTAINER_MetaData *meta; 1203 const struct GNUNET_CONTAINER_MetaData *meta;
1258 1204
1259 /** 1205 /**
1260 * URI for the search result. 1206 * URI for the search result.
1261 */ 1207 */
1262 const struct GNUNET_FS_Uri *uri; 1208 const struct GNUNET_FS_Uri *uri;
1263 1209
1264 /** 1210 /**
1265 * Handle to the result (for starting downloads). 1211 * Handle to the result (for starting downloads).
1266 */ 1212 */
1267 struct GNUNET_FS_SearchResult *result; 1213 struct GNUNET_FS_SearchResult *result;
1268 1214
1269 /** 1215 /**
1270 * Current availability rank (negative: 1216 * Current availability rank (negative:
1271 * unavailable, positive: available) 1217 * unavailable, positive: available)
1272 */ 1218 */
1273 int32_t availability_rank; 1219 int32_t availability_rank;
1274 1220
1275 /** 1221 /**
1276 * On how many total queries is the given 1222 * On how many total queries is the given
1277 * availability_rank based? 1223 * availability_rank based?
1278 */ 1224 */
1279 uint32_t availability_certainty; 1225 uint32_t availability_certainty;
1280 1226
1281 /** 1227 /**
1282 * Updated applicability rank (the larger, 1228 * Updated applicability rank (the larger,
1283 * the better the result fits the search 1229 * the better the result fits the search
1284 * criteria). 1230 * criteria).
1285 */ 1231 */
1286 uint32_t applicability_rank; 1232 uint32_t applicability_rank;
1287
1288 } resume_result; 1233 } resume_result;
1289 1234
1290 /** 1235 /**
1291 * These values are only valid for 1236 * These values are only valid for
1292 * #GNUNET_FS_STATUS_SEARCH_UPDATE events. 1237 * #GNUNET_FS_STATUS_SEARCH_UPDATE events.
1293 */ 1238 */
1294 struct 1239 struct {
1295 {
1296
1297 /** 1240 /**
1298 * Private context set for for this result 1241 * Private context set for for this result
1299 * during the "RESULT" event. 1242 * during the "RESULT" event.
1300 */ 1243 */
1301 void *cctx; 1244 void *cctx;
1302 1245
1303 /** 1246 /**
1304 * Metadata for the search result. 1247 * Metadata for the search result.
1305 */ 1248 */
1306 const struct GNUNET_CONTAINER_MetaData *meta; 1249 const struct GNUNET_CONTAINER_MetaData *meta;
1307 1250
1308 /** 1251 /**
1309 * URI for the search result. 1252 * URI for the search result.
1310 */ 1253 */
1311 const struct GNUNET_FS_Uri *uri; 1254 const struct GNUNET_FS_Uri *uri;
1312 1255
1313 /** 1256 /**
1314 * Current availability rank (negative: 1257 * Current availability rank (negative:
1315 * unavailable, positive: available) 1258 * unavailable, positive: available)
1316 */ 1259 */
1317 int32_t availability_rank; 1260 int32_t availability_rank;
1318 1261
1319 /** 1262 /**
1320 * On how many total queries is the given 1263 * On how many total queries is the given
1321 * availability_rank based? 1264 * availability_rank based?
1322 */ 1265 */
1323 uint32_t availability_certainty; 1266 uint32_t availability_certainty;
1324 1267
1325 /** 1268 /**
1326 * Updated applicability rank (the larger, 1269 * Updated applicability rank (the larger,
1327 * the better the result fits the search 1270 * the better the result fits the search
1328 * criteria). 1271 * criteria).
1329 */ 1272 */
1330 uint32_t applicability_rank; 1273 uint32_t applicability_rank;
1331 1274
1332 /** 1275 /**
1333 * How long has the current probe been active? 1276 * How long has the current probe been active?
1334 */ 1277 */
1335 struct GNUNET_TIME_Relative current_probe_time; 1278 struct GNUNET_TIME_Relative current_probe_time;
1336
1337 } update; 1279 } update;
1338 1280
1339 /** 1281 /**
1340 * These values are only valid for 1282 * These values are only valid for
1341 * #GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events. 1283 * #GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events.
1342 * These events are automatically triggered for 1284 * These events are automatically triggered for
1343 * each search result before the 1285 * each search result before the
1344 * #GNUNET_FS_STATUS_SEARCH_SUSPEND event. This 1286 * #GNUNET_FS_STATUS_SEARCH_SUSPEND event. This
1345 * happens primarily to give the client a chance 1287 * happens primarily to give the client a chance
1346 * to clean up the "cctx" (if needed). 1288 * to clean up the "cctx" (if needed).
1347 */ 1289 */
1348 struct 1290 struct {
1349 {
1350
1351 /** 1291 /**
1352 * Private context set for for this result 1292 * Private context set for for this result
1353 * during the "RESULT" event. 1293 * during the "RESULT" event.
1354 */ 1294 */
1355 void *cctx; 1295 void *cctx;
1356 1296
1357 /** 1297 /**
1358 * Metadata for the search result. 1298 * Metadata for the search result.
1359 */ 1299 */
1360 const struct GNUNET_CONTAINER_MetaData *meta; 1300 const struct GNUNET_CONTAINER_MetaData *meta;
1361 1301
1362 /** 1302 /**
1363 * URI for the search result. 1303 * URI for the search result.
1364 */ 1304 */
1365 const struct GNUNET_FS_Uri *uri; 1305 const struct GNUNET_FS_Uri *uri;
1366
1367 } result_suspend; 1306 } result_suspend;
1368 1307
1369 /** 1308 /**
1370 * These values are only valid for 1309 * These values are only valid for
1371 * #GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED events. 1310 * #GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED events.
1372 * These events are automatically triggered for 1311 * These events are automatically triggered for
1373 * each search result before the 1312 * each search result before the
1374 * #GNUNET_FS_STATUS_SEARCH_STOPPED event. This 1313 * #GNUNET_FS_STATUS_SEARCH_STOPPED event. This
1375 * happens primarily to give the client a chance 1314 * happens primarily to give the client a chance
1376 * to clean up the "cctx" (if needed). 1315 * to clean up the "cctx" (if needed).
1377 */ 1316 */
1378 struct 1317 struct {
1379 {
1380
1381 /** 1318 /**
1382 * Private context set for for this result 1319 * Private context set for for this result
1383 * during the "RESULT" event. 1320 * during the "RESULT" event.
1384 */ 1321 */
1385 void *cctx; 1322 void *cctx;
1386 1323
1387 /** 1324 /**
1388 * Metadata for the search result. 1325 * Metadata for the search result.
1389 */ 1326 */
1390 const struct GNUNET_CONTAINER_MetaData *meta; 1327 const struct GNUNET_CONTAINER_MetaData *meta;
1391 1328
1392 /** 1329 /**
1393 * URI for the search result. 1330 * URI for the search result.
1394 */ 1331 */
1395 const struct GNUNET_FS_Uri *uri; 1332 const struct GNUNET_FS_Uri *uri;
1396
1397 } result_stopped; 1333 } result_stopped;
1398 1334
1399 /** 1335 /**
1400 * These values are only valid for 1336 * These values are only valid for
1401 * #GNUNET_FS_STATUS_SEARCH_RESUME events. 1337 * #GNUNET_FS_STATUS_SEARCH_RESUME events.
1402 */ 1338 */
1403 struct 1339 struct {
1404 {
1405
1406 /** 1340 /**
1407 * Error message, NULL if we have not encountered any error yet. 1341 * Error message, NULL if we have not encountered any error yet.
1408 */ 1342 */
1409 const char *message; 1343 const char *message;
1410 1344
1411 /** 1345 /**
1412 * Is this search currently paused? 1346 * Is this search currently paused?
1413 */ 1347 */
1414 int is_paused; 1348 int is_paused;
1415
1416 } resume; 1349 } resume;
1417 1350
1418 /** 1351 /**
1419 * These values are only valid for 1352 * These values are only valid for
1420 * #GNUNET_FS_STATUS_SEARCH_ERROR events. 1353 * #GNUNET_FS_STATUS_SEARCH_ERROR events.
1421 */ 1354 */
1422 struct 1355 struct {
1423 {
1424
1425 /** 1356 /**
1426 * Error message. 1357 * Error message.
1427 */ 1358 */
1428 const char *message; 1359 const char *message;
1429
1430 } error; 1360 } error;
1431 1361
1432 /** 1362 /**
1433 * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events. 1363 * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events.
1434 */ 1364 */
1435 struct 1365 struct {
1436 {
1437
1438 /** 1366 /**
1439 * Short, human-readable name of the namespace. 1367 * Short, human-readable name of the namespace.
1440 */ 1368 */
1441 const char *name; 1369 const char *name;
1442 1370
1443 /** 1371 /**
1444 * Root identifier for the namespace, can be NULL. 1372 * Root identifier for the namespace, can be NULL.
1445 */ 1373 */
1446 const char *root; 1374 const char *root;
1447 1375
1448 /** 1376 /**
1449 * Metadata for the namespace. 1377 * Metadata for the namespace.
1450 */ 1378 */
1451 const struct GNUNET_CONTAINER_MetaData *meta; 1379 const struct GNUNET_CONTAINER_MetaData *meta;
1452 1380
1453 /** 1381 /**
1454 * Public key of the namespace. 1382 * Public key of the namespace.
1455 */ 1383 */
1456 struct GNUNET_CRYPTO_EcdsaPublicKey pseudonym; 1384 struct GNUNET_CRYPTO_EcdsaPublicKey pseudonym;
1457
1458 } ns; 1385 } ns;
1459
1460 } specifics; 1386 } specifics;
1461
1462 } search; 1387 } search;
1463 1388
1464 /** 1389 /**
1465 * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events. 1390 * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events.
1466 */ 1391 */
1467 struct 1392 struct {
1468 {
1469
1470 /** 1393 /**
1471 * Context for controlling the unindexing. 1394 * Context for controlling the unindexing.
1472 */ 1395 */
@@ -1510,71 +1433,57 @@ struct GNUNET_FS_ProgressInfo
1510 /** 1433 /**
1511 * Additional values for specific events. 1434 * Additional values for specific events.
1512 */ 1435 */
1513 union 1436 union {
1514 {
1515
1516 /** 1437 /**
1517 * These values are only valid for 1438 * These values are only valid for
1518 * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events. 1439 * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events.
1519 */ 1440 */
1520 struct 1441 struct {
1521 {
1522
1523 /** 1442 /**
1524 * Data block we just unindexed. 1443 * Data block we just unindexed.
1525 */ 1444 */
1526 const void *data; 1445 const void *data;
1527 1446
1528 /** 1447 /**
1529 * At what offset in the file is "data"? 1448 * At what offset in the file is "data"?
1530 */ 1449 */
1531 uint64_t offset; 1450 uint64_t offset;
1532 1451
1533 /** 1452 /**
1534 * Length of the data block. 1453 * Length of the data block.
1535 */ 1454 */
1536 uint64_t data_len; 1455 uint64_t data_len;
1537 1456
1538 /** 1457 /**
1539 * Depth of the given block in the tree; 1458 * Depth of the given block in the tree;
1540 * 0 would be the lowest level (DBLOCKS). 1459 * 0 would be the lowest level (DBLOCKS).
1541 */ 1460 */
1542 unsigned int depth; 1461 unsigned int depth;
1543
1544 } progress; 1462 } progress;
1545 1463
1546 /** 1464 /**
1547 * These values are only valid for 1465 * These values are only valid for
1548 * #GNUNET_FS_STATUS_UNINDEX_RESUME events. 1466 * #GNUNET_FS_STATUS_UNINDEX_RESUME events.
1549 */ 1467 */
1550 struct 1468 struct {
1551 {
1552
1553 /** 1469 /**
1554 * Error message, NULL if we have not encountered any error yet. 1470 * Error message, NULL if we have not encountered any error yet.
1555 */ 1471 */
1556 const char *message; 1472 const char *message;
1557
1558 } resume; 1473 } resume;
1559 1474
1560 /** 1475 /**
1561 * These values are only valid for 1476 * These values are only valid for
1562 * #GNUNET_FS_STATUS_UNINDEX_ERROR events. 1477 * #GNUNET_FS_STATUS_UNINDEX_ERROR events.
1563 */ 1478 */
1564 struct 1479 struct {
1565 {
1566
1567 /** 1480 /**
1568 * Error message. 1481 * Error message.
1569 */ 1482 */
1570 const char *message; 1483 const char *message;
1571
1572 } error; 1484 } error;
1573
1574 } specifics; 1485 } specifics;
1575
1576 } unindex; 1486 } unindex;
1577
1578 } value; 1487 } value;
1579 1488
1580 /** 1489 /**
@@ -1612,8 +1521,7 @@ typedef void *
1612/** 1521/**
1613 * General (global) option flags for file-sharing. 1522 * General (global) option flags for file-sharing.
1614 */ 1523 */
1615enum GNUNET_FS_Flags 1524enum GNUNET_FS_Flags {
1616{
1617 /** 1525 /**
1618 * No special flags set. 1526 * No special flags set.
1619 */ 1527 */
@@ -1637,9 +1545,7 @@ enum GNUNET_FS_Flags
1637/** 1545/**
1638 * Options specified in the VARARGs portion of GNUNET_FS_start. 1546 * Options specified in the VARARGs portion of GNUNET_FS_start.
1639 */ 1547 */
1640enum GNUNET_FS_OPTIONS 1548enum GNUNET_FS_OPTIONS {
1641{
1642
1643 /** 1549 /**
1644 * Last option in the VARARG list. 1550 * Last option in the VARARG list.
1645 */ 1551 */
@@ -1666,9 +1572,7 @@ enum GNUNET_FS_OPTIONS
1666 * Settings for publishing a block (which may of course also 1572 * Settings for publishing a block (which may of course also
1667 * apply to an entire directory or file). 1573 * apply to an entire directory or file).
1668 */ 1574 */
1669struct GNUNET_FS_BlockOptions 1575struct GNUNET_FS_BlockOptions {
1670{
1671
1672 /** 1576 /**
1673 * At what time should the block expire? Data blocks (DBLOCKS and 1577 * At what time should the block expire? Data blocks (DBLOCKS and
1674 * IBLOCKS) may still be used even if they are expired (however, 1578 * IBLOCKS) may still be used even if they are expired (however,
@@ -1703,7 +1607,6 @@ struct GNUNET_FS_BlockOptions
1703 * first place). 1607 * first place).
1704 */ 1608 */
1705 uint32_t replication_level; 1609 uint32_t replication_level;
1706
1707}; 1610};
1708 1611
1709 1612
@@ -1725,12 +1628,12 @@ struct GNUNET_FS_Handle;
1725 * @return NULL on error 1628 * @return NULL on error
1726 */ 1629 */
1727struct GNUNET_FS_Handle * 1630struct GNUNET_FS_Handle *
1728GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, 1631GNUNET_FS_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
1729 const char *client_name, 1632 const char *client_name,
1730 GNUNET_FS_ProgressCallback upcb, 1633 GNUNET_FS_ProgressCallback upcb,
1731 void *upcb_cls, 1634 void *upcb_cls,
1732 enum GNUNET_FS_Flags flags, 1635 enum GNUNET_FS_Flags flags,
1733 ...); 1636 ...);
1734 1637
1735 1638
1736/** 1639/**
@@ -1743,7 +1646,7 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
1743 * @param h handle that was returned from #GNUNET_FS_start() 1646 * @param h handle that was returned from #GNUNET_FS_start()
1744 */ 1647 */
1745void 1648void
1746GNUNET_FS_stop (struct GNUNET_FS_Handle *h); 1649GNUNET_FS_stop(struct GNUNET_FS_Handle *h);
1747 1650
1748 1651
1749/** 1652/**
@@ -1782,7 +1685,7 @@ typedef int
1782 * to read this fi-struct from disk. 1685 * to read this fi-struct from disk.
1783 */ 1686 */
1784const char * 1687const char *
1785GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s); 1688GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s);
1786 1689
1787 1690
1788/** 1691/**
@@ -1792,7 +1695,7 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s);
1792 * @return "filename" field of the structure (can be NULL) 1695 * @return "filename" field of the structure (can be NULL)
1793 */ 1696 */
1794const char * 1697const char *
1795GNUNET_FS_file_information_get_filename (struct GNUNET_FS_FileInformation *s); 1698GNUNET_FS_file_information_get_filename(struct GNUNET_FS_FileInformation *s);
1796 1699
1797 1700
1798/** 1701/**
@@ -1804,8 +1707,8 @@ GNUNET_FS_file_information_get_filename (struct GNUNET_FS_FileInformation *s);
1804 * @param filename filename to set 1707 * @param filename filename to set
1805 */ 1708 */
1806void 1709void
1807GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s, 1710GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s,
1808 const char *filename); 1711 const char *filename);
1809 1712
1810 1713
1811/** 1714/**
@@ -1823,13 +1726,13 @@ GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s,
1823 * @return publish structure entry for the file 1726 * @return publish structure entry for the file
1824 */ 1727 */
1825struct GNUNET_FS_FileInformation * 1728struct GNUNET_FS_FileInformation *
1826GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, 1729GNUNET_FS_file_information_create_from_file(struct GNUNET_FS_Handle *h,
1827 void *client_info, 1730 void *client_info,
1828 const char *filename, 1731 const char *filename,
1829 const struct GNUNET_FS_Uri *keywords, 1732 const struct GNUNET_FS_Uri *keywords,
1830 const struct GNUNET_CONTAINER_MetaData *meta, 1733 const struct GNUNET_CONTAINER_MetaData *meta,
1831 int do_index, 1734 int do_index,
1832 const struct GNUNET_FS_BlockOptions *bo); 1735 const struct GNUNET_FS_BlockOptions *bo);
1833 1736
1834 1737
1835/** 1738/**
@@ -1849,14 +1752,14 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
1849 * @return publish structure entry for the file 1752 * @return publish structure entry for the file
1850 */ 1753 */
1851struct GNUNET_FS_FileInformation * 1754struct GNUNET_FS_FileInformation *
1852GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, 1755GNUNET_FS_file_information_create_from_data(struct GNUNET_FS_Handle *h,
1853 void *client_info, 1756 void *client_info,
1854 uint64_t length, 1757 uint64_t length,
1855 void *data, 1758 void *data,
1856 const struct GNUNET_FS_Uri *keywords, 1759 const struct GNUNET_FS_Uri *keywords,
1857 const struct GNUNET_CONTAINER_MetaData *meta, 1760 const struct GNUNET_CONTAINER_MetaData *meta,
1858 int do_index, 1761 int do_index,
1859 const struct GNUNET_FS_BlockOptions *bo); 1762 const struct GNUNET_FS_BlockOptions *bo);
1860 1763
1861 1764
1862/** 1765/**
@@ -1904,18 +1807,18 @@ typedef size_t
1904 * @return publish structure entry for the file 1807 * @return publish structure entry for the file
1905 */ 1808 */
1906struct GNUNET_FS_FileInformation * 1809struct GNUNET_FS_FileInformation *
1907GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, 1810GNUNET_FS_file_information_create_from_reader(struct GNUNET_FS_Handle *h,
1908 void *client_info, 1811 void *client_info,
1909 uint64_t length, 1812 uint64_t length,
1910 GNUNET_FS_DataReader reader, 1813 GNUNET_FS_DataReader reader,
1911 void *reader_cls, 1814 void *reader_cls,
1912 const struct GNUNET_FS_Uri 1815 const struct GNUNET_FS_Uri
1913 *keywords, 1816 *keywords,
1914 const struct 1817 const struct
1915 GNUNET_CONTAINER_MetaData *meta, 1818 GNUNET_CONTAINER_MetaData *meta,
1916 int do_index, 1819 int do_index,
1917 const struct 1820 const struct
1918 GNUNET_FS_BlockOptions *bo); 1821 GNUNET_FS_BlockOptions *bo);
1919 1822
1920 1823
1921/** 1824/**
@@ -1931,16 +1834,16 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
1931 * @return publish structure entry for the directory , NULL on error 1834 * @return publish structure entry for the directory , NULL on error
1932 */ 1835 */
1933struct GNUNET_FS_FileInformation * 1836struct GNUNET_FS_FileInformation *
1934GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, 1837GNUNET_FS_file_information_create_empty_directory(struct GNUNET_FS_Handle *h,
1935 void *client_info, 1838 void *client_info,
1936 const struct GNUNET_FS_Uri 1839 const struct GNUNET_FS_Uri
1937 *keywords, 1840 *keywords,
1938 const struct 1841 const struct
1939 GNUNET_CONTAINER_MetaData 1842 GNUNET_CONTAINER_MetaData
1940 *meta, 1843 *meta,
1941 const struct 1844 const struct
1942 GNUNET_FS_BlockOptions *bo, 1845 GNUNET_FS_BlockOptions *bo,
1943 const char *filename); 1846 const char *filename);
1944 1847
1945 1848
1946/** 1849/**
@@ -1950,8 +1853,8 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
1950 * @return #GNUNET_YES if so, #GNUNET_NO if not 1853 * @return #GNUNET_YES if so, #GNUNET_NO if not
1951 */ 1854 */
1952int 1855int
1953GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation 1856GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation
1954 *ent); 1857 *ent);
1955 1858
1956 1859
1957/** 1860/**
@@ -1966,8 +1869,8 @@ GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation
1966 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1869 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1967 */ 1870 */
1968int 1871int
1969GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, 1872GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir,
1970 struct GNUNET_FS_FileInformation *ent); 1873 struct GNUNET_FS_FileInformation *ent);
1971 1874
1972 1875
1973/** 1876/**
@@ -1985,9 +1888,9 @@ GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
1985 * @param proc_cls closure for @a proc 1888 * @param proc_cls closure for @a proc
1986 */ 1889 */
1987void 1890void
1988GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, 1891GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir,
1989 GNUNET_FS_FileInformationProcessor proc, 1892 GNUNET_FS_FileInformationProcessor proc,
1990 void *proc_cls); 1893 void *proc_cls);
1991 1894
1992 1895
1993/** 1896/**
@@ -2001,17 +1904,16 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
2001 * @param cleaner_cls closure for @a cleaner 1904 * @param cleaner_cls closure for @a cleaner
2002 */ 1905 */
2003void 1906void
2004GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, 1907GNUNET_FS_file_information_destroy(struct GNUNET_FS_FileInformation *fi,
2005 GNUNET_FS_FileInformationProcessor cleaner, 1908 GNUNET_FS_FileInformationProcessor cleaner,
2006 void *cleaner_cls); 1909 void *cleaner_cls);
2007 1910
2008 1911
2009/** 1912/**
2010 * Options for publishing. Compatible options 1913 * Options for publishing. Compatible options
2011 * can be OR'ed together. 1914 * can be OR'ed together.
2012 */ 1915 */
2013enum GNUNET_FS_PublishOptions 1916enum GNUNET_FS_PublishOptions {
2014{
2015 /** 1917 /**
2016 * No options (use defaults for everything). 1918 * No options (use defaults for everything).
2017 */ 1919 */
@@ -2039,12 +1941,12 @@ enum GNUNET_FS_PublishOptions
2039 * @return context that can be used to control the publish operation 1941 * @return context that can be used to control the publish operation
2040 */ 1942 */
2041struct GNUNET_FS_PublishContext * 1943struct GNUNET_FS_PublishContext *
2042GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, 1944GNUNET_FS_publish_start(struct GNUNET_FS_Handle *h,
2043 struct GNUNET_FS_FileInformation *fi, 1945 struct GNUNET_FS_FileInformation *fi,
2044 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 1946 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
2045 const char *nid, 1947 const char *nid,
2046 const char *nuid, 1948 const char *nuid,
2047 enum GNUNET_FS_PublishOptions options); 1949 enum GNUNET_FS_PublishOptions options);
2048 1950
2049 1951
2050/** 1952/**
@@ -2056,7 +1958,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
2056 * @param pc context for the publication to stop 1958 * @param pc context for the publication to stop
2057 */ 1959 */
2058void 1960void
2059GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); 1961GNUNET_FS_publish_stop(struct GNUNET_FS_PublishContext *pc);
2060 1962
2061 1963
2062/** 1964/**
@@ -2093,13 +1995,13 @@ struct GNUNET_FS_PublishKskContext;
2093 * @return NULL on error (@a cont will still be called) 1995 * @return NULL on error (@a cont will still be called)
2094 */ 1996 */
2095struct GNUNET_FS_PublishKskContext * 1997struct GNUNET_FS_PublishKskContext *
2096GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, 1998GNUNET_FS_publish_ksk(struct GNUNET_FS_Handle *h,
2097 const struct GNUNET_FS_Uri *ksk_uri, 1999 const struct GNUNET_FS_Uri *ksk_uri,
2098 const struct GNUNET_CONTAINER_MetaData *meta, 2000 const struct GNUNET_CONTAINER_MetaData *meta,
2099 const struct GNUNET_FS_Uri *uri, 2001 const struct GNUNET_FS_Uri *uri,
2100 const struct GNUNET_FS_BlockOptions *bo, 2002 const struct GNUNET_FS_BlockOptions *bo,
2101 enum GNUNET_FS_PublishOptions options, 2003 enum GNUNET_FS_PublishOptions options,
2102 GNUNET_FS_PublishContinuation cont, void *cont_cls); 2004 GNUNET_FS_PublishContinuation cont, void *cont_cls);
2103 2005
2104 2006
2105/** 2007/**
@@ -2108,7 +2010,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
2108 * @param pkc context of the operation to abort. 2010 * @param pkc context of the operation to abort.
2109 */ 2011 */
2110void 2012void
2111GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc); 2013GNUNET_FS_publish_ksk_cancel(struct GNUNET_FS_PublishKskContext *pkc);
2112 2014
2113 2015
2114/** 2016/**
@@ -2133,15 +2035,15 @@ struct GNUNET_FS_PublishSksContext;
2133 * @return NULL on error (@a cont will still be called) 2035 * @return NULL on error (@a cont will still be called)
2134 */ 2036 */
2135struct GNUNET_FS_PublishSksContext * 2037struct GNUNET_FS_PublishSksContext *
2136GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, 2038GNUNET_FS_publish_sks(struct GNUNET_FS_Handle *h,
2137 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 2039 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
2138 const char *identifier, 2040 const char *identifier,
2139 const char *update, 2041 const char *update,
2140 const struct GNUNET_CONTAINER_MetaData *meta, 2042 const struct GNUNET_CONTAINER_MetaData *meta,
2141 const struct GNUNET_FS_Uri *uri, 2043 const struct GNUNET_FS_Uri *uri,
2142 const struct GNUNET_FS_BlockOptions *bo, 2044 const struct GNUNET_FS_BlockOptions *bo,
2143 enum GNUNET_FS_PublishOptions options, 2045 enum GNUNET_FS_PublishOptions options,
2144 GNUNET_FS_PublishContinuation cont, void *cont_cls); 2046 GNUNET_FS_PublishContinuation cont, void *cont_cls);
2145 2047
2146 2048
2147/** 2049/**
@@ -2150,7 +2052,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
2150 * @param psc context of the operation to abort. 2052 * @param psc context of the operation to abort.
2151 */ 2053 */
2152void 2054void
2153GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc); 2055GNUNET_FS_publish_sks_cancel(struct GNUNET_FS_PublishSksContext *psc);
2154 2056
2155 2057
2156/** 2058/**
@@ -2182,9 +2084,9 @@ struct GNUNET_FS_GetIndexedContext;
2182 * @return NULL on error (@a iterator is not called) 2084 * @return NULL on error (@a iterator is not called)
2183 */ 2085 */
2184struct GNUNET_FS_GetIndexedContext * 2086struct GNUNET_FS_GetIndexedContext *
2185GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, 2087GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h,
2186 GNUNET_FS_IndexedFileProcessor iterator, 2088 GNUNET_FS_IndexedFileProcessor iterator,
2187 void *iterator_cls); 2089 void *iterator_cls);
2188 2090
2189 2091
2190/** 2092/**
@@ -2193,7 +2095,7 @@ GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h,
2193 * @param gic operation to cancel 2095 * @param gic operation to cancel
2194 */ 2096 */
2195void 2097void
2196GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic); 2098GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic);
2197 2099
2198 2100
2199/** 2101/**
@@ -2205,9 +2107,9 @@ GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic);
2205 * @return NULL on error, otherwise handle 2107 * @return NULL on error, otherwise handle
2206 */ 2108 */
2207struct GNUNET_FS_UnindexContext * 2109struct GNUNET_FS_UnindexContext *
2208GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, 2110GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h,
2209 const char *filename, 2111 const char *filename,
2210 void *cctx); 2112 void *cctx);
2211 2113
2212 2114
2213/** 2115/**
@@ -2216,7 +2118,7 @@ GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h,
2216 * @param uc handle 2118 * @param uc handle
2217 */ 2119 */
2218void 2120void
2219GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); 2121GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc);
2220 2122
2221 2123
2222/** 2124/**
@@ -2229,10 +2131,10 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc);
2229 * @param next_id identifier that should be used for updates 2131 * @param next_id identifier that should be used for updates
2230 */ 2132 */
2231typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, 2133typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
2232 const char *last_id, 2134 const char *last_id,
2233 const struct GNUNET_FS_Uri *last_uri, 2135 const struct GNUNET_FS_Uri *last_uri,
2234 const struct GNUNET_CONTAINER_MetaData *last_meta, 2136 const struct GNUNET_CONTAINER_MetaData *last_meta,
2235 const char *next_id); 2137 const char *next_id);
2236 2138
2237 2139
2238/** 2140/**
@@ -2257,27 +2159,26 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
2257 * @param ip_cls closure for @a ip 2159 * @param ip_cls closure for @a ip
2258 */ 2160 */
2259void 2161void
2260GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h, 2162GNUNET_FS_namespace_list_updateable(struct GNUNET_FS_Handle *h,
2261 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 2163 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
2262 const char *next_id, 2164 const char *next_id,
2263 GNUNET_FS_IdentifierProcessor ip, 2165 GNUNET_FS_IdentifierProcessor ip,
2264 void *ip_cls); 2166 void *ip_cls);
2265 2167
2266 2168
2267/** 2169/**
2268 * Options for searching. Compatible options 2170 * Options for searching. Compatible options
2269 * can be OR'ed together. 2171 * can be OR'ed together.
2270 */ 2172 */
2271enum GNUNET_FS_SearchOptions 2173enum GNUNET_FS_SearchOptions {
2272{ 2174 /**
2273 /** 2175 * No options (use defaults for everything).
2274 * No options (use defaults for everything). 2176 */
2275 */
2276 GNUNET_FS_SEARCH_OPTION_NONE = 0, 2177 GNUNET_FS_SEARCH_OPTION_NONE = 0,
2277 2178
2278 /** 2179 /**
2279 * Only search the local host, do not search remote systems (no P2P) 2180 * Only search the local host, do not search remote systems (no P2P)
2280 */ 2181 */
2281 GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY = 1 2182 GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY = 1
2282}; 2183};
2283 2184
@@ -2294,9 +2195,9 @@ enum GNUNET_FS_SearchOptions
2294 * @return context that can be used to control the search 2195 * @return context that can be used to control the search
2295 */ 2196 */
2296struct GNUNET_FS_SearchContext * 2197struct GNUNET_FS_SearchContext *
2297GNUNET_FS_search_start (struct GNUNET_FS_Handle *h, 2198GNUNET_FS_search_start(struct GNUNET_FS_Handle *h,
2298 const struct GNUNET_FS_Uri *uri, uint32_t anonymity, 2199 const struct GNUNET_FS_Uri *uri, uint32_t anonymity,
2299 enum GNUNET_FS_SearchOptions options, void *cctx); 2200 enum GNUNET_FS_SearchOptions options, void *cctx);
2300 2201
2301 2202
2302/** 2203/**
@@ -2305,7 +2206,7 @@ GNUNET_FS_search_start (struct GNUNET_FS_Handle *h,
2305 * @param sc context for the search that should be paused 2206 * @param sc context for the search that should be paused
2306 */ 2207 */
2307void 2208void
2308GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); 2209GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc);
2309 2210
2310 2211
2311/** 2212/**
@@ -2314,7 +2215,7 @@ GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc);
2314 * @param sc context for the search that should be resumed 2215 * @param sc context for the search that should be resumed
2315 */ 2216 */
2316void 2217void
2317GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); 2218GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc);
2318 2219
2319 2220
2320/** 2221/**
@@ -2323,7 +2224,7 @@ GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc);
2323 * @param sc context for the search that should be stopped 2224 * @param sc context for the search that should be stopped
2324 */ 2225 */
2325void 2226void
2326GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); 2227GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc);
2327 2228
2328 2229
2329/** 2230/**
@@ -2337,11 +2238,11 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc);
2337 * @return the search result handle to access the probe activity 2238 * @return the search result handle to access the probe activity
2338 */ 2239 */
2339struct GNUNET_FS_SearchResult * 2240struct GNUNET_FS_SearchResult *
2340GNUNET_FS_probe (struct GNUNET_FS_Handle *h, 2241GNUNET_FS_probe(struct GNUNET_FS_Handle *h,
2341 const struct GNUNET_FS_Uri *uri, 2242 const struct GNUNET_FS_Uri *uri,
2342 const struct GNUNET_CONTAINER_MetaData *meta, 2243 const struct GNUNET_CONTAINER_MetaData *meta,
2343 void *client_info, 2244 void *client_info,
2344 uint32_t anonymity); 2245 uint32_t anonymity);
2345 2246
2346 2247
2347/** 2248/**
@@ -2352,15 +2253,14 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h,
2352 * @return the value of the 'client_info' pointer 2253 * @return the value of the 'client_info' pointer
2353 */ 2254 */
2354void * 2255void *
2355GNUNET_FS_probe_stop (struct GNUNET_FS_SearchResult *sr); 2256GNUNET_FS_probe_stop(struct GNUNET_FS_SearchResult *sr);
2356 2257
2357 2258
2358/** 2259/**
2359 * Options for downloading. Compatible options 2260 * Options for downloading. Compatible options
2360 * can be OR'ed together. 2261 * can be OR'ed together.
2361 */ 2262 */
2362enum GNUNET_FS_DownloadOptions 2263enum GNUNET_FS_DownloadOptions {
2363{
2364 /** 2264 /**
2365 * No options (use defaults for everything). 2265 * No options (use defaults for everything).
2366 */ 2266 */
@@ -2426,13 +2326,13 @@ enum GNUNET_FS_DownloadOptions
2426 * @return context that can be used to control this download 2326 * @return context that can be used to control this download
2427 */ 2327 */
2428struct GNUNET_FS_DownloadContext * 2328struct GNUNET_FS_DownloadContext *
2429GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, 2329GNUNET_FS_download_start(struct GNUNET_FS_Handle *h,
2430 const struct GNUNET_FS_Uri *uri, 2330 const struct GNUNET_FS_Uri *uri,
2431 const struct GNUNET_CONTAINER_MetaData *meta, 2331 const struct GNUNET_CONTAINER_MetaData *meta,
2432 const char *filename, const char *tempname, 2332 const char *filename, const char *tempname,
2433 uint64_t offset, uint64_t length, uint32_t anonymity, 2333 uint64_t offset, uint64_t length, uint32_t anonymity,
2434 enum GNUNET_FS_DownloadOptions options, void *cctx, 2334 enum GNUNET_FS_DownloadOptions options, void *cctx,
2435 struct GNUNET_FS_DownloadContext *parent); 2335 struct GNUNET_FS_DownloadContext *parent);
2436 2336
2437 2337
2438/** 2338/**
@@ -2470,13 +2370,13 @@ GNUNET_FS_download_start (struct GNUNET_FS_Handle *h,
2470 * @return context that can be used to control this download 2370 * @return context that can be used to control this download
2471 */ 2371 */
2472struct GNUNET_FS_DownloadContext * 2372struct GNUNET_FS_DownloadContext *
2473GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, 2373GNUNET_FS_download_start_from_search(struct GNUNET_FS_Handle *h,
2474 struct GNUNET_FS_SearchResult *sr, 2374 struct GNUNET_FS_SearchResult *sr,
2475 const char *filename, 2375 const char *filename,
2476 const char *tempname, uint64_t offset, 2376 const char *tempname, uint64_t offset,
2477 uint64_t length, uint32_t anonymity, 2377 uint64_t length, uint32_t anonymity,
2478 enum GNUNET_FS_DownloadOptions options, 2378 enum GNUNET_FS_DownloadOptions options,
2479 void *cctx); 2379 void *cctx);
2480 2380
2481 2381
2482/** 2382/**
@@ -2486,7 +2386,7 @@ GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h,
2486 * @param do_delete delete files of incomplete downloads 2386 * @param do_delete delete files of incomplete downloads
2487 */ 2387 */
2488void 2388void
2489GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); 2389GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete);
2490 2390
2491 2391
2492/** 2392/**
@@ -2495,7 +2395,7 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete);
2495 * @param dc handle for the download 2395 * @param dc handle for the download
2496 */ 2396 */
2497void 2397void
2498GNUNET_FS_download_suspend (struct GNUNET_FS_DownloadContext *dc); 2398GNUNET_FS_download_suspend(struct GNUNET_FS_DownloadContext *dc);
2499 2399
2500 2400
2501/** 2401/**
@@ -2504,7 +2404,7 @@ GNUNET_FS_download_suspend (struct GNUNET_FS_DownloadContext *dc);
2504 * @param dc handle for the download 2404 * @param dc handle for the download
2505 */ 2405 */
2506void 2406void
2507GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc); 2407GNUNET_FS_download_resume(struct GNUNET_FS_DownloadContext *dc);
2508 2408
2509 2409
2510 2410
@@ -2523,8 +2423,8 @@ GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc);
2523 * we have no mime-type information (treat as #GNUNET_NO) 2423 * we have no mime-type information (treat as #GNUNET_NO)
2524 */ 2424 */
2525int 2425int
2526GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData 2426GNUNET_FS_meta_data_test_for_directory(const struct GNUNET_CONTAINER_MetaData
2527 *md); 2427 *md);
2528 2428
2529 2429
2530/** 2430/**
@@ -2534,7 +2434,7 @@ GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData
2534 * @param md metadata to add mimetype to 2434 * @param md metadata to add mimetype to
2535 */ 2435 */
2536void 2436void
2537GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); 2437GNUNET_FS_meta_data_make_directory(struct GNUNET_CONTAINER_MetaData *md);
2538 2438
2539 2439
2540/** 2440/**
@@ -2544,7 +2444,7 @@ GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md);
2544 * @return NULL if meta data is useless for suggesting a filename 2444 * @return NULL if meta data is useless for suggesting a filename
2545 */ 2445 */
2546char * 2446char *
2547GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData *md); 2447GNUNET_FS_meta_data_suggest_filename(const struct GNUNET_CONTAINER_MetaData *md);
2548 2448
2549 2449
2550/** 2450/**
@@ -2592,10 +2492,10 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls,
2592 * #GNUNET_SYSERR if 'data' does not represent a directory 2492 * #GNUNET_SYSERR if 'data' does not represent a directory
2593 */ 2493 */
2594int 2494int
2595GNUNET_FS_directory_list_contents (size_t size, const void *data, 2495GNUNET_FS_directory_list_contents(size_t size, const void *data,
2596 uint64_t offset, 2496 uint64_t offset,
2597 GNUNET_FS_DirectoryEntryProcessor dep, 2497 GNUNET_FS_DirectoryEntryProcessor dep,
2598 void *dep_cls); 2498 void *dep_cls);
2599 2499
2600 2500
2601/** 2501/**
@@ -2610,8 +2510,8 @@ struct GNUNET_FS_DirectoryBuilder;
2610 * @param mdir metadata for the directory 2510 * @param mdir metadata for the directory
2611 */ 2511 */
2612struct GNUNET_FS_DirectoryBuilder * 2512struct GNUNET_FS_DirectoryBuilder *
2613GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData 2513GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData
2614 *mdir); 2514 *mdir);
2615 2515
2616 2516
2617/** 2517/**
@@ -2625,10 +2525,10 @@ GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData
2625 * by the uri 2525 * by the uri
2626 */ 2526 */
2627void 2527void
2628GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, 2528GNUNET_FS_directory_builder_add(struct GNUNET_FS_DirectoryBuilder *bld,
2629 const struct GNUNET_FS_Uri *uri, 2529 const struct GNUNET_FS_Uri *uri,
2630 const struct GNUNET_CONTAINER_MetaData *md, 2530 const struct GNUNET_CONTAINER_MetaData *md,
2631 const void *data); 2531 const void *data);
2632 2532
2633 2533
2634/** 2534/**
@@ -2642,8 +2542,8 @@ GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
2642 * @return #GNUNET_OK on success 2542 * @return #GNUNET_OK on success
2643 */ 2543 */
2644int 2544int
2645GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, 2545GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld,
2646 size_t * rsize, void **rdata); 2546 size_t * rsize, void **rdata);
2647 2547
2648 2548
2649/* ******************** DirScanner API *********************** */ 2549/* ******************** DirScanner API *********************** */
@@ -2651,9 +2551,7 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
2651/** 2551/**
2652 * Progress reasons of the directory scanner. 2552 * Progress reasons of the directory scanner.
2653 */ 2553 */
2654enum GNUNET_FS_DirScannerProgressUpdateReason 2554enum GNUNET_FS_DirScannerProgressUpdateReason {
2655{
2656
2657 /** 2555 /**
2658 * We've started processing a file or directory. 2556 * We've started processing a file or directory.
2659 */ 2557 */
@@ -2685,7 +2583,6 @@ enum GNUNET_FS_DirScannerProgressUpdateReason
2685 * There was an internal error. Application should abort the scan. 2583 * There was an internal error. Application should abort the scan.
2686 */ 2584 */
2687 GNUNET_FS_DIRSCANNER_INTERNAL_ERROR 2585 GNUNET_FS_DIRSCANNER_INTERNAL_ERROR
2688
2689}; 2586};
2690 2587
2691 2588
@@ -2701,16 +2598,15 @@ enum GNUNET_FS_DirScannerProgressUpdateReason
2701 * @param reason kind of progress we are making 2598 * @param reason kind of progress we are making
2702 */ 2599 */
2703typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls, 2600typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls,
2704 const char *filename, 2601 const char *filename,
2705 int is_directory, 2602 int is_directory,
2706 enum GNUNET_FS_DirScannerProgressUpdateReason reason); 2603 enum GNUNET_FS_DirScannerProgressUpdateReason reason);
2707 2604
2708 2605
2709/** 2606/**
2710 * A node of a directory tree (produced by dirscanner) 2607 * A node of a directory tree (produced by dirscanner)
2711 */ 2608 */
2712struct GNUNET_FS_ShareTreeItem 2609struct GNUNET_FS_ShareTreeItem {
2713{
2714 /** 2610 /**
2715 * This is a doubly-linked list 2611 * This is a doubly-linked list
2716 */ 2612 */
@@ -2763,7 +2659,6 @@ struct GNUNET_FS_ShareTreeItem
2763 * #GNUNET_YES if this is a directory 2659 * #GNUNET_YES if this is a directory
2764 */ 2660 */
2765 int is_directory; 2661 int is_directory;
2766
2767}; 2662};
2768 2663
2769 2664
@@ -2785,11 +2680,11 @@ struct GNUNET_FS_DirScanner;
2785 * @return directory scanner object to be used for controlling the scanner 2680 * @return directory scanner object to be used for controlling the scanner
2786 */ 2681 */
2787struct GNUNET_FS_DirScanner * 2682struct GNUNET_FS_DirScanner *
2788GNUNET_FS_directory_scan_start (const char *filename, 2683GNUNET_FS_directory_scan_start(const char *filename,
2789 int disable_extractor, 2684 int disable_extractor,
2790 const char *ex, 2685 const char *ex,
2791 GNUNET_FS_DirScannerProgressCallback cb, 2686 GNUNET_FS_DirScannerProgressCallback cb,
2792 void *cb_cls); 2687 void *cb_cls);
2793 2688
2794 2689
2795/** 2690/**
@@ -2799,7 +2694,7 @@ GNUNET_FS_directory_scan_start (const char *filename,
2799 * @param ds directory scanner structure 2694 * @param ds directory scanner structure
2800 */ 2695 */
2801void 2696void
2802GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds); 2697GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds);
2803 2698
2804 2699
2805/** 2700/**
@@ -2811,7 +2706,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds);
2811 * @return the results of the scan (a directory tree) 2706 * @return the results of the scan (a directory tree)
2812 */ 2707 */
2813struct GNUNET_FS_ShareTreeItem * 2708struct GNUNET_FS_ShareTreeItem *
2814GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds); 2709GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds);
2815 2710
2816 2711
2817/** 2712/**
@@ -2821,7 +2716,7 @@ GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds);
2821 * @param toplevel toplevel directory in the tree, returned by the scanner 2716 * @param toplevel toplevel directory in the tree, returned by the scanner
2822 */ 2717 */
2823void 2718void
2824GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel); 2719GNUNET_FS_share_tree_trim(struct GNUNET_FS_ShareTreeItem *toplevel);
2825 2720
2826 2721
2827/** 2722/**
@@ -2830,7 +2725,7 @@ GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel);
2830 * @param toplevel toplevel of the tree to be freed 2725 * @param toplevel toplevel of the tree to be freed
2831 */ 2726 */
2832void 2727void
2833GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel); 2728GNUNET_FS_share_tree_free(struct GNUNET_FS_ShareTreeItem *toplevel);
2834 2729
2835 2730
2836#if 0 /* keep Emacsens' auto-indent happy */ 2731#if 0 /* keep Emacsens' auto-indent happy */