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.h558
1 files changed, 306 insertions, 252 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 688c6d489..2b25b5c81 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -80,7 +80,8 @@ 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 ( \
84 GNUNET_TIME_UNIT_MILLISECONDS, 250)
84 85
85/** 86/**
86 * A Universal Resource Identifier (URI), opaque. 87 * A Universal Resource Identifier (URI), opaque.
@@ -112,8 +113,8 @@ typedef int
112 * @return #GNUNET_OK on success 113 * @return #GNUNET_OK on success
113 */ 114 */
114int 115int
115GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri, 116GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
116 struct GNUNET_HashCode *key); 117 struct GNUNET_HashCode *key);
117 118
118 119
119/** 120/**
@@ -123,7 +124,7 @@ GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri,
123 * @return the UTF-8 string 124 * @return the UTF-8 string
124 */ 125 */
125char * 126char *
126GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri); 127GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri);
127 128
128 129
129/** 130/**
@@ -134,7 +135,7 @@ GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri);
134 * @return string with the keywords 135 * @return string with the keywords
135 */ 136 */
136char * 137char *
137GNUNET_FS_uri_ksk_to_string_fancy(const struct GNUNET_FS_Uri *uri); 138GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri);
138 139
139 140
140/** 141/**
@@ -146,9 +147,9 @@ GNUNET_FS_uri_ksk_to_string_fancy(const struct GNUNET_FS_Uri *uri);
146 * @param is_mandatory is this keyword mandatory? 147 * @param is_mandatory is this keyword mandatory?
147 */ 148 */
148void 149void
149GNUNET_FS_uri_ksk_add_keyword(struct GNUNET_FS_Uri *uri, 150GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri,
150 const char *keyword, 151 const char *keyword,
151 int is_mandatory); 152 int is_mandatory);
152 153
153 154
154/** 155/**
@@ -159,8 +160,8 @@ GNUNET_FS_uri_ksk_add_keyword(struct GNUNET_FS_Uri *uri,
159 * @param keyword keyword to add 160 * @param keyword keyword to add
160 */ 161 */
161void 162void
162GNUNET_FS_uri_ksk_remove_keyword(struct GNUNET_FS_Uri *uri, 163GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri,
163 const char *keyword); 164 const char *keyword);
164 165
165 166
166/** 167/**
@@ -171,8 +172,8 @@ GNUNET_FS_uri_ksk_remove_keyword(struct GNUNET_FS_Uri *uri,
171 * @return NULL on error 172 * @return NULL on error
172 */ 173 */
173struct GNUNET_FS_Uri * 174struct GNUNET_FS_Uri *
174GNUNET_FS_uri_parse(const char *uri, 175GNUNET_FS_uri_parse (const char *uri,
175 char **emsg); 176 char **emsg);
176 177
177 178
178/** 179/**
@@ -181,7 +182,7 @@ GNUNET_FS_uri_parse(const char *uri,
181 * @param uri uri to free 182 * @param uri uri to free
182 */ 183 */
183void 184void
184GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri); 185GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri);
185 186
186 187
187/** 188/**
@@ -191,7 +192,7 @@ GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri);
191 * @return 0 if this is not a keyword URI 192 * @return 0 if this is not a keyword URI
192 */ 193 */
193unsigned int 194unsigned int
194GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri); 195GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri);
195 196
196 197
197/** 198/**
@@ -204,9 +205,9 @@ GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri);
204 * keywords iterated over until iterator aborted 205 * keywords iterated over until iterator aborted
205 */ 206 */
206int 207int
207GNUNET_FS_uri_ksk_get_keywords(const struct GNUNET_FS_Uri *uri, 208GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri,
208 GNUNET_FS_KeywordIterator iterator, 209 GNUNET_FS_KeywordIterator iterator,
209 void *iterator_cls); 210 void *iterator_cls);
210 211
211 212
212/** 213/**
@@ -217,8 +218,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 218 * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK
218 */ 219 */
219int 220int
220GNUNET_FS_uri_loc_get_peer_identity(const struct GNUNET_FS_Uri *uri, 221GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
221 struct GNUNET_PeerIdentity *peer); 222 struct GNUNET_PeerIdentity *peer);
222 223
223 224
224/** 225/**
@@ -228,7 +229,7 @@ GNUNET_FS_uri_loc_get_peer_identity(const struct GNUNET_FS_Uri *uri,
228 * @return NULL if argument is not a location URI 229 * @return NULL if argument is not a location URI
229 */ 230 */
230struct GNUNET_FS_Uri * 231struct GNUNET_FS_Uri *
231GNUNET_FS_uri_loc_get_uri(const struct GNUNET_FS_Uri *uri); 232GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri);
232 233
233 234
234/** 235/**
@@ -238,7 +239,7 @@ GNUNET_FS_uri_loc_get_uri(const struct GNUNET_FS_Uri *uri);
238 * @return expiration time of the URI 239 * @return expiration time of the URI
239 */ 240 */
240struct GNUNET_TIME_Absolute 241struct GNUNET_TIME_Absolute
241GNUNET_FS_uri_loc_get_expiration(const struct GNUNET_FS_Uri *uri); 242GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri);
242 243
243 244
244/** 245/**
@@ -254,9 +255,9 @@ GNUNET_FS_uri_loc_get_expiration(const struct GNUNET_FS_Uri *uri);
254 * @return the location URI, NULL on error 255 * @return the location URI, NULL on error
255 */ 256 */
256struct GNUNET_FS_Uri * 257struct GNUNET_FS_Uri *
257GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri, 258GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri,
258 const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key, 259 const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key,
259 struct GNUNET_TIME_Absolute expiration_time); 260 struct GNUNET_TIME_Absolute expiration_time);
260 261
261 262
262/** 263/**
@@ -267,8 +268,8 @@ GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri,
267 * @return merged URI, NULL on error 268 * @return merged URI, NULL on error
268 */ 269 */
269struct GNUNET_FS_Uri * 270struct GNUNET_FS_Uri *
270GNUNET_FS_uri_ksk_merge(const struct GNUNET_FS_Uri *u1, 271GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
271 const struct GNUNET_FS_Uri *u2); 272 const struct GNUNET_FS_Uri *u2);
272 273
273 274
274/** 275/**
@@ -278,7 +279,7 @@ GNUNET_FS_uri_ksk_merge(const struct GNUNET_FS_Uri *u1,
278 * @return copy of the URI 279 * @return copy of the URI
279 */ 280 */
280struct GNUNET_FS_Uri * 281struct GNUNET_FS_Uri *
281GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri); 282GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri);
282 283
283 284
284/** 285/**
@@ -299,8 +300,8 @@ GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri);
299 * if keywords is not legal (i.e. empty). 300 * if keywords is not legal (i.e. empty).
300 */ 301 */
301struct GNUNET_FS_Uri * 302struct GNUNET_FS_Uri *
302GNUNET_FS_uri_ksk_create(const char *keywords, 303GNUNET_FS_uri_ksk_create (const char *keywords,
303 char **emsg); 304 char **emsg);
304 305
305 306
306/** 307/**
@@ -321,8 +322,8 @@ GNUNET_FS_uri_ksk_create(const char *keywords,
321 * if keywords is not legal (i.e. empty). 322 * if keywords is not legal (i.e. empty).
322 */ 323 */
323struct GNUNET_FS_Uri * 324struct GNUNET_FS_Uri *
324GNUNET_FS_uri_ksk_create_from_args(unsigned int argc, 325GNUNET_FS_uri_ksk_create_from_args (unsigned int argc,
325 const char **argv); 326 const char **argv);
326 327
327 328
328/** 329/**
@@ -333,8 +334,8 @@ GNUNET_FS_uri_ksk_create_from_args(unsigned int argc,
333 * @return #GNUNET_YES if the URIs are equal 334 * @return #GNUNET_YES if the URIs are equal
334 */ 335 */
335int 336int
336GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1, 337GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
337 const struct GNUNET_FS_Uri *u2); 338 const struct GNUNET_FS_Uri *u2);
338 339
339 340
340/** 341/**
@@ -344,7 +345,7 @@ GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1,
344 * @return #GNUNET_YES if this is an SKS uri 345 * @return #GNUNET_YES if this is an SKS uri
345 */ 346 */
346int 347int
347GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri); 348GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
348 349
349 350
350/** 351/**
@@ -355,8 +356,8 @@ GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri);
355 * @return an FS URI for the given namespace and identifier 356 * @return an FS URI for the given namespace and identifier
356 */ 357 */
357struct GNUNET_FS_Uri * 358struct GNUNET_FS_Uri *
358GNUNET_FS_uri_sks_create(const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, 359GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
359 const char *id); 360 const char *id);
360 361
361 362
362/** 363/**
@@ -368,8 +369,8 @@ GNUNET_FS_uri_sks_create(const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
368 * @return #GNUNET_OK on success 369 * @return #GNUNET_OK on success
369 */ 370 */
370int 371int
371GNUNET_FS_uri_sks_get_namespace(const struct GNUNET_FS_Uri *uri, 372GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
372 struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym); 373 struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym);
373 374
374 375
375/** 376/**
@@ -379,7 +380,7 @@ GNUNET_FS_uri_sks_get_namespace(const struct GNUNET_FS_Uri *uri,
379 * @return NULL on error (not a valid SKS URI) 380 * @return NULL on error (not a valid SKS URI)
380 */ 381 */
381char * 382char *
382GNUNET_FS_uri_sks_get_content_id(const struct GNUNET_FS_Uri *uri); 383GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri);
383 384
384 385
385/** 386/**
@@ -389,7 +390,7 @@ GNUNET_FS_uri_sks_get_content_id(const struct GNUNET_FS_Uri *uri);
389 * @return #GNUNET_YES if this is a KSK uri 390 * @return #GNUNET_YES if this is a KSK uri
390 */ 391 */
391int 392int
392GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri); 393GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri);
393 394
394 395
395/** 396/**
@@ -399,7 +400,7 @@ GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri);
399 * @return #GNUNET_YES if this is a CHK uri 400 * @return #GNUNET_YES if this is a CHK uri
400 */ 401 */
401int 402int
402GNUNET_FS_uri_test_chk(const struct GNUNET_FS_Uri *uri); 403GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri);
403 404
404 405
405/** 406/**
@@ -410,7 +411,7 @@ GNUNET_FS_uri_test_chk(const struct GNUNET_FS_Uri *uri);
410 * @return size of the file as specified in the CHK URI 411 * @return size of the file as specified in the CHK URI
411 */ 412 */
412uint64_t 413uint64_t
413GNUNET_FS_uri_chk_get_file_size(const struct GNUNET_FS_Uri *uri); 414GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri);
414 415
415 416
416/** 417/**
@@ -420,7 +421,7 @@ GNUNET_FS_uri_chk_get_file_size(const struct GNUNET_FS_Uri *uri);
420 * @return #GNUNET_YES if this is a LOC uri 421 * @return #GNUNET_YES if this is a LOC uri
421 */ 422 */
422int 423int
423GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri); 424GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri);
424 425
425 426
426/** 427/**
@@ -432,8 +433,8 @@ GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri);
432 * @return NULL on error, otherwise a KSK URI 433 * @return NULL on error, otherwise a KSK URI
433 */ 434 */
434struct GNUNET_FS_Uri * 435struct GNUNET_FS_Uri *
435GNUNET_FS_uri_ksk_create_from_meta_data(const struct GNUNET_CONTAINER_MetaData 436GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData
436 *md); 437 *md);
437 438
438 439
439/* ******************** command-line option parsing API *********************** */ 440/* ******************** command-line option parsing API *********************** */
@@ -448,11 +449,11 @@ GNUNET_FS_uri_ksk_create_from_meta_data(const struct GNUNET_CONTAINER_MetaData
448 * @param[out] topKeywords set to the desired value 449 * @param[out] topKeywords set to the desired value
449 */ 450 */
450struct GNUNET_GETOPT_CommandLineOption 451struct GNUNET_GETOPT_CommandLineOption
451GNUNET_FS_GETOPT_KEYWORDS(char shortName, 452GNUNET_FS_GETOPT_KEYWORDS (char shortName,
452 const char *name, 453 const char *name,
453 const char *argumentHelp, 454 const char *argumentHelp,
454 const char *description, 455 const char *description,
455 struct GNUNET_FS_Uri **topKeywords); 456 struct GNUNET_FS_Uri **topKeywords);
456 457
457/** 458/**
458 * Allow user to specify metadata. 459 * Allow user to specify metadata.
@@ -464,11 +465,11 @@ GNUNET_FS_GETOPT_KEYWORDS(char shortName,
464 * @param[out] metadata set to the desired value 465 * @param[out] metadata set to the desired value
465 */ 466 */
466struct GNUNET_GETOPT_CommandLineOption 467struct GNUNET_GETOPT_CommandLineOption
467GNUNET_FS_GETOPT_METADATA(char shortName, 468GNUNET_FS_GETOPT_METADATA (char shortName,
468 const char *name, 469 const char *name,
469 const char *argumentHelp, 470 const char *argumentHelp,
470 const char *description, 471 const char *description,
471 struct GNUNET_CONTAINER_MetaData **meta); 472 struct GNUNET_CONTAINER_MetaData **meta);
472 473
473/** 474/**
474 * Command-line option parser function that allows the user to specify 475 * Command-line option parser function that allows the user to specify
@@ -483,10 +484,11 @@ GNUNET_FS_GETOPT_METADATA(char shortName,
483 * @return #GNUNET_OK on success 484 * @return #GNUNET_OK on success
484 */ 485 */
485int 486int
486GNUNET_FS_getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 487GNUNET_FS_getopt_set_metadata (struct
487 void *scls, 488 GNUNET_GETOPT_CommandLineProcessorContext *ctx,
488 const char *option, 489 void *scls,
489 const char *value); 490 const char *option,
491 const char *value);
490 492
491 493
492 494
@@ -504,7 +506,8 @@ GNUNET_FS_getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *
504 * are typically generated either due to explicit client requests 506 * are typically generated either due to explicit client requests
505 * or because of suspend/resume operations. 507 * or because of suspend/resume operations.
506 */ 508 */
507enum GNUNET_FS_Status { 509enum GNUNET_FS_Status
510{
508 /** 511 /**
509 * Notification that we have started to publish a file structure. 512 * Notification that we have started to publish a file structure.
510 */ 513 */
@@ -770,15 +773,18 @@ struct GNUNET_FS_FileInformation;
770 * Argument given to the progress callback with 773 * Argument given to the progress callback with
771 * information about what is going on. 774 * information about what is going on.
772 */ 775 */
773struct GNUNET_FS_ProgressInfo { 776struct GNUNET_FS_ProgressInfo
777{
774 /** 778 /**
775 * Values that depend on the event type. 779 * Values that depend on the event type.
776 */ 780 */
777 union { 781 union
782 {
778 /** 783 /**
779 * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events. 784 * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events.
780 */ 785 */
781 struct { 786 struct
787 {
782 /** 788 /**
783 * Context for controlling the upload. 789 * Context for controlling the upload.
784 */ 790 */
@@ -840,12 +846,14 @@ struct GNUNET_FS_ProgressInfo {
840 /** 846 /**
841 * Additional values for specific events. 847 * Additional values for specific events.
842 */ 848 */
843 union { 849 union
850 {
844 /** 851 /**
845 * These values are only valid for 852 * These values are only valid for
846 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events. 853 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events.
847 */ 854 */
848 struct { 855 struct
856 {
849 /** 857 /**
850 * Data block we just published. 858 * Data block we just published.
851 */ 859 */
@@ -872,7 +880,8 @@ struct GNUNET_FS_ProgressInfo {
872 * These values are only valid for 880 * These values are only valid for
873 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events. 881 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events.
874 */ 882 */
875 struct { 883 struct
884 {
876 /** 885 /**
877 * How far are we along in the overall directory? 886 * How far are we along in the overall directory?
878 */ 887 */
@@ -896,7 +905,8 @@ struct GNUNET_FS_ProgressInfo {
896 * These values are only valid for 905 * These values are only valid for
897 * #GNUNET_FS_STATUS_PUBLISH_RESUME events. 906 * #GNUNET_FS_STATUS_PUBLISH_RESUME events.
898 */ 907 */
899 struct { 908 struct
909 {
900 /** 910 /**
901 * Error message, NULL if no error was encountered so far. 911 * Error message, NULL if no error was encountered so far.
902 */ 912 */
@@ -917,7 +927,8 @@ struct GNUNET_FS_ProgressInfo {
917 * These values are only valid for 927 * These values are only valid for
918 * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events. 928 * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events.
919 */ 929 */
920 struct { 930 struct
931 {
921 /** 932 /**
922 * CHK URI of the file. 933 * CHK URI of the file.
923 */ 934 */
@@ -933,7 +944,8 @@ struct GNUNET_FS_ProgressInfo {
933 * These values are only valid for 944 * These values are only valid for
934 * #GNUNET_FS_STATUS_PUBLISH_ERROR events. 945 * #GNUNET_FS_STATUS_PUBLISH_ERROR events.
935 */ 946 */
936 struct { 947 struct
948 {
937 /** 949 /**
938 * Error message, never NULL. 950 * Error message, never NULL.
939 */ 951 */
@@ -946,7 +958,8 @@ struct GNUNET_FS_ProgressInfo {
946 /** 958 /**
947 * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events. 959 * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events.
948 */ 960 */
949 struct { 961 struct
962 {
950 /** 963 /**
951 * Context for controlling the download. 964 * Context for controlling the download.
952 */ 965 */
@@ -1020,12 +1033,14 @@ struct GNUNET_FS_ProgressInfo {
1020 /** 1033 /**
1021 * Additional values for specific events. 1034 * Additional values for specific events.
1022 */ 1035 */
1023 union { 1036 union
1037 {
1024 /** 1038 /**
1025 * These values are only valid for 1039 * These values are only valid for
1026 * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events. 1040 * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events.
1027 */ 1041 */
1028 struct { 1042 struct
1043 {
1029 /** 1044 /**
1030 * Data block we just obtained, can be NULL (even if 1045 * Data block we just obtained, can be NULL (even if
1031 * data_len > 0) if we found the entire block 'intact' on 1046 * data_len > 0) if we found the entire block 'intact' on
@@ -1077,7 +1092,8 @@ struct GNUNET_FS_ProgressInfo {
1077 * These values are only valid for 1092 * These values are only valid for
1078 * #GNUNET_FS_STATUS_DOWNLOAD_START events. 1093 * #GNUNET_FS_STATUS_DOWNLOAD_START events.
1079 */ 1094 */
1080 struct { 1095 struct
1096 {
1081 /** 1097 /**
1082 * Known metadata for the download. 1098 * Known metadata for the download.
1083 */ 1099 */
@@ -1088,7 +1104,8 @@ struct GNUNET_FS_ProgressInfo {
1088 * These values are only valid for 1104 * These values are only valid for
1089 * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events. 1105 * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events.
1090 */ 1106 */
1091 struct { 1107 struct
1108 {
1092 /** 1109 /**
1093 * Known metadata for the download. 1110 * Known metadata for the download.
1094 */ 1111 */
@@ -1104,7 +1121,8 @@ struct GNUNET_FS_ProgressInfo {
1104 * These values are only valid for 1121 * These values are only valid for
1105 * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events. 1122 * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events.
1106 */ 1123 */
1107 struct { 1124 struct
1125 {
1108 /** 1126 /**
1109 * Error message. 1127 * Error message.
1110 */ 1128 */
@@ -1116,7 +1134,8 @@ struct GNUNET_FS_ProgressInfo {
1116 /** 1134 /**
1117 * Values for all "GNUNET_FS_STATUS_SEARCH_*" events. 1135 * Values for all "GNUNET_FS_STATUS_SEARCH_*" events.
1118 */ 1136 */
1119 struct { 1137 struct
1138 {
1120 /** 1139 /**
1121 * Context for controlling the search, NULL for 1140 * Context for controlling the search, NULL for
1122 * searches that were not explicitly triggered 1141 * searches that were not explicitly triggered
@@ -1164,12 +1183,14 @@ struct GNUNET_FS_ProgressInfo {
1164 /** 1183 /**
1165 * Additional values for specific events. 1184 * Additional values for specific events.
1166 */ 1185 */
1167 union { 1186 union
1187 {
1168 /** 1188 /**
1169 * These values are only valid for 1189 * These values are only valid for
1170 * #GNUNET_FS_STATUS_SEARCH_RESULT events. 1190 * #GNUNET_FS_STATUS_SEARCH_RESULT events.
1171 */ 1191 */
1172 struct { 1192 struct
1193 {
1173 /** 1194 /**
1174 * Metadata for the search result. 1195 * Metadata for the search result.
1175 */ 1196 */
@@ -1196,7 +1217,8 @@ struct GNUNET_FS_ProgressInfo {
1196 * These values are only valid for 1217 * These values are only valid for
1197 * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events. 1218 * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events.
1198 */ 1219 */
1199 struct { 1220 struct
1221 {
1200 /** 1222 /**
1201 * Metadata for the search result. 1223 * Metadata for the search result.
1202 */ 1224 */
@@ -1236,7 +1258,8 @@ struct GNUNET_FS_ProgressInfo {
1236 * These values are only valid for 1258 * These values are only valid for
1237 * #GNUNET_FS_STATUS_SEARCH_UPDATE events. 1259 * #GNUNET_FS_STATUS_SEARCH_UPDATE events.
1238 */ 1260 */
1239 struct { 1261 struct
1262 {
1240 /** 1263 /**
1241 * Private context set for for this result 1264 * Private context set for for this result
1242 * during the "RESULT" event. 1265 * during the "RESULT" event.
@@ -1287,7 +1310,8 @@ struct GNUNET_FS_ProgressInfo {
1287 * happens primarily to give the client a chance 1310 * happens primarily to give the client a chance
1288 * to clean up the "cctx" (if needed). 1311 * to clean up the "cctx" (if needed).
1289 */ 1312 */
1290 struct { 1313 struct
1314 {
1291 /** 1315 /**
1292 * Private context set for for this result 1316 * Private context set for for this result
1293 * during the "RESULT" event. 1317 * during the "RESULT" event.
@@ -1314,7 +1338,8 @@ struct GNUNET_FS_ProgressInfo {
1314 * happens primarily to give the client a chance 1338 * happens primarily to give the client a chance
1315 * to clean up the "cctx" (if needed). 1339 * to clean up the "cctx" (if needed).
1316 */ 1340 */
1317 struct { 1341 struct
1342 {
1318 /** 1343 /**
1319 * Private context set for for this result 1344 * Private context set for for this result
1320 * during the "RESULT" event. 1345 * during the "RESULT" event.
@@ -1336,7 +1361,8 @@ struct GNUNET_FS_ProgressInfo {
1336 * These values are only valid for 1361 * These values are only valid for
1337 * #GNUNET_FS_STATUS_SEARCH_RESUME events. 1362 * #GNUNET_FS_STATUS_SEARCH_RESUME events.
1338 */ 1363 */
1339 struct { 1364 struct
1365 {
1340 /** 1366 /**
1341 * Error message, NULL if we have not encountered any error yet. 1367 * Error message, NULL if we have not encountered any error yet.
1342 */ 1368 */
@@ -1352,7 +1378,8 @@ struct GNUNET_FS_ProgressInfo {
1352 * These values are only valid for 1378 * These values are only valid for
1353 * #GNUNET_FS_STATUS_SEARCH_ERROR events. 1379 * #GNUNET_FS_STATUS_SEARCH_ERROR events.
1354 */ 1380 */
1355 struct { 1381 struct
1382 {
1356 /** 1383 /**
1357 * Error message. 1384 * Error message.
1358 */ 1385 */
@@ -1362,7 +1389,8 @@ struct GNUNET_FS_ProgressInfo {
1362 /** 1389 /**
1363 * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events. 1390 * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events.
1364 */ 1391 */
1365 struct { 1392 struct
1393 {
1366 /** 1394 /**
1367 * Short, human-readable name of the namespace. 1395 * Short, human-readable name of the namespace.
1368 */ 1396 */
@@ -1389,7 +1417,8 @@ struct GNUNET_FS_ProgressInfo {
1389 /** 1417 /**
1390 * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events. 1418 * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events.
1391 */ 1419 */
1392 struct { 1420 struct
1421 {
1393 /** 1422 /**
1394 * Context for controlling the unindexing. 1423 * Context for controlling the unindexing.
1395 */ 1424 */
@@ -1433,12 +1462,14 @@ struct GNUNET_FS_ProgressInfo {
1433 /** 1462 /**
1434 * Additional values for specific events. 1463 * Additional values for specific events.
1435 */ 1464 */
1436 union { 1465 union
1466 {
1437 /** 1467 /**
1438 * These values are only valid for 1468 * These values are only valid for
1439 * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events. 1469 * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events.
1440 */ 1470 */
1441 struct { 1471 struct
1472 {
1442 /** 1473 /**
1443 * Data block we just unindexed. 1474 * Data block we just unindexed.
1444 */ 1475 */
@@ -1465,7 +1496,8 @@ struct GNUNET_FS_ProgressInfo {
1465 * These values are only valid for 1496 * These values are only valid for
1466 * #GNUNET_FS_STATUS_UNINDEX_RESUME events. 1497 * #GNUNET_FS_STATUS_UNINDEX_RESUME events.
1467 */ 1498 */
1468 struct { 1499 struct
1500 {
1469 /** 1501 /**
1470 * Error message, NULL if we have not encountered any error yet. 1502 * Error message, NULL if we have not encountered any error yet.
1471 */ 1503 */
@@ -1476,7 +1508,8 @@ struct GNUNET_FS_ProgressInfo {
1476 * These values are only valid for 1508 * These values are only valid for
1477 * #GNUNET_FS_STATUS_UNINDEX_ERROR events. 1509 * #GNUNET_FS_STATUS_UNINDEX_ERROR events.
1478 */ 1510 */
1479 struct { 1511 struct
1512 {
1480 /** 1513 /**
1481 * Error message. 1514 * Error message.
1482 */ 1515 */
@@ -1521,7 +1554,8 @@ typedef void *
1521/** 1554/**
1522 * General (global) option flags for file-sharing. 1555 * General (global) option flags for file-sharing.
1523 */ 1556 */
1524enum GNUNET_FS_Flags { 1557enum GNUNET_FS_Flags
1558{
1525 /** 1559 /**
1526 * No special flags set. 1560 * No special flags set.
1527 */ 1561 */
@@ -1545,7 +1579,8 @@ enum GNUNET_FS_Flags {
1545/** 1579/**
1546 * Options specified in the VARARGs portion of GNUNET_FS_start. 1580 * Options specified in the VARARGs portion of GNUNET_FS_start.
1547 */ 1581 */
1548enum GNUNET_FS_OPTIONS { 1582enum GNUNET_FS_OPTIONS
1583{
1549 /** 1584 /**
1550 * Last option in the VARARG list. 1585 * Last option in the VARARG list.
1551 */ 1586 */
@@ -1572,7 +1607,8 @@ enum GNUNET_FS_OPTIONS {
1572 * Settings for publishing a block (which may of course also 1607 * Settings for publishing a block (which may of course also
1573 * apply to an entire directory or file). 1608 * apply to an entire directory or file).
1574 */ 1609 */
1575struct GNUNET_FS_BlockOptions { 1610struct GNUNET_FS_BlockOptions
1611{
1576 /** 1612 /**
1577 * At what time should the block expire? Data blocks (DBLOCKS and 1613 * At what time should the block expire? Data blocks (DBLOCKS and
1578 * IBLOCKS) may still be used even if they are expired (however, 1614 * IBLOCKS) may still be used even if they are expired (however,
@@ -1628,12 +1664,12 @@ struct GNUNET_FS_Handle;
1628 * @return NULL on error 1664 * @return NULL on error
1629 */ 1665 */
1630struct GNUNET_FS_Handle * 1666struct GNUNET_FS_Handle *
1631GNUNET_FS_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 1667GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
1632 const char *client_name, 1668 const char *client_name,
1633 GNUNET_FS_ProgressCallback upcb, 1669 GNUNET_FS_ProgressCallback upcb,
1634 void *upcb_cls, 1670 void *upcb_cls,
1635 enum GNUNET_FS_Flags flags, 1671 enum GNUNET_FS_Flags flags,
1636 ...); 1672 ...);
1637 1673
1638 1674
1639/** 1675/**
@@ -1646,7 +1682,7 @@ GNUNET_FS_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
1646 * @param h handle that was returned from #GNUNET_FS_start() 1682 * @param h handle that was returned from #GNUNET_FS_start()
1647 */ 1683 */
1648void 1684void
1649GNUNET_FS_stop(struct GNUNET_FS_Handle *h); 1685GNUNET_FS_stop (struct GNUNET_FS_Handle *h);
1650 1686
1651 1687
1652/** 1688/**
@@ -1669,7 +1705,7 @@ typedef int
1669 struct GNUNET_FS_FileInformation *fi, 1705 struct GNUNET_FS_FileInformation *fi,
1670 uint64_t length, 1706 uint64_t length,
1671 struct GNUNET_CONTAINER_MetaData *meta, 1707 struct GNUNET_CONTAINER_MetaData *meta,
1672 struct GNUNET_FS_Uri ** uri, 1708 struct GNUNET_FS_Uri **uri,
1673 struct GNUNET_FS_BlockOptions *bo, 1709 struct GNUNET_FS_BlockOptions *bo,
1674 int *do_index, 1710 int *do_index,
1675 void **client_info); 1711 void **client_info);
@@ -1685,7 +1721,7 @@ typedef int
1685 * to read this fi-struct from disk. 1721 * to read this fi-struct from disk.
1686 */ 1722 */
1687const char * 1723const char *
1688GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s); 1724GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s);
1689 1725
1690 1726
1691/** 1727/**
@@ -1695,7 +1731,7 @@ GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s);
1695 * @return "filename" field of the structure (can be NULL) 1731 * @return "filename" field of the structure (can be NULL)
1696 */ 1732 */
1697const char * 1733const char *
1698GNUNET_FS_file_information_get_filename(struct GNUNET_FS_FileInformation *s); 1734GNUNET_FS_file_information_get_filename (struct GNUNET_FS_FileInformation *s);
1699 1735
1700 1736
1701/** 1737/**
@@ -1707,8 +1743,8 @@ GNUNET_FS_file_information_get_filename(struct GNUNET_FS_FileInformation *s);
1707 * @param filename filename to set 1743 * @param filename filename to set
1708 */ 1744 */
1709void 1745void
1710GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s, 1746GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s,
1711 const char *filename); 1747 const char *filename);
1712 1748
1713 1749
1714/** 1750/**
@@ -1726,13 +1762,16 @@ GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s,
1726 * @return publish structure entry for the file 1762 * @return publish structure entry for the file
1727 */ 1763 */
1728struct GNUNET_FS_FileInformation * 1764struct GNUNET_FS_FileInformation *
1729GNUNET_FS_file_information_create_from_file(struct GNUNET_FS_Handle *h, 1765GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
1730 void *client_info, 1766 void *client_info,
1731 const char *filename, 1767 const char *filename,
1732 const struct GNUNET_FS_Uri *keywords, 1768 const struct
1733 const struct GNUNET_CONTAINER_MetaData *meta, 1769 GNUNET_FS_Uri *keywords,
1734 int do_index, 1770 const struct
1735 const struct GNUNET_FS_BlockOptions *bo); 1771 GNUNET_CONTAINER_MetaData *meta,
1772 int do_index,
1773 const struct
1774 GNUNET_FS_BlockOptions *bo);
1736 1775
1737 1776
1738/** 1777/**
@@ -1752,14 +1791,17 @@ GNUNET_FS_file_information_create_from_file(struct GNUNET_FS_Handle *h,
1752 * @return publish structure entry for the file 1791 * @return publish structure entry for the file
1753 */ 1792 */
1754struct GNUNET_FS_FileInformation * 1793struct GNUNET_FS_FileInformation *
1755GNUNET_FS_file_information_create_from_data(struct GNUNET_FS_Handle *h, 1794GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
1756 void *client_info, 1795 void *client_info,
1757 uint64_t length, 1796 uint64_t length,
1758 void *data, 1797 void *data,
1759 const struct GNUNET_FS_Uri *keywords, 1798 const struct
1760 const struct GNUNET_CONTAINER_MetaData *meta, 1799 GNUNET_FS_Uri *keywords,
1761 int do_index, 1800 const struct
1762 const struct GNUNET_FS_BlockOptions *bo); 1801 GNUNET_CONTAINER_MetaData *meta,
1802 int do_index,
1803 const struct
1804 GNUNET_FS_BlockOptions *bo);
1763 1805
1764 1806
1765/** 1807/**
@@ -1807,18 +1849,18 @@ typedef size_t
1807 * @return publish structure entry for the file 1849 * @return publish structure entry for the file
1808 */ 1850 */
1809struct GNUNET_FS_FileInformation * 1851struct GNUNET_FS_FileInformation *
1810GNUNET_FS_file_information_create_from_reader(struct GNUNET_FS_Handle *h, 1852GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
1811 void *client_info, 1853 void *client_info,
1812 uint64_t length, 1854 uint64_t length,
1813 GNUNET_FS_DataReader reader, 1855 GNUNET_FS_DataReader reader,
1814 void *reader_cls, 1856 void *reader_cls,
1815 const struct GNUNET_FS_Uri 1857 const struct GNUNET_FS_Uri
1816 *keywords, 1858 *keywords,
1817 const struct 1859 const struct
1818 GNUNET_CONTAINER_MetaData *meta, 1860 GNUNET_CONTAINER_MetaData *meta,
1819 int do_index, 1861 int do_index,
1820 const struct 1862 const struct
1821 GNUNET_FS_BlockOptions *bo); 1863 GNUNET_FS_BlockOptions *bo);
1822 1864
1823 1865
1824/** 1866/**
@@ -1834,16 +1876,16 @@ GNUNET_FS_file_information_create_from_reader(struct GNUNET_FS_Handle *h,
1834 * @return publish structure entry for the directory , NULL on error 1876 * @return publish structure entry for the directory , NULL on error
1835 */ 1877 */
1836struct GNUNET_FS_FileInformation * 1878struct GNUNET_FS_FileInformation *
1837GNUNET_FS_file_information_create_empty_directory(struct GNUNET_FS_Handle *h, 1879GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
1838 void *client_info, 1880 void *client_info,
1839 const struct GNUNET_FS_Uri 1881 const struct GNUNET_FS_Uri
1840 *keywords, 1882 *keywords,
1841 const struct 1883 const struct
1842 GNUNET_CONTAINER_MetaData 1884 GNUNET_CONTAINER_MetaData
1843 *meta, 1885 *meta,
1844 const struct 1886 const struct
1845 GNUNET_FS_BlockOptions *bo, 1887 GNUNET_FS_BlockOptions *bo,
1846 const char *filename); 1888 const char *filename);
1847 1889
1848 1890
1849/** 1891/**
@@ -1853,8 +1895,8 @@ GNUNET_FS_file_information_create_empty_directory(struct GNUNET_FS_Handle *h,
1853 * @return #GNUNET_YES if so, #GNUNET_NO if not 1895 * @return #GNUNET_YES if so, #GNUNET_NO if not
1854 */ 1896 */
1855int 1897int
1856GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation 1898GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation
1857 *ent); 1899 *ent);
1858 1900
1859 1901
1860/** 1902/**
@@ -1869,8 +1911,8 @@ GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation
1869 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1911 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1870 */ 1912 */
1871int 1913int
1872GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir, 1914GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
1873 struct GNUNET_FS_FileInformation *ent); 1915 struct GNUNET_FS_FileInformation *ent);
1874 1916
1875 1917
1876/** 1918/**
@@ -1888,9 +1930,9 @@ GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir,
1888 * @param proc_cls closure for @a proc 1930 * @param proc_cls closure for @a proc
1889 */ 1931 */
1890void 1932void
1891GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir, 1933GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
1892 GNUNET_FS_FileInformationProcessor proc, 1934 GNUNET_FS_FileInformationProcessor proc,
1893 void *proc_cls); 1935 void *proc_cls);
1894 1936
1895 1937
1896/** 1938/**
@@ -1904,16 +1946,17 @@ GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir,
1904 * @param cleaner_cls closure for @a cleaner 1946 * @param cleaner_cls closure for @a cleaner
1905 */ 1947 */
1906void 1948void
1907GNUNET_FS_file_information_destroy(struct GNUNET_FS_FileInformation *fi, 1949GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
1908 GNUNET_FS_FileInformationProcessor cleaner, 1950 GNUNET_FS_FileInformationProcessor cleaner,
1909 void *cleaner_cls); 1951 void *cleaner_cls);
1910 1952
1911 1953
1912/** 1954/**
1913 * Options for publishing. Compatible options 1955 * Options for publishing. Compatible options
1914 * can be OR'ed together. 1956 * can be OR'ed together.
1915 */ 1957 */
1916enum GNUNET_FS_PublishOptions { 1958enum GNUNET_FS_PublishOptions
1959{
1917 /** 1960 /**
1918 * No options (use defaults for everything). 1961 * No options (use defaults for everything).
1919 */ 1962 */
@@ -1941,12 +1984,12 @@ enum GNUNET_FS_PublishOptions {
1941 * @return context that can be used to control the publish operation 1984 * @return context that can be used to control the publish operation
1942 */ 1985 */
1943struct GNUNET_FS_PublishContext * 1986struct GNUNET_FS_PublishContext *
1944GNUNET_FS_publish_start(struct GNUNET_FS_Handle *h, 1987GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1945 struct GNUNET_FS_FileInformation *fi, 1988 struct GNUNET_FS_FileInformation *fi,
1946 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 1989 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
1947 const char *nid, 1990 const char *nid,
1948 const char *nuid, 1991 const char *nuid,
1949 enum GNUNET_FS_PublishOptions options); 1992 enum GNUNET_FS_PublishOptions options);
1950 1993
1951 1994
1952/** 1995/**
@@ -1958,7 +2001,7 @@ GNUNET_FS_publish_start(struct GNUNET_FS_Handle *h,
1958 * @param pc context for the publication to stop 2001 * @param pc context for the publication to stop
1959 */ 2002 */
1960void 2003void
1961GNUNET_FS_publish_stop(struct GNUNET_FS_PublishContext *pc); 2004GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc);
1962 2005
1963 2006
1964/** 2007/**
@@ -1995,13 +2038,13 @@ struct GNUNET_FS_PublishKskContext;
1995 * @return NULL on error (@a cont will still be called) 2038 * @return NULL on error (@a cont will still be called)
1996 */ 2039 */
1997struct GNUNET_FS_PublishKskContext * 2040struct GNUNET_FS_PublishKskContext *
1998GNUNET_FS_publish_ksk(struct GNUNET_FS_Handle *h, 2041GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1999 const struct GNUNET_FS_Uri *ksk_uri, 2042 const struct GNUNET_FS_Uri *ksk_uri,
2000 const struct GNUNET_CONTAINER_MetaData *meta, 2043 const struct GNUNET_CONTAINER_MetaData *meta,
2001 const struct GNUNET_FS_Uri *uri, 2044 const struct GNUNET_FS_Uri *uri,
2002 const struct GNUNET_FS_BlockOptions *bo, 2045 const struct GNUNET_FS_BlockOptions *bo,
2003 enum GNUNET_FS_PublishOptions options, 2046 enum GNUNET_FS_PublishOptions options,
2004 GNUNET_FS_PublishContinuation cont, void *cont_cls); 2047 GNUNET_FS_PublishContinuation cont, void *cont_cls);
2005 2048
2006 2049
2007/** 2050/**
@@ -2010,7 +2053,7 @@ GNUNET_FS_publish_ksk(struct GNUNET_FS_Handle *h,
2010 * @param pkc context of the operation to abort. 2053 * @param pkc context of the operation to abort.
2011 */ 2054 */
2012void 2055void
2013GNUNET_FS_publish_ksk_cancel(struct GNUNET_FS_PublishKskContext *pkc); 2056GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc);
2014 2057
2015 2058
2016/** 2059/**
@@ -2035,15 +2078,15 @@ struct GNUNET_FS_PublishSksContext;
2035 * @return NULL on error (@a cont will still be called) 2078 * @return NULL on error (@a cont will still be called)
2036 */ 2079 */
2037struct GNUNET_FS_PublishSksContext * 2080struct GNUNET_FS_PublishSksContext *
2038GNUNET_FS_publish_sks(struct GNUNET_FS_Handle *h, 2081GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
2039 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 2082 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
2040 const char *identifier, 2083 const char *identifier,
2041 const char *update, 2084 const char *update,
2042 const struct GNUNET_CONTAINER_MetaData *meta, 2085 const struct GNUNET_CONTAINER_MetaData *meta,
2043 const struct GNUNET_FS_Uri *uri, 2086 const struct GNUNET_FS_Uri *uri,
2044 const struct GNUNET_FS_BlockOptions *bo, 2087 const struct GNUNET_FS_BlockOptions *bo,
2045 enum GNUNET_FS_PublishOptions options, 2088 enum GNUNET_FS_PublishOptions options,
2046 GNUNET_FS_PublishContinuation cont, void *cont_cls); 2089 GNUNET_FS_PublishContinuation cont, void *cont_cls);
2047 2090
2048 2091
2049/** 2092/**
@@ -2052,7 +2095,7 @@ GNUNET_FS_publish_sks(struct GNUNET_FS_Handle *h,
2052 * @param psc context of the operation to abort. 2095 * @param psc context of the operation to abort.
2053 */ 2096 */
2054void 2097void
2055GNUNET_FS_publish_sks_cancel(struct GNUNET_FS_PublishSksContext *psc); 2098GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc);
2056 2099
2057 2100
2058/** 2101/**
@@ -2084,9 +2127,9 @@ struct GNUNET_FS_GetIndexedContext;
2084 * @return NULL on error (@a iterator is not called) 2127 * @return NULL on error (@a iterator is not called)
2085 */ 2128 */
2086struct GNUNET_FS_GetIndexedContext * 2129struct GNUNET_FS_GetIndexedContext *
2087GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h, 2130GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h,
2088 GNUNET_FS_IndexedFileProcessor iterator, 2131 GNUNET_FS_IndexedFileProcessor iterator,
2089 void *iterator_cls); 2132 void *iterator_cls);
2090 2133
2091 2134
2092/** 2135/**
@@ -2095,7 +2138,7 @@ GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h,
2095 * @param gic operation to cancel 2138 * @param gic operation to cancel
2096 */ 2139 */
2097void 2140void
2098GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic); 2141GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic);
2099 2142
2100 2143
2101/** 2144/**
@@ -2107,9 +2150,9 @@ GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic);
2107 * @return NULL on error, otherwise handle 2150 * @return NULL on error, otherwise handle
2108 */ 2151 */
2109struct GNUNET_FS_UnindexContext * 2152struct GNUNET_FS_UnindexContext *
2110GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h, 2153GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h,
2111 const char *filename, 2154 const char *filename,
2112 void *cctx); 2155 void *cctx);
2113 2156
2114 2157
2115/** 2158/**
@@ -2118,7 +2161,7 @@ GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h,
2118 * @param uc handle 2161 * @param uc handle
2119 */ 2162 */
2120void 2163void
2121GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc); 2164GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc);
2122 2165
2123 2166
2124/** 2167/**
@@ -2132,8 +2175,11 @@ GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc);
2132 */ 2175 */
2133typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, 2176typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
2134 const char *last_id, 2177 const char *last_id,
2135 const struct GNUNET_FS_Uri *last_uri, 2178 const struct
2136 const struct GNUNET_CONTAINER_MetaData *last_meta, 2179 GNUNET_FS_Uri *last_uri,
2180 const struct
2181 GNUNET_CONTAINER_MetaData *
2182 last_meta,
2137 const char *next_id); 2183 const char *next_id);
2138 2184
2139 2185
@@ -2159,18 +2205,20 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
2159 * @param ip_cls closure for @a ip 2205 * @param ip_cls closure for @a ip
2160 */ 2206 */
2161void 2207void
2162GNUNET_FS_namespace_list_updateable(struct GNUNET_FS_Handle *h, 2208GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h,
2163 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 2209 const struct
2164 const char *next_id, 2210 GNUNET_CRYPTO_EcdsaPrivateKey *ns,
2165 GNUNET_FS_IdentifierProcessor ip, 2211 const char *next_id,
2166 void *ip_cls); 2212 GNUNET_FS_IdentifierProcessor ip,
2213 void *ip_cls);
2167 2214
2168 2215
2169/** 2216/**
2170 * Options for searching. Compatible options 2217 * Options for searching. Compatible options
2171 * can be OR'ed together. 2218 * can be OR'ed together.
2172 */ 2219 */
2173enum GNUNET_FS_SearchOptions { 2220enum GNUNET_FS_SearchOptions
2221{
2174 /** 2222 /**
2175 * No options (use defaults for everything). 2223 * No options (use defaults for everything).
2176 */ 2224 */
@@ -2195,9 +2243,9 @@ enum GNUNET_FS_SearchOptions {
2195 * @return context that can be used to control the search 2243 * @return context that can be used to control the search
2196 */ 2244 */
2197struct GNUNET_FS_SearchContext * 2245struct GNUNET_FS_SearchContext *
2198GNUNET_FS_search_start(struct GNUNET_FS_Handle *h, 2246GNUNET_FS_search_start (struct GNUNET_FS_Handle *h,
2199 const struct GNUNET_FS_Uri *uri, uint32_t anonymity, 2247 const struct GNUNET_FS_Uri *uri, uint32_t anonymity,
2200 enum GNUNET_FS_SearchOptions options, void *cctx); 2248 enum GNUNET_FS_SearchOptions options, void *cctx);
2201 2249
2202 2250
2203/** 2251/**
@@ -2206,7 +2254,7 @@ GNUNET_FS_search_start(struct GNUNET_FS_Handle *h,
2206 * @param sc context for the search that should be paused 2254 * @param sc context for the search that should be paused
2207 */ 2255 */
2208void 2256void
2209GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc); 2257GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc);
2210 2258
2211 2259
2212/** 2260/**
@@ -2215,7 +2263,7 @@ GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc);
2215 * @param sc context for the search that should be resumed 2263 * @param sc context for the search that should be resumed
2216 */ 2264 */
2217void 2265void
2218GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc); 2266GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc);
2219 2267
2220 2268
2221/** 2269/**
@@ -2224,7 +2272,7 @@ GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc);
2224 * @param sc context for the search that should be stopped 2272 * @param sc context for the search that should be stopped
2225 */ 2273 */
2226void 2274void
2227GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc); 2275GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc);
2228 2276
2229 2277
2230/** 2278/**
@@ -2238,11 +2286,11 @@ GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc);
2238 * @return the search result handle to access the probe activity 2286 * @return the search result handle to access the probe activity
2239 */ 2287 */
2240struct GNUNET_FS_SearchResult * 2288struct GNUNET_FS_SearchResult *
2241GNUNET_FS_probe(struct GNUNET_FS_Handle *h, 2289GNUNET_FS_probe (struct GNUNET_FS_Handle *h,
2242 const struct GNUNET_FS_Uri *uri, 2290 const struct GNUNET_FS_Uri *uri,
2243 const struct GNUNET_CONTAINER_MetaData *meta, 2291 const struct GNUNET_CONTAINER_MetaData *meta,
2244 void *client_info, 2292 void *client_info,
2245 uint32_t anonymity); 2293 uint32_t anonymity);
2246 2294
2247 2295
2248/** 2296/**
@@ -2253,14 +2301,15 @@ GNUNET_FS_probe(struct GNUNET_FS_Handle *h,
2253 * @return the value of the 'client_info' pointer 2301 * @return the value of the 'client_info' pointer
2254 */ 2302 */
2255void * 2303void *
2256GNUNET_FS_probe_stop(struct GNUNET_FS_SearchResult *sr); 2304GNUNET_FS_probe_stop (struct GNUNET_FS_SearchResult *sr);
2257 2305
2258 2306
2259/** 2307/**
2260 * Options for downloading. Compatible options 2308 * Options for downloading. Compatible options
2261 * can be OR'ed together. 2309 * can be OR'ed together.
2262 */ 2310 */
2263enum GNUNET_FS_DownloadOptions { 2311enum GNUNET_FS_DownloadOptions
2312{
2264 /** 2313 /**
2265 * No options (use defaults for everything). 2314 * No options (use defaults for everything).
2266 */ 2315 */
@@ -2326,13 +2375,13 @@ enum GNUNET_FS_DownloadOptions {
2326 * @return context that can be used to control this download 2375 * @return context that can be used to control this download
2327 */ 2376 */
2328struct GNUNET_FS_DownloadContext * 2377struct GNUNET_FS_DownloadContext *
2329GNUNET_FS_download_start(struct GNUNET_FS_Handle *h, 2378GNUNET_FS_download_start (struct GNUNET_FS_Handle *h,
2330 const struct GNUNET_FS_Uri *uri, 2379 const struct GNUNET_FS_Uri *uri,
2331 const struct GNUNET_CONTAINER_MetaData *meta, 2380 const struct GNUNET_CONTAINER_MetaData *meta,
2332 const char *filename, const char *tempname, 2381 const char *filename, const char *tempname,
2333 uint64_t offset, uint64_t length, uint32_t anonymity, 2382 uint64_t offset, uint64_t length, uint32_t anonymity,
2334 enum GNUNET_FS_DownloadOptions options, void *cctx, 2383 enum GNUNET_FS_DownloadOptions options, void *cctx,
2335 struct GNUNET_FS_DownloadContext *parent); 2384 struct GNUNET_FS_DownloadContext *parent);
2336 2385
2337 2386
2338/** 2387/**
@@ -2370,13 +2419,13 @@ GNUNET_FS_download_start(struct GNUNET_FS_Handle *h,
2370 * @return context that can be used to control this download 2419 * @return context that can be used to control this download
2371 */ 2420 */
2372struct GNUNET_FS_DownloadContext * 2421struct GNUNET_FS_DownloadContext *
2373GNUNET_FS_download_start_from_search(struct GNUNET_FS_Handle *h, 2422GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h,
2374 struct GNUNET_FS_SearchResult *sr, 2423 struct GNUNET_FS_SearchResult *sr,
2375 const char *filename, 2424 const char *filename,
2376 const char *tempname, uint64_t offset, 2425 const char *tempname, uint64_t offset,
2377 uint64_t length, uint32_t anonymity, 2426 uint64_t length, uint32_t anonymity,
2378 enum GNUNET_FS_DownloadOptions options, 2427 enum GNUNET_FS_DownloadOptions options,
2379 void *cctx); 2428 void *cctx);
2380 2429
2381 2430
2382/** 2431/**
@@ -2386,7 +2435,7 @@ GNUNET_FS_download_start_from_search(struct GNUNET_FS_Handle *h,
2386 * @param do_delete delete files of incomplete downloads 2435 * @param do_delete delete files of incomplete downloads
2387 */ 2436 */
2388void 2437void
2389GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete); 2438GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete);
2390 2439
2391 2440
2392/** 2441/**
@@ -2395,7 +2444,7 @@ GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete);
2395 * @param dc handle for the download 2444 * @param dc handle for the download
2396 */ 2445 */
2397void 2446void
2398GNUNET_FS_download_suspend(struct GNUNET_FS_DownloadContext *dc); 2447GNUNET_FS_download_suspend (struct GNUNET_FS_DownloadContext *dc);
2399 2448
2400 2449
2401/** 2450/**
@@ -2404,7 +2453,7 @@ GNUNET_FS_download_suspend(struct GNUNET_FS_DownloadContext *dc);
2404 * @param dc handle for the download 2453 * @param dc handle for the download
2405 */ 2454 */
2406void 2455void
2407GNUNET_FS_download_resume(struct GNUNET_FS_DownloadContext *dc); 2456GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc);
2408 2457
2409 2458
2410 2459
@@ -2423,8 +2472,8 @@ GNUNET_FS_download_resume(struct GNUNET_FS_DownloadContext *dc);
2423 * we have no mime-type information (treat as #GNUNET_NO) 2472 * we have no mime-type information (treat as #GNUNET_NO)
2424 */ 2473 */
2425int 2474int
2426GNUNET_FS_meta_data_test_for_directory(const struct GNUNET_CONTAINER_MetaData 2475GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData
2427 *md); 2476 *md);
2428 2477
2429 2478
2430/** 2479/**
@@ -2434,7 +2483,7 @@ GNUNET_FS_meta_data_test_for_directory(const struct GNUNET_CONTAINER_MetaData
2434 * @param md metadata to add mimetype to 2483 * @param md metadata to add mimetype to
2435 */ 2484 */
2436void 2485void
2437GNUNET_FS_meta_data_make_directory(struct GNUNET_CONTAINER_MetaData *md); 2486GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md);
2438 2487
2439 2488
2440/** 2489/**
@@ -2444,7 +2493,8 @@ GNUNET_FS_meta_data_make_directory(struct GNUNET_CONTAINER_MetaData *md);
2444 * @return NULL if meta data is useless for suggesting a filename 2493 * @return NULL if meta data is useless for suggesting a filename
2445 */ 2494 */
2446char * 2495char *
2447GNUNET_FS_meta_data_suggest_filename(const struct GNUNET_CONTAINER_MetaData *md); 2496GNUNET_FS_meta_data_suggest_filename (const struct
2497 GNUNET_CONTAINER_MetaData *md);
2448 2498
2449 2499
2450/** 2500/**
@@ -2492,10 +2542,10 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls,
2492 * #GNUNET_SYSERR if 'data' does not represent a directory 2542 * #GNUNET_SYSERR if 'data' does not represent a directory
2493 */ 2543 */
2494int 2544int
2495GNUNET_FS_directory_list_contents(size_t size, const void *data, 2545GNUNET_FS_directory_list_contents (size_t size, const void *data,
2496 uint64_t offset, 2546 uint64_t offset,
2497 GNUNET_FS_DirectoryEntryProcessor dep, 2547 GNUNET_FS_DirectoryEntryProcessor dep,
2498 void *dep_cls); 2548 void *dep_cls);
2499 2549
2500 2550
2501/** 2551/**
@@ -2510,8 +2560,8 @@ struct GNUNET_FS_DirectoryBuilder;
2510 * @param mdir metadata for the directory 2560 * @param mdir metadata for the directory
2511 */ 2561 */
2512struct GNUNET_FS_DirectoryBuilder * 2562struct GNUNET_FS_DirectoryBuilder *
2513GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData 2563GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData
2514 *mdir); 2564 *mdir);
2515 2565
2516 2566
2517/** 2567/**
@@ -2525,10 +2575,10 @@ GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData
2525 * by the uri 2575 * by the uri
2526 */ 2576 */
2527void 2577void
2528GNUNET_FS_directory_builder_add(struct GNUNET_FS_DirectoryBuilder *bld, 2578GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
2529 const struct GNUNET_FS_Uri *uri, 2579 const struct GNUNET_FS_Uri *uri,
2530 const struct GNUNET_CONTAINER_MetaData *md, 2580 const struct GNUNET_CONTAINER_MetaData *md,
2531 const void *data); 2581 const void *data);
2532 2582
2533 2583
2534/** 2584/**
@@ -2542,8 +2592,8 @@ GNUNET_FS_directory_builder_add(struct GNUNET_FS_DirectoryBuilder *bld,
2542 * @return #GNUNET_OK on success 2592 * @return #GNUNET_OK on success
2543 */ 2593 */
2544int 2594int
2545GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld, 2595GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
2546 size_t * rsize, void **rdata); 2596 size_t *rsize, void **rdata);
2547 2597
2548 2598
2549/* ******************** DirScanner API *********************** */ 2599/* ******************** DirScanner API *********************** */
@@ -2551,7 +2601,8 @@ GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld,
2551/** 2601/**
2552 * Progress reasons of the directory scanner. 2602 * Progress reasons of the directory scanner.
2553 */ 2603 */
2554enum GNUNET_FS_DirScannerProgressUpdateReason { 2604enum GNUNET_FS_DirScannerProgressUpdateReason
2605{
2555 /** 2606 /**
2556 * We've started processing a file or directory. 2607 * We've started processing a file or directory.
2557 */ 2608 */
@@ -2600,13 +2651,16 @@ enum GNUNET_FS_DirScannerProgressUpdateReason {
2600typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls, 2651typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls,
2601 const char *filename, 2652 const char *filename,
2602 int is_directory, 2653 int is_directory,
2603 enum GNUNET_FS_DirScannerProgressUpdateReason reason); 2654 enum
2655 GNUNET_FS_DirScannerProgressUpdateReason
2656 reason);
2604 2657
2605 2658
2606/** 2659/**
2607 * A node of a directory tree (produced by dirscanner) 2660 * A node of a directory tree (produced by dirscanner)
2608 */ 2661 */
2609struct GNUNET_FS_ShareTreeItem { 2662struct GNUNET_FS_ShareTreeItem
2663{
2610 /** 2664 /**
2611 * This is a doubly-linked list 2665 * This is a doubly-linked list
2612 */ 2666 */
@@ -2680,11 +2734,11 @@ struct GNUNET_FS_DirScanner;
2680 * @return directory scanner object to be used for controlling the scanner 2734 * @return directory scanner object to be used for controlling the scanner
2681 */ 2735 */
2682struct GNUNET_FS_DirScanner * 2736struct GNUNET_FS_DirScanner *
2683GNUNET_FS_directory_scan_start(const char *filename, 2737GNUNET_FS_directory_scan_start (const char *filename,
2684 int disable_extractor, 2738 int disable_extractor,
2685 const char *ex, 2739 const char *ex,
2686 GNUNET_FS_DirScannerProgressCallback cb, 2740 GNUNET_FS_DirScannerProgressCallback cb,
2687 void *cb_cls); 2741 void *cb_cls);
2688 2742
2689 2743
2690/** 2744/**
@@ -2694,7 +2748,7 @@ GNUNET_FS_directory_scan_start(const char *filename,
2694 * @param ds directory scanner structure 2748 * @param ds directory scanner structure
2695 */ 2749 */
2696void 2750void
2697GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds); 2751GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds);
2698 2752
2699 2753
2700/** 2754/**
@@ -2706,7 +2760,7 @@ GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds);
2706 * @return the results of the scan (a directory tree) 2760 * @return the results of the scan (a directory tree)
2707 */ 2761 */
2708struct GNUNET_FS_ShareTreeItem * 2762struct GNUNET_FS_ShareTreeItem *
2709GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds); 2763GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds);
2710 2764
2711 2765
2712/** 2766/**
@@ -2716,7 +2770,7 @@ GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds);
2716 * @param toplevel toplevel directory in the tree, returned by the scanner 2770 * @param toplevel toplevel directory in the tree, returned by the scanner
2717 */ 2771 */
2718void 2772void
2719GNUNET_FS_share_tree_trim(struct GNUNET_FS_ShareTreeItem *toplevel); 2773GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel);
2720 2774
2721 2775
2722/** 2776/**
@@ -2725,7 +2779,7 @@ GNUNET_FS_share_tree_trim(struct GNUNET_FS_ShareTreeItem *toplevel);
2725 * @param toplevel toplevel of the tree to be freed 2779 * @param toplevel toplevel of the tree to be freed
2726 */ 2780 */
2727void 2781void
2728GNUNET_FS_share_tree_free(struct GNUNET_FS_ShareTreeItem *toplevel); 2782GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel);
2729 2783
2730 2784
2731#if 0 /* keep Emacsens' auto-indent happy */ 2785#if 0 /* keep Emacsens' auto-indent happy */