diff options
author | LRN <lrn1986@gmail.com> | 2013-02-19 04:04:35 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-02-19 04:04:35 +0000 |
commit | 046e90172489ca6091346685bf444a037b1187ee (patch) | |
tree | b4649fab6e1cc543e26dcdd51d1aa8a79ec3d9d7 /src/include/gnunet_fs_service.h | |
parent | d924f127fd9633ce3e484d54a7efdcdee590dc34 (diff) | |
download | gnunet-046e90172489ca6091346685bf444a037b1187ee.tar.gz gnunet-046e90172489ca6091346685bf444a037b1187ee.zip |
Asynchronous namespace creation. With a test.
Diffstat (limited to 'src/include/gnunet_fs_service.h')
-rw-r--r-- | src/include/gnunet_fs_service.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index a80662867..d6b26d927 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -2240,6 +2240,45 @@ GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name); | |||
2240 | 2240 | ||
2241 | 2241 | ||
2242 | /** | 2242 | /** |
2243 | * Context for creating a namespace asynchronously. | ||
2244 | */ | ||
2245 | struct GNUNET_FS_NamespaceCreationContext; | ||
2246 | |||
2247 | /** | ||
2248 | * Function called upon completion of 'GNUNET_FS_namespace_create_start'. | ||
2249 | * | ||
2250 | * @param cls closure | ||
2251 | * @param ns NULL on error, otherwise the namespace (which must be free'd by the callee) | ||
2252 | * @param emsg NULL on success, otherwise an error message | ||
2253 | */ | ||
2254 | typedef void (*GNUNET_FS_NamespaceCreationCallback)(void *cls, | ||
2255 | struct GNUNET_FS_Namespace *ns, const char *emsg); | ||
2256 | |||
2257 | |||
2258 | /** | ||
2259 | * Create a namespace with the given name; if one already | ||
2260 | * exists, return a handle to the existing namespace immediately. | ||
2261 | * Otherwise create a namespace asynchronously. | ||
2262 | * | ||
2263 | * @param h handle to the file sharing subsystem | ||
2264 | * @param name name to use for the namespace | ||
2265 | * @return namespace creation context, NULL on error (i.e. invalid filename) | ||
2266 | */ | ||
2267 | struct GNUNET_FS_NamespaceCreationContext * | ||
2268 | GNUNET_FS_namespace_create_start (struct GNUNET_FS_Handle *h, const char *name, | ||
2269 | GNUNET_FS_NamespaceCreationCallback cont, void *cont_cls); | ||
2270 | |||
2271 | |||
2272 | /** | ||
2273 | * Abort namespace creation. | ||
2274 | * | ||
2275 | * @param ncc namespace creation context to abort | ||
2276 | */ | ||
2277 | void | ||
2278 | GNUNET_FS_namespace_create_stop (struct GNUNET_FS_NamespaceCreationContext *ncc); | ||
2279 | |||
2280 | |||
2281 | /** | ||
2243 | * Duplicate a namespace handle. | 2282 | * Duplicate a namespace handle. |
2244 | * | 2283 | * |
2245 | * @param ns namespace handle | 2284 | * @param ns namespace handle |