changeset 16535:72e4e92f9a2c

Update the compatibility layer to g_memdup() stuff, so we don't end up with double-frees. This is completely untested, but I doubt anyone will use it.
author Richard Laager <rlaager@wiktel.com>
date Fri, 27 Apr 2007 21:38:29 +0000
parents 5382c414aab1
children fa8d831e9aa6
files libpurple/gaim-compat.h
diffstat 1 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/gaim-compat.h	Fri Apr 27 21:31:57 2007 +0000
+++ b/libpurple/gaim-compat.h	Fri Apr 27 21:38:29 2007 +0000
@@ -27,6 +27,8 @@
 #ifndef _GAIM_COMPAT_H_
 #define _GAIM_COMPAT_H_
 
+#include <glib.h>
+
 /* from account.h */
 #define GaimAccountUiOps PurpleAccountUiOps
 #define GaimAccount PurpleAccount
@@ -51,7 +53,6 @@
 #define gaim_account_set_password            purple_account_set_password
 #define gaim_account_set_alias               purple_account_set_alias
 #define gaim_account_set_user_info           purple_account_set_user_info
-#define gaim_account_set_buddy_icon          purple_account_set_buddy_icon
 #define gaim_account_set_buddy_icon_path     purple_account_set_buddy_icon_path
 #define gaim_account_set_protocol_id         purple_account_set_protocol_id
 #define gaim_account_set_connection          purple_account_set_connection
@@ -81,7 +82,6 @@
 #define gaim_account_get_password           purple_account_get_password
 #define gaim_account_get_alias              purple_account_get_alias
 #define gaim_account_get_user_info          purple_account_get_user_info
-#define gaim_account_get_buddy_icon         purple_account_get_buddy_icon
 #define gaim_account_get_buddy_icon_path    purple_account_get_buddy_icon_path
 #define gaim_account_get_protocol_id        purple_account_get_protocol_id
 #define gaim_account_get_protocol_name      purple_account_get_protocol_name
@@ -338,22 +338,22 @@
 
 #define GaimBuddyIcon  PurpleBuddyIcon
 
-#define gaim_buddy_icon_new      purple_buddy_icon_new
-#define gaim_buddy_icon_destroy  purple_buddy_icon_destroy
+#define gaim_buddy_icon_new(account, username, icon_data, icon_len)\
+        purple_buddy_icon_new(account, username, g_memdup(icon_data, icon_len), icon_len)
 #define gaim_buddy_icon_ref      purple_buddy_icon_ref
 #define gaim_buddy_icon_unref    purple_buddy_icon_unref
 #define gaim_buddy_icon_update   purple_buddy_icon_update
 
-#define gaim_buddy_icon_set_account   purple_buddy_icon_set_account
-#define gaim_buddy_icon_set_username  purple_buddy_icon_set_username
-#define gaim_buddy_icon_set_data      purple_buddy_icon_set_protocol_data
+#define gaim_buddy_icon_set_data(icon, data, len) \
+        purple_buddy_icon_set_protocol_data(icon, g_memdup(data, len), len, NULL);
 
 #define gaim_buddy_icon_get_account   purple_buddy_icon_get_account
 #define gaim_buddy_icon_get_username  purple_buddy_icon_get_username
 #define gaim_buddy_icon_get_data      purple_buddy_icon_get_data
 #define gaim_buddy_icon_get_type      purple_buddy_icon_get_extension
 
-#define gaim_buddy_icons_set_for_user   purple_buddy_icons_set_for_user
+#define gaim_buddy_icons_set_for_user(icon, data, len) \
+        purple_buddy_icons_set_for_user(icon, g_memdup(data, len), len)
 #define gaim_buddy_icons_find           purple_buddy_icons_find
 #define gaim_buddy_icons_set_caching    purple_buddy_icons_set_caching
 #define gaim_buddy_icons_is_caching     purple_buddy_icons_is_caching
@@ -944,7 +944,6 @@
 
 /* from gaim-client.h */
 
-/* XXX: should this be purple_init, or pidgin_init */
 #define gaim_init  purple_init
 
 /* from idle.h */
@@ -962,7 +961,7 @@
 
 #define GaimStoredImage  PurpleStoredImage
 
-#define gaim_imgstore_add           purple_imgstore_add_with_id
+#define gaim_imgstore_add(data, size, filename) purple_imgstore_add_with_id(g_memdup(data, size), size, filename)
 #define gaim_imgstore_get           purple_imgstore_find_by_id
 #define gaim_imgstore_get_data      purple_imgstore_get_data
 #define gaim_imgstore_get_size      purple_imgstore_get_size