[ekg2-commit] r4065 - in trunk: ekg plugins/irc: trunk/ekg/dynstuff_inline.h trunk/ekg/plugins.h trunk/ekg/stuff.c trunk/ekg/userlist.c trunk/ekg/userlist.h trunk/ekg/windows.c trunk/plugins/irc/people.c

SVN commit svn w toxygen.net
Wto, 8 Lip 2008, 14:33:03 CEST


Author: darkjames
Date: 2008-07-08 14:33:03 +0200 (Tue, 08 Jul 2008)
New Revision: 4065

Modified:
   trunk/ekg/dynstuff_inline.h
   trunk/ekg/plugins.h
   trunk/ekg/stuff.c
   trunk/ekg/userlist.c
   trunk/ekg/userlist.h
   trunk/ekg/windows.c
   trunk/plugins/irc/people.c
Log:
delete old api:
- userlist_free_u() -> use: userlists_destroy() 
- userlist_resource_free() -> use: ekg_resources_destroy()



Modified: trunk/ekg/dynstuff_inline.h
===================================================================
--- trunk/ekg/dynstuff_inline.h	2008-07-08 12:23:10 UTC (rev 4064)
+++ trunk/ekg/dynstuff_inline.h	2008-07-08 12:33:03 UTC (rev 4065)
@@ -249,7 +249,7 @@
 
 #define __DYNSTUFF_ADD_SORTED(prefix, typ, comparision) 	\
 	void prefix##_add(typ **lista, typ *new) {		\
-		typ *tmp = lista;				\
+		typ *tmp;					\
 								\
 		new->next = NULL;				\
 		if (!(tmp = *lista)) {				\
@@ -265,8 +265,8 @@
 			}					\
 								\
 			if (!prev) {				\
-				new->next = lista;		\
-				lista = new;			\
+				new->next = *lista;		\
+				*lista = new;			\
 			} else {				\
 				prev->next = new;		\
 				new->next = tmp;		\

Modified: trunk/ekg/plugins.h
===================================================================

Modified: trunk/ekg/stuff.c
===================================================================
--- trunk/ekg/stuff.c	2008-07-08 12:23:10 UTC (rev 4064)
+++ trunk/ekg/stuff.c	2008-07-08 12:33:03 UTC (rev 4065)
@@ -760,7 +760,7 @@
 static LIST_FREE_ITEM(newconference_free_item, newconference_t *) {
 	xfree(data->name);
 	xfree(data->session);
-	userlist_free_u(&data->participants);
+	userlists_destroy(&(data->participants));
 }
 
 void newconference_destroy(newconference_t *conf, int kill_wnd) {

Modified: trunk/ekg/userlist.c
===================================================================
--- trunk/ekg/userlist.c	2008-07-08 12:23:10 UTC (rev 4064)
+++ trunk/ekg/userlist.c	2008-07-08 12:33:03 UTC (rev 4065)
@@ -103,7 +103,6 @@
 __DYNSTUFF_REMOVE_SAFE(ekg_resources, ekg_resource_t, list_userlist_resource_free);	/* ekg_resources_remove() */
 __DYNSTUFF_DESTROY(ekg_resources, ekg_resource_t, list_userlist_resource_free);		/* ekg_resources_destroy() */
 
-
 /*
  * userlist_add_entry()
  *
@@ -342,7 +341,7 @@
 			xfree(u->descr);
 			u->descr = NULL;
 
-			userlist_resource_free(u);
+			ekg_resources_destroy(&(u->resources));
 		}
         }
 }
@@ -356,7 +355,7 @@
 	if (!session)
 		return;
 
-	userlist_free_u(&(session->userlist));
+	userlists_destroy(&(session->userlist));
 }
 
 static LIST_FREE_ITEM(userlist_free_item, userlist_t *) {
@@ -374,18 +373,11 @@
 	xfree(u->last_descr);
 
 	ekg_groups_destroy(&(u->groups));
-	userlist_resource_free(u);
+	ekg_resources_destroy(&(u->resources));
 }
 
 __DYNSTUFF_DESTROY(userlists, userlist_t, userlist_free_item);		/* userlists_destroy() */
 
-/* 
- * userlist_free_u()
- *
- * clear and remove from memory given userlist
- */
-void userlist_free_u (userlist_t **userlist) { userlists_destroy(userlist); }		/* XXX, remove */
-
 /**
  * userlist_resource_add()
  *
@@ -452,20 +444,6 @@
 	ekg_resources_remove(&(u->resources), r);
 }
 
-/**
- * userlist_resource_free()
- *
- * Remove all user @a u resources.<br>
- * Free allocated memory.
- *
- * @param u - user
- * @sa userlist_resource_remove - to remove given resource
- */
-void userlist_resource_free(userlist_t *u) {					/* XXX, remove */
-	if (!u) return;
-	ekg_resources_destroy(&(u->resources));
-}
-
 /*
  * userlist_add()
  *

Modified: trunk/ekg/userlist.h
===================================================================
--- trunk/ekg/userlist.h	2008-07-08 12:23:10 UTC (rev 4064)
+++ trunk/ekg/userlist.h	2008-07-08 12:33:03 UTC (rev 4065)
@@ -171,13 +171,12 @@
 userlist_t *userlist_find_u(userlist_t **userlist, const char *uid);
 #define userlist_find_n(a, b) userlist_find(session_find(a), b)
 void userlist_free(session_t *session);
-void userlist_free_u(userlist_t **userlist);
+void userlists_destroy(userlist_t **userlist);
 
 /* u->resource */
 ekg_resource_t *userlist_resource_add(userlist_t *u, const char *name, int prio);
 ekg_resource_t *userlist_resource_find(userlist_t *u, const char *name);
 void userlist_resource_remove(userlist_t *u, ekg_resource_t *r);
-void userlist_resource_free(userlist_t *u);
 
 int ignored_add(session_t *session, const char *uid, ignore_t level);
 int ignored_remove(session_t *session, const char *uid);

Modified: trunk/ekg/windows.c
===================================================================
--- trunk/ekg/windows.c	2008-07-08 12:23:10 UTC (rev 4064)
+++ trunk/ekg/windows.c	2008-07-08 12:33:03 UTC (rev 4065)
@@ -49,7 +49,7 @@
 window_t *windows = NULL;		/* lista okien */
 
 static LIST_ADD_COMPARE(window_new_compare, window_t *) { return data1->id - data2->id; }
-static LIST_FREE_ITEM(list_window_free, window_t *) { xfree(data->target);  userlist_free_u(&(data->userlist)); }
+static LIST_FREE_ITEM(list_window_free, window_t *) { xfree(data->target);  userlists_destroy(&(data->userlist)); }
 
 __DYNSTUFF_LIST_ADD_SORTED(windows, window_t, window_new_compare);				/* windows_add() */
 __DYNSTUFF_LIST_UNLINK(windows, window_t);							/* windows_unlink() */

Modified: trunk/plugins/irc/people.c
===================================================================
--- trunk/plugins/irc/people.c	2008-07-08 12:23:10 UTC (rev 4064)
+++ trunk/plugins/irc/people.c	2008-07-08 12:33:03 UTC (rev 4065)
@@ -592,7 +592,7 @@
 		/* GiM: check if window isn't allready destroyed */
 		w = window_find_s(s, chan->name);
 		if (w && w->userlist)
-			userlist_free_u(&(w->userlist));
+			userlists_destroy(&(w->userlist));
 		/* 
 		 * window_kill(chan->window, 1);
 		 */



Więcej informacji o liście dyskusyjnej ekg2-commit