cpw.nader.asynclogging-3: c36a368a: Added log_reader.h and moved the object ...

morshed.nader at gmail.com morshed.nader at gmail.com
Thu Jan 13 01:25:51 EST 2011


----------------------------------------------------------------------
Revision: c36a368a8e660dc4cd734c36f32866c445142034
Parent:   3e7cad56af326c87bc5402e955a65577347dd431
Author:   morshed.nader at gmail.com
Date:     01/12/11 18:52:52
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/c36a368a8e660dc4cd734c36f32866c445142034

Changelog: 

Added log_reader.h and moved the object definitions into it
Added offset and log length properties to CommonLog for the numerous log types that seem to use them
Made the standard log _inits and _uninits add themselves as loggers
Cleaned up log_reader.c more, still not compiling though

Changes against parent 3e7cad56af326c87bc5402e955a65577347dd431

  added    libpurple/plugins/log_reader.h
  patched  libpurple/commonlog.c
  patched  libpurple/commonlog.h
  patched  libpurple/htmllog.c
  patched  libpurple/oldlog.c
  patched  libpurple/plugins/Makefile.am
  patched  libpurple/plugins/log_reader.c
  patched  libpurple/txtlog.c

-------------- next part --------------
============================================================
--- libpurple/plugins/log_reader.c	359188c50cf002bc1a1fbd0b6378fbfaa2058a9e
+++ libpurple/plugins/log_reader.c	d2383ebb40950961e5fc9e5832315ed834849f62
@@ -1,9 +1,11 @@
+
 #include "internal.h"
 
 #include <stdio.h>
 
 #include "debug.h"
 #include "commonlog.h"
+#include "log_reader.h"
 #include "plugin.h"
 #include "pluginpref.h"
 #include "prefs.h"
@@ -44,34 +46,13 @@ get_month(const gchar *month)
 }
 
 
-/*****************************************************************************
- * Adium Logger                                                              *
- *****************************************************************************/
+/****************
+ * Adium Logger *
+ ****************/
 
 /* The adium logger doesn't write logs, only reads them.  This is to include
  * Adium logs in the log viewer transparently.
  */
-#define PURPLE_TYPE_ADIUM_LOG         (purple_adium_log_get_type())
-#define PURPLE_ADIUM_LOG(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), PURPLE_TYPE_ADIUM_LOG, PurpleAdiumLog))
-#define PURPLE_ADIUM_LOG_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), PURPLE_TYPE_ADIUM_LOG, PurpleAdiumLogClass))
-#define PURPLE_IS_ADIUM_LOG(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), PURPLE_TYPE_ADIUM_LOG))
-#define PURPLE_IS_ADIUM_LOG_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), PURPLE_TYPE_ADIUM_LOG))
-#define PURPLE_ADIUM_LOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), PURPLE_TYPE_ADIUM_LOG, PurpleAdiumLogClass))
-
-typedef struct _PurpleAdiumLog        PurpleAdiumLog;
-typedef struct _PurpleAdiumLogClass   PurpleAdiumLogClass;
-
-struct _PurpleAdiumLog {
-	PurpleCommonLog parent_instance;
-};
-
-struct _PurpleAdiumLogClass {
-	PurpleCommonLogClass parent_class;
-};
-
-GType purple_adium_log_get_type(void);
-
-
 G_DEFINE_TYPE (PurpleAdiumLog, purple_adium_log, PURPLE_TYPE_COMMON_LOG)
 
 #define PURPLE_ADIUM_LOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), PURPLE_TYPE_ADIUM_LOG, PurpleAdiumLogPrivate))
@@ -294,7 +275,7 @@ purple_adium_log_read(PurpleLog *log, Pu
 		read = escaped;
 	}
 
-#ifdef WIN32
+#ifdef G_OS_WIN32
 	/* This problem only seems to show up on Windows.
 	 * The BOM is displaying as a space at the beginning of the log.
 	 */
