diff libpurple/status.h @ 18118:ab6d2763b8d8

Re-fix the DBus list handling code by killing const GList* / const GSList* everywhere. Now we maintain a list of functions which return a GList or GSList which must not be freed. Ideally at some point this will be replaced with code that looks at the Doxygen comment for the function and honors @constreturn, which I've declared as a macro around @return that prints a @note about not modifying or freeing the returned value.
author Richard Laager <rlaager@wiktel.com>
date Sat, 16 Jun 2007 19:44:59 +0000
parents 08b9f27cf219
children 72906c5ac037
line wrap: on
line diff
--- a/libpurple/status.h	Sat Jun 16 19:21:06 2007 +0000
+++ b/libpurple/status.h	Sat Jun 16 19:44:59 2007 +0000
@@ -387,9 +387,9 @@
  *
  * @param status_type The status type.
  *
- * @return The list of attributes.
+ * @constreturn The list of attributes.
  */
-const GList *purple_status_type_get_attrs(const PurpleStatusType *status_type);
+GList *purple_status_type_get_attrs(const PurpleStatusType *status_type);
 
 /**
  * Find the PurpleStatusType with the given id.
@@ -515,10 +515,11 @@
  * @param active The active state.
  * @param attrs  A list of attributes to set on the status.  This list is
  *               composed of key/value pairs, where each key is a valid
- *               attribute name for this PurpleStatusType.
+ *               attribute name for this PurpleStatusType.  The list is
+ *               not modified or freed by this function.
  */
 void purple_status_set_active_with_attrs_list(PurpleStatus *status, gboolean active,
-											const GList *attrs);
+											GList *attrs);
 
 /**
  * Sets the boolean value of an attribute in a status with the specified ID.
@@ -768,9 +769,10 @@
  * Adds a list of statuses to the presence.
  *
  * @param presence    The presence.
- * @param source_list The source list of statuses to add.
+ * @param source_list The source list of statuses to add, which is not
+ *                    modified or freed by this function.
  */
-void purple_presence_add_list(PurplePresence *presence, const GList *source_list);
+void purple_presence_add_list(PurplePresence *presence, GList *source_list);
 
 /**
  * Sets the active state of a status in a presence.
@@ -869,9 +871,9 @@
  *
  * @param presence The presence.
  *
- * @return The statuses.
+ * @constreturn The statuses.
  */
-const GList *purple_presence_get_statuses(const PurplePresence *presence);
+GList *purple_presence_get_statuses(const PurplePresence *presence);
 
 /**
  * Returns the status with the specified ID from a presence.