cpw.nader.asynclogging-3: 1c270848: Cleaned up log.h a bit more, added line ...

morshed.nader at gmail.com morshed.nader at gmail.com
Fri Mar 18 00:46:27 EDT 2011


----------------------------------------------------------------------
Revision: 1c270848b4795b63e72d410c85bde8dedae44ec5
Parent:   6b2a603fafaa73f86489bfb7962e7c54d736e2e0
Author:   morshed.nader at gmail.com
Date:     03/18/11 00:40:58
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/1c270848b4795b63e72d410c85bde8dedae44ec5

Changelog: 

Cleaned up log.h a bit more, added line breaks to long lines, and started completing some of the missing docs

Changes against parent 6b2a603fafaa73f86489bfb7962e7c54d736e2e0

  patched  libpurple/log.h

-------------- next part --------------
============================================================
--- libpurple/log.h	09bbc7f1d34318ecfe37bd474ba9792bc7f7d73e
+++ libpurple/log.h	89fd9b660ba0d39e502bdb2612bc61656d763cb8
@@ -137,7 +137,8 @@ struct _PurpleLogClass {
 		PurpleLogReadFlags *flags, GError **error);
 
 	/** Gets the size of a log */
-	gssize (* size_fn) (PurpleLog *log, GCancellable *cancellable, GError **error);
+	gssize (* size_fn) (PurpleLog *log, GCancellable *cancellable,
+		GError **error);
 
 	/** Asynchronously gets the size of a log */
 	void (* size_async) (PurpleLog *log, gint io_priority,
@@ -195,7 +196,8 @@ struct _PurpleLogClass {
 	 *
 	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	GList * (* list_syslog_finish) (PurpleLog *log, GAsyncResult *res, GError **error);
+	GList * (* list_syslog_finish) (PurpleLog *log, GAsyncResult *res,
+		GError **error);
 
 	/**
 	 * Gets the total size for all available logs
@@ -223,16 +225,18 @@ struct _PurpleLogClass {
 	 *
 	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	gssize (* total_size_finish) (PurpleLog *log, GAsyncResult *res, GError **error);
+	gssize (* total_size_finish) (PurpleLog *log, GAsyncResult *res,
+		GError **error);
 
-	/** Adds #PurpleLogSet<!-- -->s to a #GHashTable. By passing the data in the #PurpleLogSet<!-- -->s
-	 *  to list, the caller can get every available PurpleLog from the logger.
-	 *  Loggers using purple_log_common_writer() (or otherwise storing their
-	 *  logs in the same directory structure as the stock loggers) do not
-	 *  need to implement this function.
+	/** Adds #PurpleLogSet<!-- -->s to a #GHashTable. By passing the data in the
+	 *  #PurpleLogSet<!-- -->s to list, the caller can get every available
+	 *  #PurpleLog from the logger. Loggers using purple_log_common_writer()
+	 *  (or otherwise storing their logs in the same directory structure as the
+	 *  stock loggers) do not need to implement this function.
 	 *
 	 *  Loggers which implement this function must create a #PurpleLogSet,
-	 *  then call @a cb with @a sets and the newly created #PurpleLogSet. */
+	 *  then call @a cb with @a sets and the newly created #PurpleLogSet.
+	 */
 	GHashTable * (* get_log_sets_fn) (PurpleLog *log, GCancellable *cancellable,
 		GError **error);
 
@@ -255,7 +259,8 @@ struct _PurpleLogClass {
 		gpointer user_data);
 
 	/** Finishes an asynchronously remove operation */
-	gboolean (* remove_finish) (PurpleLog *log, GAsyncResult *res, GError **error);
+	gboolean (* remove_finish) (PurpleLog *log, GAsyncResult *res,
+		GError **error);
 
 	void (*_purple_reserved1)(void);
 	void (*_purple_reserved2)(void);
@@ -323,25 +328,68 @@ GType purple_log_get_type(void);
  *
  * @return             The new log
  */
-PurpleLog *purple_log_new(GType log_type, PurpleLogChatType chat_type, const gchar *name, PurpleAccount *account, PurpleConversation *conv, time_t time, const struct tm *tm);
+PurpleLog *purple_log_new(GType log_type, PurpleLogChatType chat_type,
+	const gchar *name, PurpleAccount *account, PurpleConversation *conv,
+	time_t time, const struct tm *tm);
 
-//
+/**
+ * Returns the chat type property of the log, indicating whether it is came
+ * from the system, an individual conversation, or a group chat.
+ *
+ * @param log          The log to get the property from
+ *
+ * @return             The log's chat type
+ */
 PurpleLogChatType purple_log_get_chat_type(const PurpleLog *log);
-//
+
+/**
+ * Returns the name of the log's conversation (buddy name, chat name, etc.)
+ *
+ * @param log          The log to get the property from
+ *
+ * @return             The log's name
+ */
 G_CONST_RETURN gchar *purple_log_get_name(const PurpleLog *log);
-//
+
+/**
+ * Returns the #PurpleAccount associated with the log
+ *
+ * @param log          The log to get the property from
+ *
+ * @return             The log's account
+ */
 PurpleAccount *purple_log_get_account(const PurpleLog *log);
-//
+
+/**
+ * Returns the time this log started, converted to the local timezone
+ *
+ * @param log          The log to get the property from
+ *
+ * @return             The time the log was started, in local time
+ */
 time_t purple_log_get_time(const PurpleLog *log);
-//
+
+/**
+ * Returns the conversation being logged
+ *
+ * @param log          The log to get the property from
+ *
+ * @return             The log's conversation
+ */
 PurpleConversation *purple_log_get_conversation(const PurpleLog *log);
-//
+
+/**
+ * Returns the time this log started
+ *
+ * @param log          The log to get the property from
+ *
+ * @return             The time this conversation started
+ */
 G_CONST_RETURN struct tm *purple_log_get_tm(const PurpleLog *log);
-//
+
+
 gchar *_log_get_timestamp(PurpleLog *log, time_t when);
-//
 gchar *_convert_image_tags(const PurpleLog *log, const gchar *msg);
-//
 gchar *_process_txt_log(gchar *, gchar *);
 
 
@@ -357,7 +405,9 @@ gchar *_process_txt_log(gchar *, gchar *
  * @param cancellable  (allow-none): #GCancellable object
  * @param error        (out) (allow-none): a #GError location to store the error
  */
-gssize purple_log_write(PurpleLog *log, PurpleMessageFlags type, const gchar *from, time_t time, const gchar *message, GCancellable *cancellable, GError **error);
+gssize purple_log_write(PurpleLog *log, PurpleMessageFlags type,
+	const gchar *from, time_t time, const gchar *message,
+	GCancellable *cancellable, GError **error);
 
 /**
  * Writes to a log file asychronously. Assumes you have checked preferences already.
@@ -374,7 +424,9 @@ gssize purple_log_write(PurpleLog *log, 
  *
  * @since 2.8.0
  */
-void purple_log_write_async(PurpleLog *log, PurpleMessageFlags type, const gchar *from, time_t time, const gchar *message, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_write_async(PurpleLog *log, PurpleMessageFlags type,
+	const gchar *from, time_t time, const gchar *message, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
 
 /**
  * Finishing asynchronously writing to a log
@@ -387,7 +439,8 @@ void purple_log_write_async(PurpleLog *l
  *
  * @since 2.8.0
  */
-gssize purple_log_write_finish(PurpleLog *log, GAsyncResult *res, GError **error);
+gssize purple_log_write_finish(PurpleLog *log, GAsyncResult *res,
+	GError **error);
 
 /**
  * Reads from a log
@@ -400,7 +453,8 @@ gssize purple_log_write_finish(PurpleLog
  * @return             The contents of this log in Purple Markup
  */
 // NOTE: Error does not have HTML formatting applied
-gchar *purple_log_read(PurpleLog *log, PurpleLogReadFlags *flags, GCancellable *cancellable, GError **error);
+gchar *purple_log_read(PurpleLog *log, PurpleLogReadFlags *flags,
+	GCancellable *cancellable, GError **error);
 
 /**
  * Reads from a log asynchronously
@@ -413,7 +467,8 @@ gchar *purple_log_read(PurpleLog *log, P
  *
  * @since 2.8.0
  */
-void purple_log_read_async(PurpleLog *log, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_read_async(PurpleLog *log, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
 
 /**
  * Finishes asynchronously reading a log
@@ -429,7 +484,8 @@ void purple_log_read_async(PurpleLog *lo
  *
  * @since 2.8.0
  */
-gchar *purple_log_read_finish(PurpleLog *log, GAsyncResult *res, PurpleLogReadFlags *flags, GError **error);
+gchar *purple_log_read_finish(PurpleLog *log, GAsyncResult *res,
+	PurpleLogReadFlags *flags, GError **error);
 
 /**
  * Returns the size of a log
@@ -438,7 +494,8 @@ gchar *purple_log_read_finish(PurpleLog 
  *
  * @return             The size of the log, in bytes
  */
-gssize purple_log_get_size(PurpleLog *log, GCancellable *cancellable, GError **error);
+gssize purple_log_get_size(PurpleLog *log, GCancellable *cancellable,
+	GError **error);
 
 /**
  * Asychronously gets the size of a log
@@ -451,7 +508,8 @@ gssize purple_log_get_size(PurpleLog *lo
  *
  * @since 2.8.0
  */
-void purple_log_get_size_async(PurpleLog *log, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_get_size_async(PurpleLog *log, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
 
 /**
  * Finishes asynchronously getting the size of a log
@@ -464,7 +522,8 @@ void purple_log_get_size_async(PurpleLog
  *
  * @since 2.8.0
  */
-gssize purple_log_get_size_finish(PurpleLog *log, GAsyncResult *res, GError **error);
+gssize purple_log_get_size_finish(PurpleLog *log, GAsyncResult *res,
+	GError **error);
 
 /**
  * Returns a list of all available logs
@@ -475,7 +534,9 @@ gssize purple_log_get_size_finish(Purple
  *
  * @return             A sorted list of #PurpleLog<!-- -->s
  */
-GList *purple_log_get_logs(PurpleLog *log, PurpleLogChatType type, const gchar *name, PurpleAccount *account, GCancellable *cancellable, GError **error);
+GList *purple_log_get_logs(PurpleLog *log, PurpleLogChatType type,
+	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
+	GError **error);
 
 /**
  * Asynchronously gets a list of all available logs
@@ -490,7 +551,9 @@ GList *purple_log_get_logs(PurpleLog *lo
  *
  * @since 2.8.0
  */
-void purple_log_get_logs_async(PurpleLog *log, PurpleLogChatType type, const gchar *name, PurpleAccount *account, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_get_logs_async(PurpleLog *log, PurpleLogChatType type,
+	const gchar *name, PurpleAccount *account, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
 
 /**
  * Finishes asynchronously getting a list of all available logs
@@ -505,13 +568,17 @@ void purple_log_get_logs_async(PurpleLog
  *
  * @since 2.8.0
  */
-GList *purple_log_get_logs_finish(PurpleLog *log, GAsyncResult *res, GError **error);
+GList *purple_log_get_logs_finish(PurpleLog *log, GAsyncResult *res,
+	GError **error);
 
 
 //
-GList *purple_logs_get_logs(PurpleLogChatType type, const gchar *name, PurpleAccount *account, GCancellable *cancellable, GError **error);
+GList *purple_logs_get_logs(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account, GCancellable *cancellable, GError **error);
 //
-void purple_logs_get_logs_async(PurpleLogChatType type, const gchar *name, PurpleAccount *account, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_logs_get_logs_async(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account, gint io_priority, GCancellable *cancellable,
+	GAsyncReadyCallback cb, gpointer userdata);
 //
 GList *purple_logs_get_logs_finish(GAsyncResult *res, GError **error);
 
@@ -522,7 +589,8 @@ GList *purple_logs_get_logs_finish(GAsyn
  *
  * @return             A sorted list of #PurpleLog<!-- -->s
  */
-GList *purple_log_get_system_logs(PurpleLog *log, PurpleAccount *account, GCancellable *cancellable, GError **error);
+GList *purple_log_get_system_logs(PurpleLog *log, PurpleAccount *account,
+	GCancellable *cancellable, GError **error);
 
 /**
  * Asychronously gets a list of all available system logs
@@ -535,7 +603,9 @@ GList *purple_log_get_system_logs(Purple
  *
  * @since 2.8.0
  */
-void purple_log_get_system_logs_async(PurpleLog *log, PurpleAccount *account, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_get_system_logs_async(PurpleLog *log, PurpleAccount *account,
+	gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb,
+	gpointer userdata);
 
 /**
  * Finishes asychronously getting a list of all available system logs
@@ -550,12 +620,16 @@ void purple_log_get_system_logs_async(Pu
  *
  * @since 2.8.0
  */
-GList *purple_log_get_system_logs_finish(PurpleLog *log, GAsyncResult *res, GError **error);
+GList *purple_log_get_system_logs_finish(PurpleLog *log, GAsyncResult *res,
+	GError **error);
 
 //
-GList *purple_logs_get_system_logs(PurpleAccount *account, GCancellable *cancellable, GError **error);
+GList *purple_logs_get_system_logs(PurpleAccount *account,
+	GCancellable *cancellable, GError **error);
 //
-void purple_logs_get_system_logs_async(PurpleAccount *account, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_logs_get_system_logs_async(PurpleAccount *account,
+	gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb,
+	gpointer userdata);
 //
 GList *purple_logs_get_system_logs_finish(GAsyncResult *res, GError **error);
 
@@ -568,7 +642,9 @@ GList *purple_logs_get_system_logs_finis
  *
  * @return             The size in bytes
  */
-gssize purple_log_get_total_size(PurpleLog *log, PurpleLogChatType type, const gchar *name, PurpleAccount *account, GCancellable *cancellable, GError **error);
+gssize purple_log_get_total_size(PurpleLog *log, PurpleLogChatType type,
+	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
+	GError **error);
 
 /**
  * Asychronously gets the size, in bytes, of all available logs in this conversation
@@ -583,7 +659,10 @@ gssize purple_log_get_total_size(PurpleL
  *
  * @since 2.8.0
  */
-void purple_log_get_total_size_async(PurpleLog *log, PurpleLogChatType type, const gchar *name, PurpleAccount *account,  gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_get_total_size_async(PurpleLog *log, PurpleLogChatType type,
+	const gchar *name, PurpleAccount *account,  gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+
 /**
  * Finishes asynchronously getting the total size of a conversation
  *
@@ -594,14 +673,19 @@ void purple_log_get_total_size_async(Pur
  *
  * @since 2.8.0
  */
-gssize purple_log_get_total_size_finish(PurpleLog *log, GAsyncResult *res, GError **error);
+gssize purple_log_get_total_size_finish(PurpleLog *log, GAsyncResult *res,
+	GError **error);
 
+//
+gssize purple_logs_get_total_size(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account, GCancellable *cancellable, GError **error);
 
 //
-gssize purple_logs_get_total_size(PurpleLogChatType type, const gchar *name, PurpleAccount *account, GCancellable *cancellable, GError **error);
+void purple_logs_get_total_size_async(PurpleLogChatType type,
+	const gchar *name, PurpleAccount *account,  gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+
 //
-void purple_logs_get_total_size_async(PurpleLogChatType type, const gchar *name, PurpleAccount *account,  gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
-//
 gssize purple_logs_get_total_size_finish(GAsyncResult *res, GError **error);
 
 /**
@@ -620,7 +704,8 @@ gssize purple_logs_get_total_size_finish
  *
  * @return             A GHashTable of all available unique #PurpleLogSet<!-- -->s
  */
-GHashTable *purple_log_get_log_sets(PurpleLog *, GCancellable *cancellable, GError **error);
+GHashTable *purple_log_get_log_sets(PurpleLog *, GCancellable *cancellable,
+	GError **error);
 
 /**
  * Asychronously gets a #GHashTable of #PurpleLogSet<!-- -->s.
@@ -635,7 +720,8 @@ GHashTable *purple_log_get_log_sets(Purp
  *
  * @since 2.8.0
  */
-void purple_log_get_log_sets_async(PurpleLog *log, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_get_log_sets_async(PurpleLog *log, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
 
 /**
  * Finishes asynchronously getting a hash table of log sets
@@ -647,12 +733,17 @@ void purple_log_get_log_sets_async(Purpl
  *
  * @since 2.8.0
  */
-GHashTable *purple_log_get_log_sets_finish(PurpleLog *log, GAsyncResult *res, GError **error);
+GHashTable *purple_log_get_log_sets_finish(PurpleLog *log, GAsyncResult *res,
+	GError **error);
 
 //
-GHashTable *purple_logs_get_log_sets(GCancellable *cancellable, GError **error);
+GHashTable *purple_logs_get_log_sets(GCancellable *cancellable,
+	GError **error);
+
 //
-void purple_logs_get_log_sets_async(gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_logs_get_log_sets_async(gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+
 //
 GHashTable *purple_logs_get_log_sets_finish(GAsyncResult *res, GError **error);
 
@@ -668,7 +759,8 @@ GHashTable *purple_logs_get_log_sets_fin
  *
  * @since 2.6.0
  */
-gssize purple_log_get_activity_score(PurpleLogChatType type, const gchar *name, PurpleAccount *account, GCancellable *cancellable, GError **error);
+gssize purple_log_get_activity_score(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account, GCancellable *cancellable, GError **error);
 
 /**
  * Asychronously gets the activity score of a log
@@ -683,7 +775,9 @@ gssize purple_log_get_activity_score(Pur
  *
  * @since 2.8.0
  */
-void purple_log_get_activity_score_async(PurpleLogChatType type, const gchar *name, PurpleAccount *account, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_get_activity_score_async(PurpleLogChatType type,
+	const gchar *name, PurpleAccount *account, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
 
 /**
  * Finishes asynchronously getting the activity score of a log
@@ -717,7 +811,8 @@ gboolean purple_log_is_removable(PurpleL
  *
  * @return             %TRUE if the log was removed, %FALSE otherwise
  */
-gboolean purple_log_remove(PurpleLog *log, GCancellable *cancellable, GError **error);
+gboolean purple_log_remove(PurpleLog *log, GCancellable *cancellable,
+	GError **error);
 
 /**
  * Asychronously removes a log
@@ -730,7 +825,8 @@ gboolean purple_log_remove(PurpleLog *lo
  *
  * @since 2.8.0
  */
-void purple_log_remove_async(PurpleLog *log, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+void purple_log_remove_async(PurpleLog *log, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
 
 /**
  * Finishes asynchronously deleting a log
@@ -743,7 +839,8 @@ void purple_log_remove_async(PurpleLog *
  *
  * @since 2.8.0
  */
-gboolean purple_log_remove_finish(PurpleLog *log, GAsyncResult *res, GError **error);
+gboolean purple_log_remove_finish(PurpleLog *log, GAsyncResult *res,
+	GError **error);
 
 /**
  * Returns the default logger directory Purple uses for a given account
@@ -756,10 +853,12 @@ gboolean purple_log_remove_finish(Purple
  *
  * @return             The default logger directory for Purple
  */
-gchar *purple_log_get_log_dir(PurpleLogChatType type, const gchar *name, PurpleAccount *account);
+gchar *purple_log_get_log_dir(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account);
 
 //
 GList *purple_log_list_copy(GList *list);
+
 //
 void purple_log_list_free(GList *list);
 
@@ -775,8 +874,10 @@ guint _purple_log_set_hash(gconstpointer
 
 //
 guint _purple_log_set_hash(gconstpointer key);
+
 //
 gboolean _purple_log_set_equal(gconstpointer a, gconstpointer b);
+
 //
 void _purple_log_add_log_set_to_hash(GHashTable *sets, PurpleLogSet *set);
 


More information about the Commits mailing list