changeset 11074:ba630d7a7365

[gaim-migrate @ 13083] sf patch #1233671, from Ryan McCabe eliminate the usage of ->priv in libfaim committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 09 Jul 2005 19:26:49 +0000
parents 634fec5ed0f2
children 812b285aeccd
files src/protocols/oscar/chat.c src/protocols/oscar/conn.c
diffstat 2 files changed, 8 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/chat.c	Sat Jul 09 19:19:53 2005 +0000
+++ b/src/protocols/oscar/chat.c	Sat Jul 09 19:26:49 2005 +0000
@@ -8,7 +8,7 @@
 
 #include <string.h>
 
-/* Stored in the ->priv of chat connections */
+/* Stored in the ->internal of chat connections */
 struct chatconnpriv {
 	fu16_t exchange;
 	char *name;
@@ -17,7 +17,7 @@
 
 faim_internal void aim_conn_kill_chat(aim_session_t *sess, aim_conn_t *conn)
 {
-	struct chatconnpriv *ccp = (struct chatconnpriv *)conn->priv;
+	struct chatconnpriv *ccp = (struct chatconnpriv *)conn->internal;
 
 	if (ccp)
 		free(ccp->name);
@@ -36,7 +36,7 @@
 	if (conn->type != AIM_CONN_TYPE_CHAT)
 		return NULL;
 
-	ccp = (struct chatconnpriv *)conn->priv;
+	ccp = (struct chatconnpriv *)conn->internal;
 
 	return ccp->name;
 }
@@ -47,11 +47,11 @@
 	aim_conn_t *cur;
 
 	for (cur = sess->connlist; cur; cur = cur->next) {
-		struct chatconnpriv *ccp = (struct chatconnpriv *)cur->priv;
+		struct chatconnpriv *ccp = (struct chatconnpriv *)cur->internal;
 
 		if (cur->type != AIM_CONN_TYPE_CHAT)
 			continue;
-		if (!cur->priv) {
+		if (!cur->internal) {
 			faimdprintf(sess, 0, "faim: chat: chat connection with no name! (fd = %d)\n", cur->fd);
 			continue;
 		}
@@ -70,8 +70,8 @@
 	if (!conn || !roomname)
 		return -EINVAL;
 
-	if (conn->priv)
-		free(conn->priv);
+	if (conn->internal)
+		free(conn->internal);
 
 	if (!(ccp = malloc(sizeof(struct chatconnpriv))))
 		return -ENOMEM;
@@ -80,7 +80,7 @@
 	ccp->name = strdup(roomname);
 	ccp->instance = instance;
 
-	conn->priv = (void *)ccp;
+	conn->internal = (void *)ccp;
 
 	return 0;
 }
--- a/src/protocols/oscar/conn.c	Sat Jul 09 19:19:53 2005 +0000
+++ b/src/protocols/oscar/conn.c	Sat Jul 09 19:26:49 2005 +0000
@@ -162,14 +162,6 @@
 		aim_conn_close(*deadconn);
 
 	/*
-	 * XXX ->priv should never be touched by the library. I know
-	 * it used to be, but I'm getting rid of all that.  Use
-	 * ->internal instead.
-	 */
-	if ((*deadconn)->priv)
-		free((*deadconn)->priv);
-
-	/*
 	 * This will free ->internal if it necessary...
 	 */
 	if ((*deadconn)->type == AIM_CONN_TYPE_CHAT)