[evolution-data-server] Remove CamelSList.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Remove CamelSList.
- Date: Sun, 25 Sep 2011 15:59:11 +0000 (UTC)
commit add4c0618c4ada63024586e63f878dd8be6c504b
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Sep 3 15:22:09 2011 -0400
Remove CamelSList.
Not used by anything, and good heavens we have enough linked-list
implementations already!
camel/camel-list-utils.c | 104 -----------------------
camel/camel-list-utils.h | 44 ----------
docs/reference/camel/camel-sections.txt | 11 ---
docs/reference/camel/tmpl/camel-list-utils.sgml | 96 ---------------------
docs/reference/camel/tmpl/camel-unused.sgml | 87 +++++++++++++++++++
5 files changed, 87 insertions(+), 255 deletions(-)
---
diff --git a/camel/camel-list-utils.c b/camel/camel-list-utils.c
index d3e62df..e44e6b1 100644
--- a/camel/camel-list-utils.c
+++ b/camel/camel-list-utils.c
@@ -184,107 +184,3 @@ camel_dlist_length (CamelDList *l)
return count;
}
-/* This is just for orthogonal completeness */
-
-void
-camel_slist_init (CamelSList *v)
-{
- v->head = NULL;
-}
-
-CamelSListNode *
-camel_slist_addhead (CamelSList *l,
- CamelSListNode *n)
-{
- n->next = l->head;
- l->head = n;
-
- return n;
-}
-
-CamelSListNode *
-camel_slist_addtail (CamelSList *l,
- CamelSListNode *n)
-{
- CamelSListNode *p;
-
- p = (CamelSListNode *) l;
- while (p->next)
- p = p->next;
- n->next = NULL;
- p->next = n;
-
- return n;
-}
-
-CamelSListNode *
-camel_slist_remove (CamelSList *l,
- CamelSListNode *n)
-{
- CamelSListNode *p, *q;
-
- p = (CamelSListNode *) l;
- while ((q = p->next)) {
- if (q == n) {
- p->next = n->next;
- return n;
- }
- p = q;
- }
-
- g_warning("Trying to remove SList node not present in SList");
-
- return NULL;
-}
-
-CamelSListNode *
-camel_slist_remhead (CamelSList *l)
-{
- CamelSListNode *n;
-
- n = l->head;
- if (n)
- l->head = n->next;
-
- return n;
-}
-
-CamelSListNode *
-camel_slist_remtail (CamelSList *l)
-{
- CamelSListNode *n, *p;
-
- n = l->head;
- if (l->head == NULL)
- return NULL;
- p = (CamelSListNode *) l;
- while (n->next) {
- p = n;
- n = n->next;
- }
- p->next = NULL;
-
- return n;
-}
-
-gint
-camel_slist_empty (CamelSList *l)
-{
- return (l->head == NULL);
-}
-
-gint
-camel_slist_length (CamelSList *l)
-{
- CamelSListNode *n;
- gint count = 0;
-
- n = l->head;
- while (n) {
- count++;
- n = n->next;
- }
-
- return count;
-}
-
diff --git a/camel/camel-list-utils.h b/camel/camel-list-utils.h
index 5ecdde7..50ab980 100644
--- a/camel/camel-list-utils.h
+++ b/camel/camel-list-utils.h
@@ -87,50 +87,6 @@ CamelDListNode *camel_dlist_remtail (CamelDList *l);
gint camel_dlist_empty (CamelDList *l);
gint camel_dlist_length (CamelDList *l);
-/* This is provided mostly for orthogonality with the dlist structure.
- * By making the nodes contain all of the data themselves it
- * simplifies memory management. Removing and adding from/to the head
- * of the list is O(1), the rest of the operations are O(n). */
-
-typedef struct _CamelSListNode CamelSListNode;
-typedef struct _CamelSList CamelSList;
-
-/**
- * struct _CamelSListNode - A single-linked list node.
- *
- * @next: The next node in the list.
- *
- * A single-linked list node header. Put this at hte start of the
- * actual list node structure, or more commonly, just a next pointer.
- * Data is stored in the list node by subclassing the node-header
- * rather than using a pointer.
- **/
-struct _CamelSListNode {
- struct _CamelSListNode *next;
-};
-
-/**
- * struct _CamelSList - A single-linked list header.
- *
- * @head: The head of the list.
- *
- * This is the header of a single-linked list.
- **/
-struct _CamelSList {
- struct _CamelSListNode *head;
-};
-
-#define CAMEL_SLIST_INITIALISER(l) { 0 }
-
-void camel_slist_init (CamelSList *l);
-CamelSListNode *camel_slist_addhead (CamelSList *l, CamelSListNode *n);
-CamelSListNode *camel_slist_addtail (CamelSList *l, CamelSListNode *n);
-CamelSListNode *camel_slist_remove (CamelSList *l, CamelSListNode *n);
-CamelSListNode *camel_slist_remhead (CamelSList *l);
-CamelSListNode *camel_slist_remtail (CamelSList *l);
-gint camel_slist_empty (CamelSList *l);
-gint camel_slist_length (CamelSList *l);
-
G_END_DECLS
#endif
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 5de1021..da47c76 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -2758,17 +2758,6 @@ camel_dlist_remhead
camel_dlist_remtail
camel_dlist_empty
camel_dlist_length
-CamelSListNode
-CamelSList
-CAMEL_SLIST_INITIALISER
-camel_slist_init
-camel_slist_addhead
-camel_slist_addtail
-camel_slist_remove
-camel_slist_remhead
-camel_slist_remtail
-camel_slist_empty
-camel_slist_length
</SECTION>
<SECTION>
diff --git a/docs/reference/camel/tmpl/camel-list-utils.sgml b/docs/reference/camel/tmpl/camel-list-utils.sgml
index fd6261b..db46cf7 100644
--- a/docs/reference/camel/tmpl/camel-list-utils.sgml
+++ b/docs/reference/camel/tmpl/camel-list-utils.sgml
@@ -118,99 +118,3 @@ camel-list-utils
@Returns:
-<!-- ##### STRUCT CamelSListNode ##### -->
-<para>
-
-</para>
-
- next:
-
-<!-- ##### STRUCT CamelSList ##### -->
-<para>
-
-</para>
-
- head:
-
-<!-- ##### MACRO CAMEL_SLIST_INITIALISER ##### -->
-<para>
-
-</para>
-
- l:
-
-
-<!-- ##### FUNCTION camel_slist_init ##### -->
-<para>
-
-</para>
-
- l:
-
-
-<!-- ##### FUNCTION camel_slist_addhead ##### -->
-<para>
-
-</para>
-
- l:
- n:
- Returns:
-
-
-<!-- ##### FUNCTION camel_slist_addtail ##### -->
-<para>
-
-</para>
-
- l:
- n:
- Returns:
-
-
-<!-- ##### FUNCTION camel_slist_remove ##### -->
-<para>
-
-</para>
-
- l:
- n:
- Returns:
-
-
-<!-- ##### FUNCTION camel_slist_remhead ##### -->
-<para>
-
-</para>
-
- l:
- Returns:
-
-
-<!-- ##### FUNCTION camel_slist_remtail ##### -->
-<para>
-
-</para>
-
- l:
- Returns:
-
-
-<!-- ##### FUNCTION camel_slist_empty ##### -->
-<para>
-
-</para>
-
- l:
- Returns:
-
-
-<!-- ##### FUNCTION camel_slist_length ##### -->
-<para>
-
-</para>
-
- l:
- Returns:
-
-
diff --git a/docs/reference/camel/tmpl/camel-unused.sgml b/docs/reference/camel/tmpl/camel-unused.sgml
index 73605f4..c3a496e 100644
--- a/docs/reference/camel/tmpl/camel-unused.sgml
+++ b/docs/reference/camel/tmpl/camel-unused.sgml
@@ -2886,6 +2886,13 @@ streams
</para>
+<!-- ##### MACRO CAMEL_SLIST_INITIALISER ##### -->
+<para>
+
+</para>
+
+ l:
+
<!-- ##### MACRO CAMEL_SMTP_TRANSPORT_8BITMIME ##### -->
<para>
@@ -4392,6 +4399,20 @@ streams
@old_base:
@new:
+<!-- ##### STRUCT CamelSList ##### -->
+<para>
+
+</para>
+
+ head:
+
+<!-- ##### STRUCT CamelSListNode ##### -->
+<para>
+
+</para>
+
+ next:
+
<!-- ##### STRUCT CamelSeekableStream ##### -->
<para>
@@ -8835,6 +8856,72 @@ streams
@flags:
@Returns:
+<!-- ##### FUNCTION camel_slist_addhead ##### -->
+<para>
+
+</para>
+
+ l:
+ n:
+ Returns:
+
+<!-- ##### FUNCTION camel_slist_addtail ##### -->
+<para>
+
+</para>
+
+ l:
+ n:
+ Returns:
+
+<!-- ##### FUNCTION camel_slist_empty ##### -->
+<para>
+
+</para>
+
+ l:
+ Returns:
+
+<!-- ##### FUNCTION camel_slist_init ##### -->
+<para>
+
+</para>
+
+ l:
+
+<!-- ##### FUNCTION camel_slist_length ##### -->
+<para>
+
+</para>
+
+ l:
+ Returns:
+
+<!-- ##### FUNCTION camel_slist_remhead ##### -->
+<para>
+
+</para>
+
+ l:
+ Returns:
+
+<!-- ##### FUNCTION camel_slist_remove ##### -->
+<para>
+
+</para>
+
+ l:
+ n:
+ Returns:
+
+<!-- ##### FUNCTION camel_slist_remtail ##### -->
+<para>
+
+</para>
+
+ l:
+ Returns:
+
<!-- ##### FUNCTION camel_spool_folder_new ##### -->
<para>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]