View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001765 | GNUnet | util library | public | 2011-09-06 23:22 | 2011-09-15 14:19 |
| Reporter | vminko | Assigned To | vminko | ||
| Priority | low | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Product Version | Git master | ||||
| Summary | 0001765: GNUNET_CONTAINER_slist_get_slist | ||||
| Description | I'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. | ||||
| Tags | No 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
*/
| ||||
|
|
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... |
|
|
OK, let's use the DLL API instead. |
| 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 |