@@ -446,35 +427,13 @@ messenger_plus_logger_finalize(PurpleLog
 #endif
 
 
-/*****************************************************************************
- * MSN Messenger Logger                                                      *
- *****************************************************************************/
+/************************
+ * MSN Messenger Logger *
+ ************************/
 
 /* The msn logger doesn't write logs, only reads them.  This is to include
  * MSN Messenger message histories in the log viewer transparently.
  */
-
-#define PURPLE_TYPE_MSN_LOG         (purple_msn_log_get_type())
-#define PURPLE_MSN_LOG(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), PURPLE_TYPE_MSN_LOG, PurpleMsnLog))
-#define PURPLE_MSN_LOG_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), PURPLE_TYPE_MSN_LOG, PurpleMsnLogClass))
-#define PURPLE_IS_MSN_LOG(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), PURPLE_TYPE_MSN_LOG))
-#define PURPLE_IS_MSN_LOG_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), PURPLE_TYPE_MSN_LOG))
-#define PURPLE_MSN_LOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), PURPLE_TYPE_MSN_LOG, PurpleMsnLogClass))
-
-typedef struct _PurpleMsnLog        PurpleMsnLog;
-typedef struct _PurpleMsnLogClass   PurpleMsnLogClass;
-
-struct _PurpleMsnLog {
-	PurpleCommonLog parent_instance;
-};
-
-struct _PurpleMsnLogClass {
-	PurpleCommonLogClass parent_class;
-};
-
-GType purple_msn_log_get_type(void);
-
-
 G_DEFINE_TYPE (PurpleMsnLog, purple_msn_log, PURPLE_TYPE_COMMON_LOG)
 
 #define PURPLE_MSN_LOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), PURPLE_TYPE_MSN_LOG, PurpleMsnLogPrivate))
@@ -495,18 +454,17 @@ msn_logger_parse_timestamp(xmlnode *mess
 msn_logger_parse_timestamp(xmlnode *message, struct tm **tm_out)
 {
 	const gchar *date, *datetime, *time;
-	gint month, day, year, hour, min, sec;
 	gchar am_pm, *str;
+	gint month, day, year, hour, min, sec;
 	static struct tm tm, tm2;
 	time_t stamp, t, diff;
 
 #ifndef G_DISABLE_CHECKS
-	if (message != NULL)
-	{
+	if (message != NULL) {
 		*tm_out = NULL;
 
 		/* Trigger the usual warning. */
-		g_return_val_if_fail(message != NULL, (time_t)0);
+		g_return_val_if_fail(message != NULL, (time_t) 0);
 	}
 #endif
 
@@ -541,45 +499,39 @@ msn_logger_parse_timestamp(xmlnode *mess
 	}
 
 	time = xmlnode_get_attrib(message, "Time");
-	if (!(time && *time))
-	{
+
+	if (!(time && *time)) {
 		purple_debug_error("MSN log timestamp parse",
 		                   "Attribute missing: %s\n", "Time");
 		*tm_out = &tm2;
 		return stamp;
 	}
 
-	if (sscanf(date, "%u/%u/%u", &month, &day, &year) != 3)
-	{
+	if (sscanf(date, "%u/%u/%u", &month, &day, &year) != 3) {
 		purple_debug_error("MSN log timestamp parse",
 		                   "%s parsing error\n", "Date");
 		*tm_out = &tm2;
 		return stamp;
-	}
-	else
-	{
-		if (month > 12)
-		{
-			int tmp = day;
+	} else {
+		if (month > 12) {
+			gint tmp = day;
 			day = month;
 			month = tmp;
 		}
 	}
 
-	if (sscanf(time, "%u:%u:%u %c", &hour, &min, &sec, &am_pm) != 4)
-	{
+	if (sscanf(time, "%u:%u:%u %c", &hour, &min, &sec, &am_pm) != 4) {
 		purple_debug_error("MSN log timestamp parse",
 		                   "%s parsing error\n", "Time");
 		*tm_out = &tm2;
 		return stamp;
 	}
 
-        if (am_pm == 'P') {
-                hour += 12;
-        } else if (hour == 12) {
-                /* 12 AM = 00 hr */
-                hour = 0;
-        }
+	if (am_pm == 'P')
+		hour += 12;
+	else if (hour == 12)
+		/* 12 AM = 00 hr */
+		hour = 0;
 
 	str = g_strdup_printf("%04i-%02i-%02iT%02i:%02i:%02i", year, month, day, hour, min, sec);
 	t = purple_str_to_time(str, TRUE, &tm, NULL, NULL);
@@ -590,10 +542,8 @@ msn_logger_parse_timestamp(xmlnode *mess
 	else
 		diff = t - stamp;
 
-	if (diff > (14 * 60 * 60))
-	{
-		if (day <= 12)
-		{
+	if (diff > (14 * 60 * 60)) {
+		if (day <= 12) {
 			/* Swap day & month variables, to see if it's a non-US date. */
 			g_free(str);
 			str = g_strdup_printf("%04i-%02i-%02iT%02i:%02i:%02i", year, month, day, hour, min, sec);
@@ -604,22 +554,17 @@ msn_logger_parse_timestamp(xmlnode *mess
 			else
 				diff = t - stamp;
 
-			if (diff > (14 * 60 * 60))
-			{
+			if (diff > (14 * 60 * 60)) {
 				/* We got a time, it's not impossible, but
 				 * the diff is too large.  Display the UTC time. */
 				g_free(str);
 				*tm_out = &tm2;
 				return stamp;
-			}
-			else
-			{
+			} else {
 				/* Legal time */
 				/* Fall out */
 			}
-		}
-		else
-		{
+		} else {
 			/* We got a time, it's not impossible, but
 			 * the diff is too large.  Display the UTC time. */
 			g_free(str);
@@ -630,12 +575,12 @@ msn_logger_parse_timestamp(xmlnode *mess
 
 	/* If we got here, the time is legal with a reasonable offset.
 	 * Let's find out if it's in our TZ. */
-	if (purple_str_to_time(str, FALSE, &tm, NULL, NULL) == stamp)
-	{
+	if (purple_str_to_time(str, FALSE, &tm, NULL, NULL) == stamp) {
 		g_free(str);
 		*tm_out = &tm;
 		return stamp;
 	}
+
 	g_free(str);
 
 	/* The time isn't in our TZ, but it's reasonable. */
@@ -643,6 +588,7 @@ msn_logger_parse_timestamp(xmlnode *mess
 	tm.tm_zone = "   ";
 #endif
 	*tm_out = &tm;
+
 	return stamp;
 }
 
@@ -1220,67 +1166,60 @@ purple_msn_log_init(PurpleMsnLog *msn_lo
 	priv->last_log = FALSE;
 }
 
-/*****************************************************************************
- * Trillian Logger                                                           *
- *****************************************************************************/
+/*******************
+ * Trillian Logger *
+ *******************/
 
 /* The trillian logger doesn't write logs, only reads them.  This is to include
  * Trillian logs in the log viewer transparently.
  */
 
-static PurpleLogLogger *trillian_logger;
-static void trillian_logger_finalize(PurpleLog *log);
+G_DEFINE_TYPE (PurpleTrillianLog, purple_trillian_log, PURPLE_TYPE_COMMON_LOG)
 
-struct trillian_logger_data {
-	gchar *path; /* FIXME: Change this to use PurpleStringref like log.c:old_logger_list */
-	int offset;
-	int length;
+#define PURPLE_TRILLIAN_LOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), PURPLE_TYPE_TRILLIAN_LOG, PurpleTrillianLogPrivate))
+typedef struct _PurpleTrillianLogPrivate PurpleTrillianLogPrivate;
+
+struct _PurpleTrillianLogPrivate {
 	gchar *their_nickname;
 };
 
 static GList *
-trillian_logger_list(PurpleLogType type, const gchar *sn, PurpleAccount *account)
+purple_trillian_log_list(PurpleLog *log, PurpleLogChatType chat_type, const gchar *sn, PurpleAccount *account, GCancellable *cancellable, GError **error)
 {
 	GList *list = NULL;
-	const gchar *logdir;
 	PurplePlugin *plugin;
 	PurplePluginProtocolInfo *prpl_info;
-	gchar *prpl_name;
-	const gchar *buddy_name;
-	gchar *filename;
-	gchar *path;
-	GError *error = NULL;
-	gchar *contents = NULL;
+	const gchar *logdir, *buddy_name;
+	gchar *prpl_name, *filename, *path;
+	gchar *contents = NULL, *line, *c;
 	gsize length;
-	gchar *line;
-	gchar *c;
 
-	g_return_val_if_fail(sn != NULL, NULL);
-	g_return_val_if_fail(account != NULL, NULL);
-
 	logdir = purple_prefs_get_string("/plugins/core/log_reader/trillian/log_directory");
 
 	/* By clearing the log directory path, this logger can be (effectively) disabled. */
-	if (!logdir || !*logdir)
+	if (logdir == NULL || *logdir == 0) {
+		//error?
 		return NULL;
+	}
 
 	plugin = purple_find_prpl(purple_account_get_protocol_id(account));
-	if (!plugin)
+
+	if (plugin == NULL) {
 		return NULL;
+	}
 
 	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin);
-	if (!prpl_info->list_icon)
+
+	if (prpl_info->list_icon == NULL) {
 		return NULL;
+	}
 
 	prpl_name = g_ascii_strup(prpl_info->list_icon(account, NULL), -1);
-
 	buddy_name = purple_normalize(account, sn);
 
 	filename = g_strdup_printf("%s.log", buddy_name);
-	path = g_build_filename(
-		logdir, prpl_name, filename, NULL);
+	path = g_build_filename(logdir, prpl_name, filename, NULL);
 
-	purple_debug_info("Trillian log list", "Reading %s\n", path);
 	/* FIXME: There's really no need to read the entire file at once.
 	 * See src/log.c:old_logger_list for a better approach.
 	 */
@@ -1433,30 +1372,26 @@ trillian_logger_list(PurpleLogType type,
 	return g_list_reverse(list);
 }
 
-static gchar * trillian_logger_read (PurpleLog *log, PurpleLogReadFlags *flags)
+static gchar *
+purple_trillian_log_read(PurpleLog *log, PurpleLogReadFlags *flags, GCancellable *cancellable, GError **error)
 {
-	struct trillian_logger_data *data;
-	gchar *read;
-	FILE *file;
 	PurpleBuddy *buddy;
-	gchar *escaped;
 	GString *formatted;
+	const gchar *line;
 	gchar *c;
-	const gchar *line;
+	gchar *escaped;
+	gchar *read;
+	FILE *file;
 
 	if (flags != NULL)
 		*flags = PURPLE_LOG_READ_NO_NEWLINE;
 
-	g_return_val_if_fail(log != NULL, g_strdup(""));
-
 	data = log->logger_data;
 
 	g_return_val_if_fail(data->path != NULL, g_strdup(""));
 	g_return_val_if_fail(data->length > 0, g_strdup(""));
 	g_return_val_if_fail(data->their_nickname != NULL, g_strdup(""));
 
-	purple_debug_info("Trillian log read", "Reading %s\n", data->path);
-
 	read = g_malloc(data->length + 2);
 
 	file = g_fopen(data->path, "rb");
@@ -1482,14 +1417,13 @@ static gchar * trillian_logger_read (Pur
 	formatted = g_string_sized_new(strlen(read));
 	c = read;
 	line = read;
-	while (c)
-	{
+
+	while (c) {
 		const gchar *link;
 		const gchar *footer = NULL;
 		GString *temp = NULL;
 
-		if ((c = strstr(c, "\n")))
-		{
+		if ((c = strstr(c, "\n")) != NULL) {
 			*c = '\0';
 			c++;
 		}
@@ -1729,8 +1663,8 @@ static gchar * trillian_logger_read (Pur
 	return g_strchomp(g_string_free(formatted, FALSE));
 }
 
-static int
-trillian_logger_size(PurpleLog *log)
+static gssize
+purple_trillian_log_size(PurpleLog *log, GCancellable *cancellable, GError **error)
 {
 	struct trillian_logger_data *data;
 	gchar *text;
@@ -1740,9 +1674,8 @@ trillian_logger_size(PurpleLog *log)
 
 	data = log->logger_data;
 
-	if (purple_prefs_get_bool("/plugins/core/log_reader/fast_sizes")) {
+	if (purple_prefs_get_bool("/plugins/core/log_reader/fast_sizes"))
 		return data ? data->length : 0;
-	}
 
 	text = trillian_logger_read(log, NULL);
 	size = strlen(text);
@@ -1752,26 +1685,50 @@ static void
 }
 
 static void
-trillian_logger_finalize(PurpleLog *log)
+purple_trillian_log_finalize(GObject *object)
 {
-	struct trillian_logger_data *data;
+	PurpleTrillianLogPrivate *priv = PURPLE_TRILLIAN_LOG_GET_PRIVATE(object);
 
-	g_return_if_fail(log != NULL);
+	g_free(priv->their_nickname);
 
-	data = log->logger_data;
+	G_OBJECT_CLASS(purple_trillian_log_parent_class)->finalize(object);
+}
 
-	g_free(data->path);
-	g_free(data->their_nickname);
-	g_free(data);
+static void
+purple_trillian_log_class_init(PurpleTrillianLogClass *class)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS(class);
+	PurpleLogClass *log_class = PURPLE_LOG_CLASS(class);
+
+	log_class->logger_name = _("Trillian");
+	log_class->logger_id = "trillian";
+
+	log_class->list_fn = purple_trillian_log_list;
+	log_class->read_fn = purple_trillian_log_read;
+
+	g_type_class_add_private(gobject_class, sizeof(PurpleTrillianLogPrivate));
 }
 
-/*****************************************************************************
- * QIP Logger                                                           *
- *****************************************************************************/
+static void
+purple_trillian_log_init(PurpleTrillianLog *trillian_log)
+{
+	PurpleTrillianLogPrivate *priv = PURPLE_TRILLIAN_LOG_GET_PRIVATE(trillian_log);
 
+	priv->offset = 0;
+	priv->length = 0;
+	priv->their_nickname = NULL;
+}
+
+/**************
+ * QIP Logger *
+ **************/
+
 /* The QIP logger doesn't write logs, only reads them.  This is to include
  * QIP logs in the log viewer transparently.
  */
+
+G_DEFINE_TYPE (PurpleQipLog, purple_qip_log, PURPLE_TYPE_COMMON_LOG)
+
 #define QIP_LOG_DELIMITER "--------------------------------------"
 #define QIP_LOG_IN_MESSAGE (QIP_LOG_DELIMITER "<-")
 #define QIP_LOG_OUT_MESSAGE (QIP_LOG_DELIMITER ">-")
@@ -1779,17 +1736,8 @@ trillian_logger_finalize(PurpleLog *log)
 #define QIP_LOG_OUT_MESSAGE_ESC (QIP_LOG_DELIMITER "&gt;-")
 #define QIP_LOG_TIMEOUT (60*60)
 
-static PurpleLogLogger *qip_logger;
-
-struct qip_logger_data {
-
-	gchar *path; /* FIXME: Change this to use PurpleStringref like log.c:old_logger_list  */
-	int offset;
-	int length;
-};
-
 static GList *
-qip_logger_list(PurpleLogType type, const gchar *sn, PurpleAccount *account)
+purple_qip_log_list(PurpleLog *log, PurpleLogType type, const gchar *sn, PurpleAccount *account, GCancellable *cancellable, GError **error)
 {
 	GList *list = NULL;
 	const gchar *logdir;
@@ -1837,8 +1785,6 @@ qip_logger_list(PurpleLogType type, cons
 	g_free(username);
 	g_free(filename);
 
-	purple_debug_info("QIP logger", "Reading %s\n", path);
-
 	error = NULL;
 	if (!g_file_get_contents(path, &contents, NULL, &error)) {
 		purple_debug_error("QIP logger",
@@ -1952,7 +1898,7 @@ static gchar *
 }
 
 static gchar *
-qip_logger_read(PurpleLog *log, PurpleLogReadFlags *flags)
+purple_qip_log_read(PurpleLog *log, PurpleLogReadFlags *flags, GCancellable *cancellable, GError **error)
 {
 	struct qip_logger_data *data;
 	PurpleBuddy *buddy;
@@ -2104,61 +2050,23 @@ qip_logger_read(PurpleLog *log, PurpleLo
 	return g_strchomp(g_string_free(formatted, FALSE));
 }
 
-static int
-qip_logger_size(PurpleLog *log)
-{
-	struct qip_logger_data *data;
-	gchar *text;
-	size_t size;
+/***************
+ * aMSN Logger *
+ ***************/
 
-	g_return_val_if_fail(log != NULL, 0);
-
-	data = log->logger_data;
-
-	if (purple_prefs_get_bool("/plugins/core/log_reader/fast_sizes")) {
-		return data ? data->length : 0;
-	}
-
-	text = qip_logger_read(log, NULL);
-	size = strlen(text);
-	g_free(text);
-
-	return size;
-}
-
-static void
-qip_logger_finalize(PurpleLog *log)
-{
-	struct qip_logger_data *data;
-
-	g_return_if_fail(log != NULL);
-
-	data = log->logger_data;
-
-	g_free(data->path);
-	g_free(data);
-}
-
-/*************************************************************************
- * aMSN Logger                                                           *
- *************************************************************************/
-
 /* The aMSN logger doesn't write logs, only reads them.  This is to include
  * aMSN logs in the log viewer transparently.
  */
 
-static PurpleLogLogger *amsn_logger;
+G_DEFINE_TYPE (PurpleAMsnLog, purple_amsn_log, PURPLE_TYPE_COMMON_LOG)
 
-struct amsn_logger_data {
-	gchar *path;
-	gint offset;
-	gint length;
-};
-
 #define AMSN_LOG_CONV_START "|\"LRED[Conversation started on "
 #define AMSN_LOG_CONV_END "|\"LRED[You have closed the window on "
 #define AMSN_LOG_CONV_EXTRA "01 Aug 2001 00:00:00]"
 
+/* Really it's |"L, but the string's been escaped */
+#define AMSN_LOG_FORMAT_TAG "|&quot;L"
+
 static GList *
 amsn_logger_parse_file(gchar *filename, const gchar *sn, PurpleAccount *account)
 {
@@ -2168,7 +2076,6 @@ amsn_logger_parse_file(gchar *filename, 
 	struct amsn_logger_data *data;
 	PurpleLog *log;
 
-	purple_debug_info("aMSN logger", "Reading %s\n", filename);
 	error = NULL;
 	if (!g_file_get_contents(filename, &contents, NULL, &error)) {
 		purple_debug_error("aMSN logger",
@@ -2338,11 +2245,8 @@ purple_amsn_log_list(PurpleLog *log, Pur
 	return list;
 }
 
-/* Really it's |"L, but the string's been escaped */
-#define AMSN_LOG_FORMAT_TAG "|&quot;L"
-
 static gchar *
-amsn_logger_read(PurpleLog *log, PurpleLogReadFlags *flags)
+purple_amsn_log_read(PurpleLog *log, PurpleLogReadFlags *flags)
 {
 	struct amsn_logger_data *data;
 	FILE *file;
@@ -2451,48 +2355,13 @@ amsn_logger_read(PurpleLog *log, PurpleL
 	return g_string_free(formatted, FALSE);
 }
 
-static int
-amsn_logger_size(PurpleLog *log)
-{
-	struct amsn_logger_data *data;
-	gchar *text;
-	int size;
+/***************
+ * Plugin Code *
+ ***************/
 
-	g_return_val_if_fail(log != NULL, 0);
-
-	data = log->logger_data;
-
-	if (purple_prefs_get_bool("/plugins/core/log_reader/fast_sizes")) {
-		return data ? data->length : 0;
-	}
-
-	text = amsn_logger_read(log, NULL);
-	size = strlen(text);
-	g_free(text);
-
-	return size;
-}
-
 static void
-amsn_logger_finalize(PurpleLog *log)
-{
-	struct amsn_logger_data *data;
-
-	g_return_if_fail(log != NULL);
-
-	data = log->logger_data;
-	g_free(data->path);
-	g_free(data);
-}
-
-/*****************************************************************************
- * Plugin Code                                                               *
- *****************************************************************************/
-
-static void
 init_plugin(PurplePlugin *plugin)
 {
-
 }
 
 static void
@@ -2763,18 +2632,6 @@ plugin_load(PurplePlugin *plugin)
 
 	log_reader_init_prefs();
 
-	/* The names of IM clients are marked for translation at the request of
-	   translators who wanted to transliterate them.  Many translators
-	   choose to leave them alone.  Choose what's best for your language. */
-	purple_adium_log = purple_log_logger_new("adium", _("Adium"), 6,
-									   NULL,
-									   NULL,
-									   purple_adium_log_finalize,
-									   purple_adium_log_list,
-									   purple_adium_log_read,
-									   purple_adium_log_size);
-	purple_log_logger_add(purple_adium_log);
-
 #if 0
 	/* The names of IM clients are marked for translation at the request of
 	   translators who wanted to transliterate them.  Many translators
@@ -2856,38 +2713,17 @@ plugin_unload(PurplePlugin *plugin)
 static gboolean
 plugin_unload(PurplePlugin *plugin)
 {
-	g_return_val_if_fail(plugin != NULL, FALSE);
-
-	purple_log_logger_remove(purple_adium_log);
-	purple_log_logger_free(purple_adium_log);
-	purple_adium_log = NULL;
-
 #if 0
-	purple_log_logger_remove(fire_logger);
-	purple_log_logger_free(fire_logger);
-	fire_logger = NULL;
-
-	purple_log_logger_remove(messenger_plus_logger);
-	purple_log_logger_free(messenger_plus_logger);
-	messenger_plus_logger = NULL;
+	purple_log_logger_remove(PURPLE_TYPE_FIRE_LOG);
+	purple_log_logger_remove(PURPLE_TYPE_MESSENGER_PLUS_LOG);
 #endif
 
-	purple_log_logger_remove(msn_logger);
-	purple_log_logger_free(msn_logger);
-	msn_logger = NULL;
+	purple_log_logger_remove(PURPLE_TYPE_ADIUM_LOG);
+	purple_log_logger_remove(PURPLE_TYPE_MSN_LOG);
+	purple_log_logger_remove(PURPLE_TYPE_TRILLIAN_LOG);
+	purple_log_logger_remove(PURPLE_TYPE_QIP_LOG);
+	purple_log_logger_remove(PURPLE_TYPE_AMSN_LOG);
 
-	purple_log_logger_remove(trillian_logger);
-	purple_log_logger_free(trillian_logger);
-	trillian_logger = NULL;
-
-	purple_log_logger_remove(qip_logger);
-	purple_log_logger_free(qip_logger);
-	qip_logger = NULL;
-
-	purple_log_logger_remove(amsn_logger);
-	purple_log_logger_free(amsn_logger);
-	amsn_logger = NULL;
-
 	return TRUE;
 }
 
@@ -2897,13 +2733,9 @@ get_plugin_pref_frame(PurplePlugin *plug
 	PurplePluginPrefFrame *frame;
 	PurplePluginPref *ppref;
 
-	g_return_val_if_fail(plugin != NULL, FALSE);
-
 	frame = purple_plugin_pref_frame_new();
 
-
 	/* Add general preferences. */
-
 	ppref = purple_plugin_pref_new_with_label(_("General Log Reading Configuration"));
 	purple_plugin_pref_frame_add(frame, ppref);
 
@@ -2915,9 +2747,7 @@ get_plugin_pref_frame(PurplePlugin *plug
 		"/plugins/core/log_reader/use_name_heuristics", _("Use name heuristics"));
 	purple_plugin_pref_frame_add(frame, ppref);
 
-
 	/* Add Log Directory preferences. */
-
 	ppref = purple_plugin_pref_new_with_label(_("Log Directory"));
 	purple_plugin_pref_frame_add(frame, ppref);
 
@@ -2971,14 +2801,14 @@ static PurplePluginInfo info =
 	PURPLE_PLUGIN_MAGIC,
 	PURPLE_MAJOR_VERSION,
 	PURPLE_MINOR_VERSION,
-	PURPLE_PLUGIN_STANDARD,                             /**< type           */
-	NULL,                                             /**< ui_requirement */
-	0,                                                /**< flags          */
-	NULL,                                             /**< dependencies   */
-	PURPLE_PRIORITY_DEFAULT,                            /**< priority       */
-	"core-log_reader",                                /**< id             */
-	N_("Log Reader"),                                 /**< name           */
-	DISPLAY_VERSION,                                  /**< version        */
+	PURPLE_PLUGIN_STANDARD,        /**< type */
+	NULL,                          /**< ui_requirement */
+	0,                             /**< flags */
+	NULL,                          /**< dependencies */
+	PURPLE_PRIORITY_DEFAULT,       /**< priority */
+	"core-log_reader",             /**< id */
+	N_("Log Reader"),              /**< name */
+	DISPLAY_VERSION,               /**< version */
 
 	/** summary */
 	N_("Includes other IM clients' logs in the "
@@ -2993,7 +2823,7 @@ static PurplePluginInfo info =
 	   "may crash frequently.  Use it at your own risk!"),
 
 	"Richard Laager <rlaager at pidgin.im>",             /**< author         */
-	PURPLE_WEBSITE,                                     /**< homepage       */
+	PURPLE_WEBSITE,                                   /**< homepage       */
 	plugin_load,                                      /**< load           */
 	plugin_unload,                                    /**< unload         */
 	NULL,                                             /**< destroy        */
============================================================
--- libpurple/plugins/Makefile.am	745b67aa56634bd2b67533d6be2a52ea55f01525
+++ libpurple/plugins/Makefile.am	ec52e0928671d24f93561f6d9c8786ec16cc96e6
@@ -79,7 +79,7 @@ joinpart_la_SOURCES         = joinpart.c
 helloworld_la_SOURCES       = helloworld.c
 idle_la_SOURCES             = idle.c
 joinpart_la_SOURCES         = joinpart.c
-log_reader_la_SOURCES       = log_reader.c
+log_reader_la_SOURCES       = log_reader.c log_reader.h
 newline_la_SOURCES          = newline.c
 notify_example_la_SOURCES   = notify_example.c
 offlinemsg_la_SOURCES       = offlinemsg.c
============================================================
--- libpurple/htmllog.c	b8852478d6e2df800c8c9011ffab0973e9c29da4
+++ libpurple/htmllog.c	4dc2cb45e8a1be41f3c9b35e37623a9e3a18505d
@@ -333,6 +333,8 @@ purple_html_log_system_init(void)
 purple_html_log_system_init(void)
 {
 	purple_prefs_add_string("/purple/logging/format", "html");
+
+	purple_log_logger_add(PURPLE_TYPE_HTML_LOG);
 }
 
 void *
@@ -346,4 +348,5 @@ purple_html_log_system_uninit(void)
 void
 purple_html_log_system_uninit(void)
 {
+	purple_log_logger_remove(PURPLE_TYPE_HTML_LOG);
 }
============================================================
--- libpurple/oldlog.c	77895cd5a8fbf1e038366371aceb54599a48668d
+++ libpurple/oldlog.c	3ec6220eb53ead6d1b7e3ab25731e783ac35aba9
@@ -27,22 +27,12 @@
 #include "internal.h"
 #include "oldlog.h"
 #include "debug.h"
-#include "stringref.h"
 
 G_DEFINE_TYPE (PurpleOldLog, purple_old_log, PURPLE_TYPE_COMMON_LOG)
 
-#define PURPLE_OLD_LOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), PURPLE_TYPE_OLD_LOG, PurpleOldLogPrivate))
-typedef struct _PurpleOldLogPrivate PurpleOldLogPrivate;
-
-struct _PurpleOldLogPrivate {
-	gssize offset;
-	gssize length;
-};
-
 static GList *purple_old_log_list(PurpleLog *, PurpleLogChatType, const gchar *, PurpleAccount *, GCancellable *, GError **);
 static gint purple_old_log_total_size(PurpleLog *, PurpleLogChatType, const gchar *, PurpleAccount *, GCancellable *, GError **);
 static gchar *purple_old_log_read(PurpleLog *, PurpleLogReadFlags *, GCancellable *, GError **);
-static gssize purple_old_log_size(PurpleLog *, GCancellable *, GError **);
 static GHashTable *purple_old_log_get_log_sets(PurpleLog *, GCancellable *, GError **);
 
 
@@ -53,7 +43,6 @@ purple_old_log_class_init(PurpleOldLogCl
 static void
 purple_old_log_class_init(PurpleOldLogClass *class)
 {
-	GObjectClass *gobject_class = G_OBJECT_CLASS(class);
 	PurpleLogClass *log_class = PURPLE_LOG_CLASS(class);
 
 	log_class->logger_name = _("Old flat format");
@@ -61,11 +50,8 @@ purple_old_log_class_init(PurpleOldLogCl
 
 	log_class->list_fn = purple_old_log_list;
 	log_class->read_fn = purple_old_log_read;
-	log_class->size_fn = purple_old_log_size;
 	log_class->total_size_fn = purple_old_log_total_size;
 	log_class->get_log_sets_fn = purple_old_log_get_log_sets;
-
-	g_type_class_add_private(gobject_class, sizeof(PurpleOldLogPrivate));
 }
 
 static void
@@ -167,15 +153,13 @@ purple_old_log_list(PurpleLog *log, Purp
 			{
 				if (sscanf(buffer, "%d\t%d\t%lu", &lastoff, &newlen, &idx_time) == 3) {
 					PurpleLog *log;
-					PurpleOldLogPrivate *priv;
 
 					log = purple_old_log_new(PURPLE_LOG_IM,
 						sn, account, NULL, idx_time, NULL);
 
-					priv = PURPLE_OLD_LOG_GET_PRIVATE(log);
 					purple_common_log_set_file(PURPLE_COMMON_LOG(log), file);
-					priv->offset = lastoff;
-					priv->length = newlen;
+					purple_common_log_set_offset(PURPLE_COMMON_LOG(log), lastoff);
+					purple_common_log_set_length(PURPLE_COMMON_LOG(log), newlen);
 
 					list = g_list_prepend(list, log);
 				}
@@ -272,17 +256,16 @@ purple_old_log_list(PurpleLog *log, Purp
 				if (newlen != 0) {
 					PurpleLog *log = purple_log_new(PURPLE_TYPE_OLD_LOG, PURPLE_LOG_IM, sn,
 						account, NULL, lasttime, NULL);
-					PurpleOldLogPrivate *priv = PURPLE_OLD_LOG_GET_PRIVATE(log);
 
 					purple_common_log_set_file(PURPLE_COMMON_LOG(log), file);
-					priv->offset = lastoff;
-					priv->length = newlen;
+					purple_common_log_set_offset(PURPLE_COMMON_LOG(log), lastoff);
+					purple_common_log_set_length(PURPLE_COMMON_LOG(log), newlen);
 
 					list = g_list_prepend(list, log);
 
 					/* XXX: There is apparently Is there a proper way to print a time_t? */
 					if (index != NULL)
-						fprintf(index, "%d\t%d\t%lu\n", priv->offset, priv->length,
+						fprintf(index, "%d\t%d\t%lu\n", lastoff, newlen,
 							(unsigned long) purple_log_get_time(log));
 				}
 			}
@@ -331,17 +314,16 @@ purple_old_log_list(PurpleLog *log, Purp
 		if ((newlen = offset - lastoff) != 0) {
 			PurpleLog *log = purple_log_new(PURPLE_TYPE_OLD_LOG, PURPLE_LOG_IM, sn,
 				account, NULL, lasttime, NULL);
-			PurpleOldLogPrivate *priv = PURPLE_OLD_LOG_GET_PRIVATE(log);
 
 			purple_common_log_set_file(PURPLE_COMMON_LOG(log), file);
-			priv->offset = lastoff;
-			priv->length = newlen;
+			purple_common_log_set_offset(PURPLE_COMMON_LOG(log), lastoff);
+			purple_common_log_set_length(PURPLE_COMMON_LOG(log), newlen);
 
 			list = g_list_prepend(list, log);
 
 			/* XXX: Is there a proper way to print a time_t? */
 			if (index != NULL)
-				fprintf(index, "%d\t%d\t%d\n", priv->offset, priv->length,
+				fprintf(index, "%d\t%d\t%d\n", lastoff, newlen,
 					(gint) purple_log_get_time(log));
 		}
 	}
@@ -409,12 +391,11 @@ purple_old_log_read(PurpleLog *log, Purp
 static gchar *
 purple_old_log_read(PurpleLog *log, PurpleLogReadFlags *flags, GCancellable *cancellable, GError **error)
 {
-	PurpleOldLogPrivate *priv = PURPLE_OLD_LOG_GET_PRIVATE(log);
 	GFile *file;
 	GFileInputStream *file_stream;
 	GInputStream *stream;
 	gchar *read;
-	gssize result;
+	gssize length, offset, result;
 
 	file = purple_common_log_get_file(PURPLE_COMMON_LOG(log));
 	file_stream = g_file_read(file, cancellable, error);
@@ -422,8 +403,9 @@ purple_old_log_read(PurpleLog *log, Purp
 	if (file_stream == NULL)
 		return NULL;
 
+	offset = purple_common_log_get_offset(PURPLE_COMMON_LOG(log));
 	stream = G_INPUT_STREAM(file_stream);
-	result = g_input_stream_skip(stream, priv->offset, cancellable, error);
+	result = g_input_stream_skip(stream, offset, cancellable, error);
 
 	if (result < 0) {
 		g_object_unref(stream);
@@ -431,8 +413,9 @@ purple_old_log_read(PurpleLog *log, Purp
 		return NULL;
 	}
 
-	read = g_malloc(priv->length + 1);
-	result = g_input_stream_read(stream, read, priv->length, cancellable, error);
+	length = purple_common_log_get_length(PURPLE_COMMON_LOG(log));
+	read = g_malloc(length + 1);
+	result = g_input_stream_read(stream, read, length, cancellable, error);
 
 	if (result < 0) {
 		g_free(read);
@@ -443,7 +426,7 @@ purple_old_log_read(PurpleLog *log, Purp
 
 	g_object_unref(stream);
 
-	read[priv->length] = '\0';
+	read[length] = '\0';
 
 	if (flags != NULL) {
 		if (strstr(read, "<BR>"))
@@ -457,14 +440,6 @@ purple_old_log_read(PurpleLog *log, Purp
 	return _process_txt_log(read, NULL);
 }
 
-static gssize
-purple_old_log_size(PurpleLog *log, GCancellable *cancellable, GError **error)
-{
-	PurpleOldLogPrivate *priv = PURPLE_OLD_LOG_GET_PRIVATE(log);
-
-	return priv->length;
-}
-
 static GHashTable *
 purple_old_log_get_log_sets(PurpleLog *log, GCancellable *cancellable, GError **error)
 {
@@ -582,6 +557,8 @@ purple_old_log_system_init(void)
 purple_old_log_system_init(void)
 {
 	purple_prefs_add_string("/purple/logging/format", "old");
+
+	purple_log_logger_add(PURPLE_TYPE_OLD_LOG);
 }
 
 void *
@@ -595,4 +572,5 @@ purple_old_log_system_uninit(void)
 void
 purple_old_log_system_uninit(void)
 {
+	purple_log_logger_remove(PURPLE_TYPE_OLD_LOG);
 }
============================================================
--- libpurple/txtlog.c	52cc34116647eccf1d5ae5341ed29c52b9ac0ef8
+++ libpurple/txtlog.c	c1ffa5bcf9c3f0a5cc14a78fa1132d13060b1a34
@@ -255,6 +255,8 @@ purple_txt_log_system_init(void)
 purple_txt_log_system_init(void)
 {
 	purple_prefs_add_string("/purple/logging/format", "txt");
+
+	purple_log_logger_add(PURPLE_TYPE_TXT_LOG);
 }
 
 void *
@@ -268,5 +270,6 @@ purple_txt_log_system_uninit(void)
 void
 purple_txt_log_system_uninit(void)
 {
+	purple_log_logger_remove(PURPLE_TYPE_TXT_LOG);
 }
 
============================================================
--- libpurple/commonlog.c	00b287b7492ecbaecc8366a61f719f3c6995604c
+++ libpurple/commonlog.c	5daa011cca009d214792769696269580a94233ee
@@ -35,6 +35,8 @@ enum {
 enum {
 	PROP_0,
 	PROP_COMMON_LOG_FILE,
+	PROP_COMMON_LOG_OFFSET,
+	PROP_COMMON_LOG_LENGTH,
 	LAST_PROP
 };
 
@@ -45,6 +47,8 @@ struct _PurpleCommonLogPrivate {
 
 struct _PurpleCommonLogPrivate {
 	GFile *file;
+	gssize offset;
+	gssize length;
 };
 
 typedef struct {
@@ -95,10 +99,36 @@ purple_common_log_class_init(PurpleCommo
 			G_TYPE_FILE,
 			G_PARAM_READWRITE);
 
+	properties[PROP_COMMON_LOG_OFFSET] =
+		g_param_spec_long("offset",
+			"Offset",
+			"The log's offset within its file",
+			-1,
+			G_MAXSSIZE,
+			-1,
+			G_PARAM_READWRITE);
+
+	properties[PROP_COMMON_LOG_LENGTH] =
+		g_param_spec_long("length",
+			"Length",
+			"The log's total size (Not necessary its file size)",
+			-1,
+			G_MAXSSIZE,
+			-1,
+			G_PARAM_READWRITE);
+
 	g_object_class_install_property(gobject_class,
+		PROP_COMMON_LOG_OFFSET,
+		properties[PROP_COMMON_LOG_OFFSET]);
+
+	g_object_class_install_property(gobject_class,
 		PROP_COMMON_LOG_FILE,
 		properties[PROP_COMMON_LOG_FILE]);
 
+	g_object_class_install_property(gobject_class,
+		PROP_COMMON_LOG_LENGTH,
+		properties[PROP_COMMON_LOG_LENGTH]);
+
 	g_type_class_add_private(gobject_class, sizeof(PurpleCommonLogPrivate));
 }
 
@@ -108,6 +138,8 @@ purple_common_log_init(PurpleCommonLog *
 	PurpleCommonLogPrivate *priv = PURPLE_COMMON_LOG_GET_PRIVATE(common_log);
 
 	priv->file = NULL;
+	priv->offset = -1;
+	priv->length = -1;
 }
 
 PurpleLog *
@@ -126,6 +158,12 @@ purple_common_log_set_property(GObject *
 	case PROP_COMMON_LOG_FILE:
 		purple_common_log_set_file(common_log, g_value_get_object(value));
 		break;
+	case PROP_COMMON_LOG_OFFSET:
+		purple_common_log_set_offset(common_log, g_value_get_long(value));
+		break;
+	case PROP_COMMON_LOG_LENGTH:
+		purple_common_log_set_length(common_log, g_value_get_long(value));
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
 		break;
@@ -141,6 +179,12 @@ purple_common_log_get_property(GObject *
 	case PROP_COMMON_LOG_FILE:
 		g_value_set_object(value, purple_common_log_get_file(common_log));
 		break;
+	case PROP_COMMON_LOG_OFFSET:
+		g_value_set_long(value, purple_common_log_get_offset(common_log));
+		break;
+	case PROP_COMMON_LOG_LENGTH:
+		g_value_set_long(value, purple_common_log_get_length(common_log));
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
 		break;
@@ -151,7 +195,7 @@ purple_common_log_set_file(PurpleCommonL
 purple_common_log_set_file(PurpleCommonLog *common_log, GFile *file)
 {
 	PurpleCommonLogPrivate *priv;
-	
+
 	g_return_if_fail(PURPLE_IS_COMMON_LOG(common_log));
 	g_return_if_fail(file == NULL || G_IS_FILE(file));
 
@@ -166,6 +210,24 @@ purple_common_log_set_file(PurpleCommonL
 	priv->file = file;
 }
 
+void
+purple_common_log_set_offset(PurpleCommonLog *common_log, gssize offset)
+{
+	g_return_if_fail(PURPLE_IS_COMMON_LOG(common_log));
+	g_return_if_fail(offset >= -1);
+
+	PURPLE_COMMON_LOG_GET_PRIVATE(log)->offset = offset;
+}
+
+void
+purple_common_log_set_length(PurpleCommonLog *common_log, gssize length)
+{
+	g_return_if_fail(PURPLE_IS_COMMON_LOG(common_log));
+	g_return_if_fail(length >= -1);
+
+	PURPLE_COMMON_LOG_GET_PRIVATE(log)->length = length;
+}
+
 GFile *
 purple_common_log_get_file(PurpleCommonLog *common_log)
 {
@@ -174,6 +236,22 @@ purple_common_log_get_file(PurpleCommonL
 	return PURPLE_COMMON_LOG_GET_PRIVATE(common_log)->file;
 }
 
+gssize
+purple_common_log_get_offset(PurpleCommonLog *common_log)
+{
+	g_return_val_if_fail(PURPLE_IS_COMMON_LOG(common_log), -1);
+
+	return PURPLE_COMMON_LOG_GET_PRIVATE(common_log)->offset;
+}
+
+gssize
+purple_common_log_get_length(PurpleCommonLog *common_log)
+{
+	g_return_val_if_fail(PURPLE_IS_COMMON_LOG(common_log), -1);
+
+	return PURPLE_COMMON_LOG_GET_PRIVATE(common_log)->length;
+}
+
 static void
 common_total_size_callback_data_free(gpointer userdata)
 {
@@ -707,6 +785,9 @@ purple_log_common_size(PurpleLog *log, G
 	GFileInfo *info;
 	guint64 file_size;
 
+	if (priv->length >= 0)
+		return priv->length;
+
 	if (priv->file == NULL) {
 		g_set_error_literal(error,
 			G_IO_ERROR,
============================================================
--- libpurple/commonlog.h	1009aa0f53e6021355170fdf4aeb921522f9ecf0
+++ libpurple/commonlog.h	167883e2c992fa53aef3f59ccb9e57fb0badfd67
@@ -72,7 +72,15 @@ void purple_common_log_set_file(PurpleCo
 //
 void purple_common_log_set_file(PurpleCommonLog *common_log, GFile *file);
 //
+void purple_common_log_set_offset(PurpleCommonLog *common_log, gssize offset);
+//
+void purple_common_log_set_length(PurpleCommonLog *common_log, gssize length);
+//
 GFile *purple_common_log_get_file(PurpleCommonLog *common_log);
+//
+gssize purple_common_log_get_offset(PurpleCommonLog *common_log);
+//
+gssize purple_common_log_get_length(PurpleCommonLog *common_log);
 
 /**
  * Opens a new log file in the standard log location
============================================================
--- /dev/null	
+++ libpurple/plugins/log_reader.h	953703ca5e06aa1531888c918cd5a1e24b764d7b
@@ -0,0 +1,165 @@
+/**
+ * @file log_reader.h External Log Reader API
+ * @ingroup core
+ * @see @ref log-signals
+ */
+
+// This the right copyright info?
+/* purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
+#ifndef _LOG_READER_H_
+#define _LOG_READER_H_
+
+#include <glib-object.h>
+
+#include "commonlog.h"
+
+G_BEGIN_DECLS
+
+/****************
+ * Adium Logger *
+ ****************/
+
+#define PURPLE_TYPE_ADIUM_LOG         (purple_adium_log_get_type())
+#define PURPLE_ADIUM_LOG(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), PURPLE_TYPE_ADIUM_LOG, PurpleAdiumLog))
+#define PURPLE_ADIUM_LOG_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), PURPLE_TYPE_ADIUM_LOG, PurpleAdiumLogClass))
+#define PURPLE_IS_ADIUM_LOG(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), PURPLE_TYPE_ADIUM_LOG))
+#define PURPLE_IS_ADIUM_LOG_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), PURPLE_TYPE_ADIUM_LOG))
+#define PURPLE_ADIUM_LOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), PURPLE_TYPE_ADIUM_LOG, PurpleAdiumLogClass))
+
+typedef struct _PurpleAdiumLog        PurpleAdiumLog;
+typedef struct _PurpleAdiumLogClass   PurpleAdiumLogClass;
+
+struct _PurpleAdiumLog {
+	PurpleCommonLog parent_instance;
+};
+
+struct _PurpleAdiumLogClass {
+	PurpleCommonLogClass parent_class;
+};
+
+GType purple_adium_log_get_type(void);
+// PurpleLog *purple_adium_log_new();
+
+/************************
+ * MSN Messenger Logger *
+ ************************/
+
+#define PURPLE_TYPE_MSN_LOG         (purple_msn_log_get_type())
+#define PURPLE_MSN_LOG(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), PURPLE_TYPE_MSN_LOG, PurpleMsnLog))
+#define PURPLE_MSN_LOG_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), PURPLE_TYPE_MSN_LOG, PurpleMsnLogClass))
+#define PURPLE_IS_MSN_LOG(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), PURPLE_TYPE_MSN_LOG))
+#define PURPLE_IS_MSN_LOG_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), PURPLE_TYPE_MSN_LOG))
+#define PURPLE_MSN_LOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), PURPLE_TYPE_MSN_LOG, PurpleMsnLogClass))
+
+typedef struct _PurpleMsnLog        PurpleMsnLog;
+typedef struct _PurpleMsnLogClass   PurpleMsnLogClass;
+
+struct _PurpleMsnLog {
+	PurpleCommonLog parent_instance;
+};
+
+struct _PurpleMsnLogClass {
+	PurpleCommonLogClass parent_class;
+};
+
+GType purple_msn_log_get_type(void);
+// PurpleLog *purple_msn_log_new();
+
+/*******************
+ * Trillian Logger *
+ *******************/
+
+#define PURPLE_TYPE_TRILLIAN_LOG         (purple_trillian_log_get_type())
+#define PURPLE_TRILLIAN_LOG(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), PURPLE_TYPE_TRILLIAN_LOG, PurpleTrillianLog))
+#define PURPLE_TRILLIAN_LOG_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), PURPLE_TYPE_TRILLIAN_LOG, PurpleTrillianLogClass))
+#define PURPLE_IS_TRILLIAN_LOG(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), PURPLE_TYPE_TRILLIAN_LOG))
+#define PURPLE_IS_TRILLIAN_LOG_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), PURPLE_TYPE_TRILLIAN_LOG))
+#define PURPLE_TRILLIAN_LOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), PURPLE_TYPE_TRILLIAN_LOG, PurpleTrillianLogClass))
+
+typedef struct _PurpleTrillianLog        PurpleTrillianLog;
+typedef struct _PurpleTrillianLogClass   PurpleTrillianLogClass;
+
+struct _PurpleTrillianLog {
+	PurpleCommonLog parent_instance;
+};
+
+struct _PurpleTrillianLogClass {
+	PurpleCommonLogClass parent_class;
+};
+
+GType purple_trillian_log_get_type(void);
+// PurpleLog *purple_trillian_log_new();
+
+/**************
+ * QIP Logger *
+ **************/
+
+#define PURPLE_TYPE_QIP_LOG         (purple_qip_log_get_type())
+#define PURPLE_QIP_LOG(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), PURPLE_TYPE_QIP_LOG, PurpleQipLog))
+#define PURPLE_QIP_LOG_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), PURPLE_TYPE_QIP_LOG, PurpleQipLogClass))
+#define PURPLE_IS_QIP_LOG(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), PURPLE_TYPE_QIP_LOG))
+#define PURPLE_IS_QIP_LOG_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), PURPLE_TYPE_QIP_LOG))
+#define PURPLE_QIP_LOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), PURPLE_TYPE_QIP_LOG, PurpleQipLogClass))
+
+typedef struct _PurpleQipLog        PurpleQipLog;
+typedef struct _PurpleQipLogClass   PurpleQipLogClass;
+
+struct _PurpleQipLog {
+	PurpleCommonLog parent_instance;
+};
+
+struct _PurpleQipLogClass {
+	PurpleCommonLogClass parent_class;
+};
+
+GType purple_qip_log_get_type(void);
+// PurpleLog *purple_qip_log_new();
+
+/***************
+ * aMSN Logger *
+ ***************/
+
+#define PURPLE_TYPE_AMSN_LOG         (purple_amsn_log_get_type())
+#define PURPLE_AMSN_LOG(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), PURPLE_TYPE_AMSN_LOG, PurpleAMsnLog))
+#define PURPLE_AMSN_LOG_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), PURPLE_TYPE_AMSN_LOG, PurpleAMsnLogClass))
+#define PURPLE_IS_AMSN_LOG(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), PURPLE_TYPE_AMSN_LOG))
+#define PURPLE_IS_AMSN_LOG_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), PURPLE_TYPE_AMSN_LOG))
+#define PURPLE_AMSN_LOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), PURPLE_TYPE_AMSN_LOG, PurpleAMsnLogClass))
+
+typedef struct _PurpleAMsnLog        PurpleAMsnLog;
+typedef struct _PurpleAMsnLogClass   PurpleAMsnLogClass;
+
+struct _PurpleAMsnLog {
+	PurpleCommonLog parent_instance;
+};
+
+struct _PurpleAMsnLogClass {
+	PurpleCommonLogClass parent_class;
+};
+
+GType purple_amsn_log_get_type(void);
+// PurpleLog *purple_amsn_log_new();
+
+G_END_DECLS
+
+#endif /* _LOG_READER_H_ */


More information about the Commits mailing list