View Issue Details

IDProjectCategoryView StatusLast Update
0001765GNUnetutil librarypublic2011-09-15 14:19
Reportervminko Assigned Tovminko  
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 10: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 19:38

reporter   ~0004567

OK, let's use the DLL API instead.

Issue History

Date Modified Username Field Change
2011-09-06 23:22 vminko New Issue
2011-09-06 23:22 vminko File Added: gnunet-svn@16714-get_slist.patch
2011-09-07 10:12 Christian Grothoff Note Added: 0004563
2011-09-07 19:32 vminko Assigned To => vminko
2011-09-07 19:32 vminko Status new => assigned
2011-09-07 19:38 vminko Note Added: 0004567
2011-09-07 19:38 vminko Status assigned => resolved
2011-09-07 19:38 vminko Resolution open => no change required
2011-09-15 14:19 Christian Grothoff Status resolved => closed