diff options
Diffstat (limited to 'src/include/gnunet_fs_service.h')
-rw-r--r-- | src/include/gnunet_fs_service.h | 256 |
1 files changed, 114 insertions, 142 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index b6eb83609..2962a9cf2 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -79,8 +79,7 @@ struct GNUNET_FS_Uri; | |||
79 | * @param is_mandatory is the keyword mandatory (in a search) | 79 | * @param is_mandatory is the keyword mandatory (in a search) |
80 | * @return GNUNET_OK to continue to iterate, GNUNET_SYSERR to abort | 80 | * @return GNUNET_OK to continue to iterate, GNUNET_SYSERR to abort |
81 | */ | 81 | */ |
82 | typedef int (*GNUNET_FS_KeywordIterator) (void *cls, | 82 | typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, |
83 | const char *keyword, | ||
84 | int is_mandatory); | 83 | int is_mandatory); |
85 | 84 | ||
86 | /** | 85 | /** |
@@ -90,8 +89,8 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, | |||
90 | * @param uri uri to convert to a unique key | 89 | * @param uri uri to convert to a unique key |
91 | * @param key wherer to store the unique key | 90 | * @param key wherer to store the unique key |
92 | */ | 91 | */ |
93 | void | 92 | void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, |
94 | GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, GNUNET_HashCode * key); | 93 | GNUNET_HashCode * key); |
95 | 94 | ||
96 | /** | 95 | /** |
97 | * Convert a URI to a UTF-8 String. | 96 | * Convert a URI to a UTF-8 String. |
@@ -119,9 +118,8 @@ char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | |||
119 | * @param keyword keyword to add | 118 | * @param keyword keyword to add |
120 | * @param is_mandatory is this keyword mandatory? | 119 | * @param is_mandatory is this keyword mandatory? |
121 | */ | 120 | */ |
122 | void | 121 | void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, |
123 | GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | 122 | const char *keyword, int is_mandatory); |
124 | const char *keyword, int is_mandatory); | ||
125 | 123 | ||
126 | 124 | ||
127 | /** | 125 | /** |
@@ -131,9 +129,8 @@ GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | |||
131 | * @param uri ksk uri to modify | 129 | * @param uri ksk uri to modify |
132 | * @param keyword keyword to add | 130 | * @param keyword keyword to add |
133 | */ | 131 | */ |
134 | void | 132 | void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, |
135 | GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | 133 | const char *keyword); |
136 | const char *keyword); | ||
137 | 134 | ||
138 | 135 | ||
139 | /** | 136 | /** |
@@ -159,8 +156,8 @@ void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | |||
159 | * @param uri ksk uri to get the number of keywords from | 156 | * @param uri ksk uri to get the number of keywords from |
160 | * @return 0 if this is not a keyword URI | 157 | * @return 0 if this is not a keyword URI |
161 | */ | 158 | */ |
162 | unsigned int | 159 | unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri |
163 | GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); | 160 | *uri); |
164 | 161 | ||
165 | 162 | ||
166 | /** | 163 | /** |
@@ -172,10 +169,9 @@ GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); | |||
172 | * @return -1 if this is not a keyword URI, otherwise number of | 169 | * @return -1 if this is not a keyword URI, otherwise number of |
173 | * keywords iterated over until iterator aborted | 170 | * keywords iterated over until iterator aborted |
174 | */ | 171 | */ |
175 | int | 172 | int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, |
176 | GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | 173 | GNUNET_FS_KeywordIterator iterator, |
177 | GNUNET_FS_KeywordIterator iterator, | 174 | void *iterator_cls); |
178 | void *iterator_cls); | ||
179 | 175 | ||
180 | 176 | ||
181 | /** | 177 | /** |
@@ -185,9 +181,8 @@ GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | |||
185 | * @param peer where to store the identify of the peer (presumably) offering the content | 181 | * @param peer where to store the identify of the peer (presumably) offering the content |
186 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK | 182 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK |
187 | */ | 183 | */ |
188 | int | 184 | int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, |
189 | GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | 185 | struct GNUNET_PeerIdentity *peer); |
190 | struct GNUNET_PeerIdentity *peer); | ||
191 | 186 | ||
192 | 187 | ||
193 | /** | 188 | /** |
@@ -206,8 +201,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri | |||
206 | * @param uri location URI to get the expiration from | 201 | * @param uri location URI to get the expiration from |
207 | * @return expiration time of the URI | 202 | * @return expiration time of the URI |
208 | */ | 203 | */ |
209 | struct GNUNET_TIME_Absolute | 204 | struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct |
210 | GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); | 205 | GNUNET_FS_Uri |
206 | *uri); | ||
211 | 207 | ||
212 | 208 | ||
213 | /** | 209 | /** |
@@ -310,9 +306,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, | |||
310 | * @param u2 the other URI | 306 | * @param u2 the other URI |
311 | * @return GNUNET_YES if the URIs are equal | 307 | * @return GNUNET_YES if the URIs are equal |
312 | */ | 308 | */ |
313 | int | 309 | int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, |
314 | GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | 310 | const struct GNUNET_FS_Uri *u2); |
315 | const struct GNUNET_FS_Uri *u2); | ||
316 | 311 | ||
317 | 312 | ||
318 | /** | 313 | /** |
@@ -361,9 +356,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * | |||
361 | * @param nsid where to store the ID of the namespace | 356 | * @param nsid where to store the ID of the namespace |
362 | * @return GNUNET_OK on success | 357 | * @return GNUNET_OK on success |
363 | */ | 358 | */ |
364 | int | 359 | int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
365 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 360 | GNUNET_HashCode * nsid); |
366 | GNUNET_HashCode * nsid); | ||
367 | 361 | ||
368 | 362 | ||
369 | /** | 363 | /** |
@@ -451,10 +445,10 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct | |||
451 | * @param value command line argument given | 445 | * @param value command line argument given |
452 | * @return GNUNET_OK on success | 446 | * @return GNUNET_OK on success |
453 | */ | 447 | */ |
454 | int | 448 | int GNUNET_FS_getopt_set_keywords (struct |
455 | GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext | 449 | GNUNET_GETOPT_CommandLineProcessorContext |
456 | *ctx, void *scls, const char *option, | 450 | *ctx, void *scls, const char *option, |
457 | const char *value); | 451 | const char *value); |
458 | 452 | ||
459 | 453 | ||
460 | /** | 454 | /** |
@@ -469,10 +463,10 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
469 | * @param value command line argument given | 463 | * @param value command line argument given |
470 | * @return GNUNET_OK on success | 464 | * @return GNUNET_OK on success |
471 | */ | 465 | */ |
472 | int | 466 | int GNUNET_FS_getopt_set_metadata (struct |
473 | GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext | 467 | GNUNET_GETOPT_CommandLineProcessorContext |
474 | *ctx, void *scls, const char *option, | 468 | *ctx, void *scls, const char *option, |
475 | const char *value); | 469 | const char *value); |
476 | 470 | ||
477 | 471 | ||
478 | 472 | ||
@@ -1522,8 +1516,9 @@ struct GNUNET_FS_ProgressInfo | |||
1522 | * will be passed to future callbacks in the respective | 1516 | * will be passed to future callbacks in the respective |
1523 | * field in the GNUNET_FS_ProgressInfo struct. | 1517 | * field in the GNUNET_FS_ProgressInfo struct. |
1524 | */ | 1518 | */ |
1525 | typedef void *(*GNUNET_FS_ProgressCallback) | 1519 | typedef void *(*GNUNET_FS_ProgressCallback) (void *cls, |
1526 | (void *cls, const struct GNUNET_FS_ProgressInfo * info); | 1520 | const struct GNUNET_FS_ProgressInfo |
1521 | * info); | ||
1527 | 1522 | ||
1528 | 1523 | ||
1529 | /** | 1524 | /** |
@@ -1682,11 +1677,10 @@ void GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | |||
1682 | * @return GNUNET_SYSERR on error, otherwise the number | 1677 | * @return GNUNET_SYSERR on error, otherwise the number |
1683 | * of meta-data items obtained | 1678 | * of meta-data items obtained |
1684 | */ | 1679 | */ |
1685 | int | 1680 | int GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, |
1686 | GNUNET_FS_meta_data_extract_from_file (struct | 1681 | const char *filename, |
1687 | GNUNET_CONTAINER_MetaData | 1682 | struct EXTRACTOR_PluginList |
1688 | *md, const char *filename, | 1683 | *extractors); |
1689 | struct EXTRACTOR_PluginList *extractors); | ||
1690 | 1684 | ||
1691 | 1685 | ||
1692 | /** | 1686 | /** |
@@ -1804,9 +1798,8 @@ struct GNUNET_FS_FileInformation | |||
1804 | * @param emsg location for the reader to store an error message | 1798 | * @param emsg location for the reader to store an error message |
1805 | * @return number of bytes written, usually "max", 0 on error | 1799 | * @return number of bytes written, usually "max", 0 on error |
1806 | */ | 1800 | */ |
1807 | typedef size_t (*GNUNET_FS_DataReader) (void *cls, | 1801 | typedef size_t (*GNUNET_FS_DataReader) (void *cls, uint64_t offset, size_t max, |
1808 | uint64_t offset, | 1802 | void *buf, char **emsg); |
1809 | size_t max, void *buf, char **emsg); | ||
1810 | 1803 | ||
1811 | 1804 | ||
1812 | /** | 1805 | /** |
@@ -1850,8 +1843,7 @@ struct GNUNET_FS_FileInformation | |||
1850 | * @param fi information about the file (should not be | 1843 | * @param fi information about the file (should not be |
1851 | * used henceforth by the caller) | 1844 | * used henceforth by the caller) |
1852 | */ | 1845 | */ |
1853 | typedef void (*GNUNET_FS_FileProcessor) (void *cls, | 1846 | typedef void (*GNUNET_FS_FileProcessor) (void *cls, const char *filename, |
1854 | const char *filename, | ||
1855 | struct GNUNET_FS_FileInformation * fi); | 1847 | struct GNUNET_FS_FileInformation * fi); |
1856 | 1848 | ||
1857 | 1849 | ||
@@ -1870,8 +1862,7 @@ typedef void (*GNUNET_FS_FileProcessor) (void *cls, | |||
1870 | */ | 1862 | */ |
1871 | typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, | 1863 | typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, |
1872 | struct GNUNET_FS_Handle * h, | 1864 | struct GNUNET_FS_Handle * h, |
1873 | const char *dirname, | 1865 | const char *dirname, int do_index, |
1874 | int do_index, | ||
1875 | const struct GNUNET_FS_BlockOptions * | 1866 | const struct GNUNET_FS_BlockOptions * |
1876 | bo, GNUNET_FS_FileProcessor proc, | 1867 | bo, GNUNET_FS_FileProcessor proc, |
1877 | void *proc_cls, char **emsg); | 1868 | void *proc_cls, char **emsg); |
@@ -1899,14 +1890,11 @@ typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, | |||
1899 | * @param emsg where to store an error message (on errors) | 1890 | * @param emsg where to store an error message (on errors) |
1900 | * @return GNUNET_OK on success | 1891 | * @return GNUNET_OK on success |
1901 | */ | 1892 | */ |
1902 | int | 1893 | int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, |
1903 | GNUNET_FS_directory_scanner_default (void *cls, | 1894 | const char *dirname, int do_index, |
1904 | struct GNUNET_FS_Handle *h, | 1895 | const struct GNUNET_FS_BlockOptions |
1905 | const char *dirname, | 1896 | *bo, GNUNET_FS_FileProcessor proc, |
1906 | int do_index, | 1897 | void *proc_cls, char **emsg); |
1907 | const struct GNUNET_FS_BlockOptions *bo, | ||
1908 | GNUNET_FS_FileProcessor proc, | ||
1909 | void *proc_cls, char **emsg); | ||
1910 | 1898 | ||
1911 | 1899 | ||
1912 | /** | 1900 | /** |
@@ -1975,9 +1963,8 @@ struct GNUNET_FS_FileInformation | |||
1975 | * @param ent check if this FI represents a directory | 1963 | * @param ent check if this FI represents a directory |
1976 | * @return GNUNET_YES if so, GNUNET_NO if not | 1964 | * @return GNUNET_YES if so, GNUNET_NO if not |
1977 | */ | 1965 | */ |
1978 | int | 1966 | int GNUNET_FS_file_information_is_directory (const struct |
1979 | GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation | 1967 | GNUNET_FS_FileInformation *ent); |
1980 | *ent); | ||
1981 | 1968 | ||
1982 | 1969 | ||
1983 | /** | 1970 | /** |
@@ -1991,9 +1978,8 @@ GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation | |||
1991 | * must not include "dir" in its structure | 1978 | * must not include "dir" in its structure |
1992 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 1979 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
1993 | */ | 1980 | */ |
1994 | int | 1981 | int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, |
1995 | GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | 1982 | struct GNUNET_FS_FileInformation *ent); |
1996 | struct GNUNET_FS_FileInformation *ent); | ||
1997 | 1983 | ||
1998 | 1984 | ||
1999 | /** | 1985 | /** |
@@ -2010,10 +1996,9 @@ GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | |||
2010 | * @param proc function to call on each entry | 1996 | * @param proc function to call on each entry |
2011 | * @param proc_cls closure for proc | 1997 | * @param proc_cls closure for proc |
2012 | */ | 1998 | */ |
2013 | void | 1999 | void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, |
2014 | GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | 2000 | GNUNET_FS_FileInformationProcessor |
2015 | GNUNET_FS_FileInformationProcessor proc, | 2001 | proc, void *proc_cls); |
2016 | void *proc_cls); | ||
2017 | 2002 | ||
2018 | 2003 | ||
2019 | /** | 2004 | /** |
@@ -2026,10 +2011,9 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
2026 | * values are ignored | 2011 | * values are ignored |
2027 | * @param cleaner_cls closure for cleaner | 2012 | * @param cleaner_cls closure for cleaner |
2028 | */ | 2013 | */ |
2029 | void | 2014 | void GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, |
2030 | GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, | 2015 | GNUNET_FS_FileInformationProcessor |
2031 | GNUNET_FS_FileInformationProcessor cleaner, | 2016 | cleaner, void *cleaner_cls); |
2032 | void *cleaner_cls); | ||
2033 | 2017 | ||
2034 | 2018 | ||
2035 | /** | 2019 | /** |
@@ -2114,14 +2098,13 @@ typedef void (*GNUNET_FS_PublishContinuation) (void *cls, | |||
2114 | * @param cont continuation | 2098 | * @param cont continuation |
2115 | * @param cont_cls closure for cont | 2099 | * @param cont_cls closure for cont |
2116 | */ | 2100 | */ |
2117 | void | 2101 | void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, |
2118 | GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | 2102 | const struct GNUNET_FS_Uri *ksk_uri, |
2119 | const struct GNUNET_FS_Uri *ksk_uri, | 2103 | const struct GNUNET_CONTAINER_MetaData *meta, |
2120 | const struct GNUNET_CONTAINER_MetaData *meta, | 2104 | const struct GNUNET_FS_Uri *uri, |
2121 | const struct GNUNET_FS_Uri *uri, | 2105 | const struct GNUNET_FS_BlockOptions *bo, |
2122 | const struct GNUNET_FS_BlockOptions *bo, | 2106 | enum GNUNET_FS_PublishOptions options, |
2123 | enum GNUNET_FS_PublishOptions options, | 2107 | GNUNET_FS_PublishContinuation cont, void *cont_cls); |
2124 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | ||
2125 | 2108 | ||
2126 | 2109 | ||
2127 | /** | 2110 | /** |
@@ -2138,16 +2121,14 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | |||
2138 | * @param cont continuation | 2121 | * @param cont continuation |
2139 | * @param cont_cls closure for cont | 2122 | * @param cont_cls closure for cont |
2140 | */ | 2123 | */ |
2141 | void | 2124 | void GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, |
2142 | GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | 2125 | struct GNUNET_FS_Namespace *namespace, |
2143 | struct GNUNET_FS_Namespace *namespace, | 2126 | const char *identifier, const char *update, |
2144 | const char *identifier, | 2127 | const struct GNUNET_CONTAINER_MetaData *meta, |
2145 | const char *update, | 2128 | const struct GNUNET_FS_Uri *uri, |
2146 | const struct GNUNET_CONTAINER_MetaData *meta, | 2129 | const struct GNUNET_FS_BlockOptions *bo, |
2147 | const struct GNUNET_FS_Uri *uri, | 2130 | enum GNUNET_FS_PublishOptions options, |
2148 | const struct GNUNET_FS_BlockOptions *bo, | 2131 | GNUNET_FS_PublishContinuation cont, void *cont_cls); |
2149 | enum GNUNET_FS_PublishOptions options, | ||
2150 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | ||
2151 | 2132 | ||
2152 | 2133 | ||
2153 | /** | 2134 | /** |
@@ -2158,8 +2139,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
2158 | * @param file_id hash of the contents of the indexed file | 2139 | * @param file_id hash of the contents of the indexed file |
2159 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort | 2140 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort |
2160 | */ | 2141 | */ |
2161 | typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, | 2142 | typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, const char *filename, |
2162 | const char *filename, | ||
2163 | const GNUNET_HashCode * file_id); | 2143 | const GNUNET_HashCode * file_id); |
2164 | 2144 | ||
2165 | 2145 | ||
@@ -2174,11 +2154,10 @@ typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, | |||
2174 | * error) or "PREREQ_DONE" (on success) | 2154 | * error) or "PREREQ_DONE" (on success) |
2175 | * @param cont_cls closure for cont | 2155 | * @param cont_cls closure for cont |
2176 | */ | 2156 | */ |
2177 | void | 2157 | void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, |
2178 | GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | 2158 | GNUNET_FS_IndexedFileProcessor iterator, |
2179 | GNUNET_FS_IndexedFileProcessor iterator, | 2159 | void *iterator_cls, |
2180 | void *iterator_cls, | 2160 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
2181 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
2182 | 2161 | ||
2183 | 2162 | ||
2184 | /** | 2163 | /** |
@@ -2215,15 +2194,15 @@ void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | |||
2215 | * @param cont continuation | 2194 | * @param cont continuation |
2216 | * @param cont_cls closure for cont | 2195 | * @param cont_cls closure for cont |
2217 | */ | 2196 | */ |
2218 | void | 2197 | void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, |
2219 | GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, | 2198 | struct GNUNET_FS_Uri *ksk_uri, |
2220 | struct GNUNET_FS_Uri *ksk_uri, | 2199 | struct GNUNET_FS_Namespace *namespace, |
2221 | struct GNUNET_FS_Namespace *namespace, | 2200 | const struct GNUNET_CONTAINER_MetaData |
2222 | const struct GNUNET_CONTAINER_MetaData *meta, | 2201 | *meta, |
2223 | const struct GNUNET_FS_BlockOptions *bo, | 2202 | const struct GNUNET_FS_BlockOptions *bo, |
2224 | const char *rootEntry, | 2203 | const char *rootEntry, |
2225 | GNUNET_FS_PublishContinuation cont, | 2204 | GNUNET_FS_PublishContinuation cont, |
2226 | void *cont_cls); | 2205 | void *cont_cls); |
2227 | 2206 | ||
2228 | 2207 | ||
2229 | /** | 2208 | /** |
@@ -2249,8 +2228,8 @@ struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle | |||
2249 | * | 2228 | * |
2250 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 2229 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
2251 | */ | 2230 | */ |
2252 | int | 2231 | int GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, |
2253 | GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze); | 2232 | int freeze); |
2254 | 2233 | ||
2255 | 2234 | ||
2256 | /** | 2235 | /** |
@@ -2262,8 +2241,7 @@ GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze); | |||
2262 | * @param name human-readable identifier of the namespace | 2241 | * @param name human-readable identifier of the namespace |
2263 | * @param id hash identifier for the namespace | 2242 | * @param id hash identifier for the namespace |
2264 | */ | 2243 | */ |
2265 | typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, | 2244 | typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, |
2266 | const char *name, | ||
2267 | const GNUNET_HashCode * id); | 2245 | const GNUNET_HashCode * id); |
2268 | 2246 | ||
2269 | 2247 | ||
@@ -2276,9 +2254,9 @@ typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, | |||
2276 | * @param cb function to call on each known namespace | 2254 | * @param cb function to call on each known namespace |
2277 | * @param cb_cls closure for cb | 2255 | * @param cb_cls closure for cb |
2278 | */ | 2256 | */ |
2279 | void | 2257 | void GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, |
2280 | GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, | 2258 | GNUNET_FS_NamespaceInfoProcessor cb, |
2281 | GNUNET_FS_NamespaceInfoProcessor cb, void *cb_cls); | 2259 | void *cb_cls); |
2282 | 2260 | ||
2283 | 2261 | ||
2284 | /** | 2262 | /** |
@@ -2290,12 +2268,12 @@ GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, | |||
2290 | * @param last_meta metadata associated with last_uri | 2268 | * @param last_meta metadata associated with last_uri |
2291 | * @param next_id identifier that should be used for updates | 2269 | * @param next_id identifier that should be used for updates |
2292 | */ | 2270 | */ |
2293 | typedef void | 2271 | typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, const char *last_id, |
2294 | (*GNUNET_FS_IdentifierProcessor) (void *cls, | 2272 | const struct GNUNET_FS_Uri * |
2295 | const char *last_id, | 2273 | last_uri, |
2296 | const struct GNUNET_FS_Uri * last_uri, | 2274 | const struct |
2297 | const struct GNUNET_CONTAINER_MetaData * | 2275 | GNUNET_CONTAINER_MetaData * |
2298 | last_meta, const char *next_id); | 2276 | last_meta, const char *next_id); |
2299 | 2277 | ||
2300 | 2278 | ||
2301 | /** | 2279 | /** |
@@ -2318,11 +2296,10 @@ typedef void | |||
2318 | * @param ip function to call on each updateable identifier | 2296 | * @param ip function to call on each updateable identifier |
2319 | * @param ip_cls closure for ip | 2297 | * @param ip_cls closure for ip |
2320 | */ | 2298 | */ |
2321 | void | 2299 | void GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, |
2322 | GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, | 2300 | const char *next_id, |
2323 | const char *next_id, | 2301 | GNUNET_FS_IdentifierProcessor ip, |
2324 | GNUNET_FS_IdentifierProcessor ip, | 2302 | void *ip_cls); |
2325 | void *ip_cls); | ||
2326 | 2303 | ||
2327 | 2304 | ||
2328 | /** | 2305 | /** |
@@ -2547,8 +2524,8 @@ struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct | |||
2547 | * @param dc handle for the download | 2524 | * @param dc handle for the download |
2548 | * @param do_delete delete files of incomplete downloads | 2525 | * @param do_delete delete files of incomplete downloads |
2549 | */ | 2526 | */ |
2550 | void | 2527 | void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, |
2551 | GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); | 2528 | int do_delete); |
2552 | 2529 | ||
2553 | 2530 | ||
2554 | 2531 | ||
@@ -2566,9 +2543,8 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); | |||
2566 | * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if | 2543 | * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if |
2567 | * we have no mime-type information (treat as 'GNUNET_NO') | 2544 | * we have no mime-type information (treat as 'GNUNET_NO') |
2568 | */ | 2545 | */ |
2569 | int | 2546 | int GNUNET_FS_meta_data_test_for_directory (const struct |
2570 | GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData | 2547 | GNUNET_CONTAINER_MetaData *md); |
2571 | *md); | ||
2572 | 2548 | ||
2573 | 2549 | ||
2574 | /** | 2550 | /** |
@@ -2634,12 +2610,10 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls, | |||
2634 | * GNUNET_NO if this could be part of a directory (but not 100% OK) | 2610 | * GNUNET_NO if this could be part of a directory (but not 100% OK) |
2635 | * GNUNET_SYSERR if 'data' does not represent a directory | 2611 | * GNUNET_SYSERR if 'data' does not represent a directory |
2636 | */ | 2612 | */ |
2637 | int | 2613 | int GNUNET_FS_directory_list_contents (size_t size, const void *data, |
2638 | GNUNET_FS_directory_list_contents (size_t size, | 2614 | uint64_t offset, |
2639 | const void *data, | 2615 | GNUNET_FS_DirectoryEntryProcessor dep, |
2640 | uint64_t offset, | 2616 | void *dep_cls); |
2641 | GNUNET_FS_DirectoryEntryProcessor dep, | ||
2642 | void *dep_cls); | ||
2643 | 2617 | ||
2644 | 2618 | ||
2645 | /** | 2619 | /** |
@@ -2668,11 +2642,10 @@ struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const | |||
2668 | * data must point to exactly the number of bytes specified | 2642 | * data must point to exactly the number of bytes specified |
2669 | * by the uri | 2643 | * by the uri |
2670 | */ | 2644 | */ |
2671 | void | 2645 | void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, |
2672 | GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | 2646 | const struct GNUNET_FS_Uri *uri, |
2673 | const struct GNUNET_FS_Uri *uri, | 2647 | const struct GNUNET_CONTAINER_MetaData |
2674 | const struct GNUNET_CONTAINER_MetaData *md, | 2648 | *md, const void *data); |
2675 | const void *data); | ||
2676 | 2649 | ||
2677 | 2650 | ||
2678 | /** | 2651 | /** |
@@ -2685,9 +2658,8 @@ GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | |||
2685 | * @param rdata set to the encoded directory | 2658 | * @param rdata set to the encoded directory |
2686 | * @return GNUNET_OK on success | 2659 | * @return GNUNET_OK on success |
2687 | */ | 2660 | */ |
2688 | int | 2661 | int GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, |
2689 | GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, | 2662 | size_t * rsize, void **rdata); |
2690 | size_t * rsize, void **rdata); | ||
2691 | 2663 | ||
2692 | 2664 | ||
2693 | #if 0 /* keep Emacsens' auto-indent happy */ | 2665 | #if 0 /* keep Emacsens' auto-indent happy */ |