View Issue Details

IDProjectCategoryView StatusLast Update
0001765GNUnetutil librarypublic2011-09-15 12:19
Reportervminko Assigned Tovminko Due Date
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product VersionGit master 
Summary0001765: GNUNET_CONTAINER_slist_get_slist
DescriptionI've faced with the need to get a list out of its iterator. One obvious
solution is to couple a pointer to the list with the iterator, but since
this particular implementation already contains the pointer, why not let users
access it?

See the patch for details.
TagsNo tags attached.
Attached Files
gnunet-svn@16714-get_slist.patch (1,145 bytes)   
Index: src/include/gnunet_container_lib.h
===================================================================
--- src/include/gnunet_container_lib.h	(revision 16714)
+++ src/include/gnunet_container_lib.h	(working copy)
@@ -1201,6 +1201,15 @@
 
 
 /**
+ * Retrieve the linked list that an iterator is iterating over
+ * @param i iterator
+ * @return the list
+ */
+struct GNUNET_CONTAINER_SList *
+GNUNET_CONTAINER_slist_get_slist (const struct GNUNET_CONTAINER_SList_Iterator *i);
+
+
+/**
  * Release an iterator
  * @param i iterator
  */
Index: src/util/container_slist.c
===================================================================
--- src/util/container_slist.c	(revision 16714)
+++ src/util/container_slist.c	(working copy)
@@ -394,7 +394,21 @@
   return i->elem->elem;
 }
 
+
 /**
+ * Retrieve the linked list that an iterator is iterating over
+ * @param i iterator
+ * @return the list
+ */
+struct GNUNET_CONTAINER_SList *
+GNUNET_CONTAINER_slist_get_slist (const struct GNUNET_CONTAINER_SList_Iterator
+                                  *i)
+{
+  return i->list;
+}
+
+
+/**
  * Release an iterator
  * @param i iterator
  */

Activities

Christian Grothoff

2011-09-07 08:12

manager   ~0004563

Did I mention that I hate the 'slist' API in every respect? I'd really just like to get rid of it and replace it with CONTAINER_DLL everywhere...

vminko

2011-09-07 17:38

reporter   ~0004567

OK, let's use the DLL API instead.

Issue History

Date ModifiedUsernameFieldChange
2011-09-06 21:22vminkoNew Issue
2011-09-06 21:22vminkoFile Added: gnunet-svn@16714-get_slist.patch
2011-09-07 08:12Christian GrothoffNote Added: 0004563
2011-09-07 17:32vminkoAssigned To => vminko
2011-09-07 17:32vminkoStatusnew => assigned
2011-09-07 17:38vminkoNote Added: 0004567
2011-09-07 17:38vminkoStatusassigned => resolved
2011-09-07 17:38vminkoResolutionopen => no change required
2011-09-15 12:19Christian GrothoffStatusresolved => closed