From cc9cf45916888ecbbc82b19f16a3cc8d9813c242 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 18 Feb 2012 15:16:33 +0000 Subject: [PATCH] add GNUNET_FS_namespace_dup API call --- src/fs/fs_namespace.c | 14 ++++++++++++++ src/include/gnunet_fs_service.h | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c index ec4e2495a..9cb8cd5a4 100644 --- a/src/fs/fs_namespace.c +++ b/src/fs/fs_namespace.c @@ -519,6 +519,20 @@ GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name) } +/** + * Duplicate a namespace handle. + * + * @param ns namespace handle + * @return duplicated handle to the namespace + */ +struct GNUNET_FS_Namespace * +GNUNET_FS_namespace_dup (struct GNUNET_FS_Namespace *ns) +{ + ns->rc++; + return ns; +} + + /** * Delete a namespace handle. Can be used for a clean shutdown (free * memory) or also to freeze the namespace to prevent further diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index bfaa98364..0c739709d 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h @@ -2156,6 +2156,16 @@ struct GNUNET_FS_Namespace * GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name); +/** + * Duplicate a namespace handle. + * + * @param ns namespace handle + * @return duplicated handle to the namespace + */ +struct GNUNET_FS_Namespace * +GNUNET_FS_namespace_dup (struct GNUNET_FS_Namespace *ns); + + /** * Delete a namespace handle. Can be used for a clean shutdown (free * memory) or also to freeze the namespace to prevent further -- 2.25.1