/soc/2013/ankitkv/gobjectification: 28ac3a0418f1: Renamed Purple...

Ankit Vani a at nevitus.org
Sun Jul 21 12:32:22 EDT 2013


Changeset: 28ac3a0418f1a5da174a589d025b0b0052d2fd93
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-21 22:02 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/28ac3a0418f1

Description:

Renamed PurpleStatusAttr to PurpleStatusAttribute for simplicity.
purple_status_attr_* functions are now purple_status_attribute_*

diffstat:

 libpurple/account.c                     |  12 +++---
 libpurple/plugins/perl/common/Status.xs |  12 +++---
 libpurple/plugins/perl/common/module.h  |   2 +-
 libpurple/plugins/tcl/tcl_cmds.c        |  16 ++++----
 libpurple/status.c                      |  64 ++++++++++++++++----------------
 libpurple/status.h                      |  22 +++++-----
 6 files changed, 64 insertions(+), 64 deletions(-)

diffs (truncated from 444 to 300 lines):

diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -2426,18 +2426,18 @@ purple_account_clear_current_error(Purpl
 }
 
 static xmlnode *
-status_attr_to_xmlnode(const PurpleStatus *status, const PurpleStatusType *type,
-		const PurpleStatusAttr *attr)
+status_attribute_to_xmlnode(const PurpleStatus *status, const PurpleStatusType *type,
+		const PurpleStatusAttribute *attr)
 {
 	xmlnode *node;
 	const char *id;
 	char *value = NULL;
-	PurpleStatusAttr *default_attr;
+	PurpleStatusAttribute *default_attr;
 	GValue *default_value;
 	GType attr_type;
 	GValue *attr_value;
 
-	id = purple_status_attr_get_id(attr);
+	id = purple_status_attribute_get_id(attr);
 	g_return_val_if_fail(id, NULL);
 
 	attr_value = purple_status_get_attr_value(status, id);
@@ -2449,7 +2449,7 @@ status_attr_to_xmlnode(const PurpleStatu
 	 * then don't write it to the file.
 	 */
 	default_attr = purple_status_type_get_attr(type, id);
-	default_value = purple_status_attr_get_value(default_attr);
+	default_value = purple_status_attribute_get_value(default_attr);
 	if (attr_type != G_VALUE_TYPE(default_value))
 		return NULL;
 
@@ -2509,7 +2509,7 @@ status_attrs_to_xmlnode(const PurpleStat
 	attrs = purple_status_type_get_attrs(type);
 	for (attr = attrs; attr != NULL; attr = attr->next)
 	{
-		child = status_attr_to_xmlnode(status, type, (const PurpleStatusAttr *)attr->data);
+		child = status_attribute_to_xmlnode(status, type, (const PurpleStatusAttribute *)attr->data);
 		if (child)
 			xmlnode_insert_child(node, child);
 	}
diff --git a/libpurple/plugins/perl/common/Status.xs b/libpurple/plugins/perl/common/Status.xs
--- a/libpurple/plugins/perl/common/Status.xs
+++ b/libpurple/plugins/perl/common/Status.xs
@@ -75,27 +75,27 @@ Purple::StatusPrimitive
 purple_primitive_get_type_from_id(id)
 	const char *id
 
-MODULE = Purple::Status  PACKAGE = Purple::StatusAttr PREFIX = purple_status_attr_
+MODULE = Purple::Status  PACKAGE = Purple::StatusAttr PREFIX = purple_status_attribute_
 PROTOTYPES: ENABLE
 
 void
-purple_status_attr_destroy(attr)
+purple_status_attribute_destroy(attr)
 	Purple::StatusAttr attr
 
 const char *
-purple_status_attr_get_id(attr)
+purple_status_attribute_get_id(attr)
 	Purple::StatusAttr attr
 
 const char *
-purple_status_attr_get_name(attr)
+purple_status_attribute_get_name(attr)
 	Purple::StatusAttr attr
 
 GValue *
-purple_status_attr_get_value(attr)
+purple_status_attribute_get_value(attr)
 	Purple::StatusAttr attr
 
 Purple::StatusAttr
-purple_status_attr_new(id, name, value_type)
+purple_status_attribute_new(id, name, value_type)
 	const char *id
 	const char *name
 	GValue *value_type
diff --git a/libpurple/plugins/perl/common/module.h b/libpurple/plugins/perl/common/module.h
--- a/libpurple/plugins/perl/common/module.h
+++ b/libpurple/plugins/perl/common/module.h
@@ -271,7 +271,7 @@ typedef PurpleSslOps *			Purple__Ssl__Op
 
 /* status.h */
 typedef PurpleStatus *			Purple__Status;
-typedef PurpleStatusAttr *		Purple__StatusAttr;
+typedef PurpleStatusAttribute *		Purple__StatusAttr;
 typedef PurpleStatusPrimitive		Purple__StatusPrimitive;
 typedef PurpleStatusType *		Purple__StatusType;
 
diff --git a/libpurple/plugins/tcl/tcl_cmds.c b/libpurple/plugins/tcl/tcl_cmds.c
--- a/libpurple/plugins/tcl/tcl_cmds.c
+++ b/libpurple/plugins/tcl/tcl_cmds.c
@@ -1471,7 +1471,7 @@ int tcl_cmd_signal(ClientData unused, Tc
 int tcl_cmd_status(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
 	const char *cmds[] = { "attr", "type", NULL };
-	enum { CMD_STATUS_ATTR, CMD_STATUS_TYPE } cmd;
+	enum { CMD_STATUS_ATTRIBUTE, CMD_STATUS_TYPE } cmd;
 	PurpleStatus *status;
 	PurpleStatusType *status_type;
 	int error;
@@ -1491,7 +1491,7 @@ int tcl_cmd_status(ClientData unused, Tc
 		return error;
 
 	switch (cmd) {
-	case CMD_STATUS_ATTR:
+	case CMD_STATUS_ATTRIBUTE:
 # if (0)
 /* #if !(defined PURPLE_DISABLE_DEPRECATED) */
 		if (objc != 4 && objc != 5) {
@@ -1560,8 +1560,8 @@ int tcl_cmd_status(ClientData unused, Tc
 int tcl_cmd_status_attr(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
 	const char *cmds[] = { "id", "name", NULL };
-	enum { CMD_STATUS_ATTR_ID, CMD_STATUS_ATTR_NAME } cmd;
-	PurpleStatusAttr *attr;
+	enum { CMD_STATUS_ATTRIBUTE_ID, CMD_STATUS_ATTRIBUTE_NAME } cmd;
+	PurpleStatusAttribute *attr;
 	int error;
 
 	if (objc < 2) {
@@ -1573,7 +1573,7 @@ int tcl_cmd_status_attr(ClientData unuse
 		return error;
 
 	switch (cmd) {
-	case CMD_STATUS_ATTR_ID:
+	case CMD_STATUS_ATTRIBUTE_ID:
 		if (objc != 3) {
 			Tcl_WrongNumArgs(interp, 2, objv, "attr");
 			return TCL_ERROR;
@@ -1581,9 +1581,9 @@ int tcl_cmd_status_attr(ClientData unuse
 		if ((attr = purple_tcl_ref_get(interp, objv[2], PurpleTclRefStatusAttr)) == NULL)
 			return TCL_ERROR;
 		Tcl_SetObjResult(interp,
-				 Tcl_NewStringObj(purple_status_attr_get_id(attr), -1));
+				 Tcl_NewStringObj(purple_status_attribute_get_id(attr), -1));
 		break;
-	case CMD_STATUS_ATTR_NAME:
+	case CMD_STATUS_ATTRIBUTE_NAME:
 		if (objc != 3) {
 			Tcl_WrongNumArgs(interp, 2, objv, "attr");
 			return TCL_ERROR;
@@ -1591,7 +1591,7 @@ int tcl_cmd_status_attr(ClientData unuse
 		if ((attr = purple_tcl_ref_get(interp, objv[2], PurpleTclRefStatusAttr)) == NULL)
 			return TCL_ERROR;
 		Tcl_SetObjResult(interp,
-				 Tcl_NewStringObj(purple_status_attr_get_name(attr), -1));
+				 Tcl_NewStringObj(purple_status_attribute_get_name(attr), -1));
 		break;
 	}
 
diff --git a/libpurple/status.c b/libpurple/status.c
--- a/libpurple/status.c
+++ b/libpurple/status.c
@@ -53,7 +53,7 @@ struct _PurpleStatusType
 /**
  * A status attribute.
  */
-struct _PurpleStatusAttr
+struct _PurpleStatusAttribute
 {
 	char *id;
 	char *name;
@@ -241,14 +241,14 @@ static void
 status_type_add_attr(PurpleStatusType *status_type, const char *id,
 		const char *name, GValue *value)
 {
-	PurpleStatusAttr *attr;
+	PurpleStatusAttribute *attr;
 
 	g_return_if_fail(status_type != NULL);
 	g_return_if_fail(id          != NULL);
 	g_return_if_fail(name        != NULL);
 	g_return_if_fail(value       != NULL);
 
-	attr = purple_status_attr_new(id, name, value);
+	attr = purple_status_attribute_new(id, name, value);
 
 	status_type->attrs = g_list_append(status_type->attrs, attr);
 }
@@ -310,7 +310,7 @@ purple_status_type_destroy(PurpleStatusT
 	g_free(status_type->id);
 	g_free(status_type->name);
 
-	g_list_foreach(status_type->attrs, (GFunc)purple_status_attr_destroy, NULL);
+	g_list_foreach(status_type->attrs, (GFunc)purple_status_attribute_destroy, NULL);
 	g_list_free(status_type->attrs);
 
 	PURPLE_DBUS_UNREGISTER_POINTER(status_type);
@@ -385,7 +385,7 @@ purple_status_type_is_available(const Pu
 	return (primitive == PURPLE_STATUS_AVAILABLE);
 }
 
-PurpleStatusAttr *
+PurpleStatusAttribute *
 purple_status_type_get_attr(const PurpleStatusType *status_type, const char *id)
 {
 	GList *l;
@@ -395,9 +395,9 @@ purple_status_type_get_attr(const Purple
 
 	for (l = status_type->attrs; l != NULL; l = l->next)
 	{
-		PurpleStatusAttr *attr = (PurpleStatusAttr *)l->data;
+		PurpleStatusAttribute *attr = (PurpleStatusAttribute *)l->data;
 
-		if (purple_strequal(purple_status_attr_get_id(attr), id))
+		if (purple_strequal(purple_status_attribute_get_id(attr), id))
 			return attr;
 	}
 
@@ -434,19 +434,19 @@ purple_status_type_find_with_id(GList *s
 
 
 /**************************************************************************
-* PurpleStatusAttr API
+* PurpleStatusAttribute API
 **************************************************************************/
-PurpleStatusAttr *
-purple_status_attr_new(const char *id, const char *name, GValue *value_type)
+PurpleStatusAttribute *
+purple_status_attribute_new(const char *id, const char *name, GValue *value_type)
 {
-	PurpleStatusAttr *attr;
+	PurpleStatusAttribute *attr;
 
 	g_return_val_if_fail(id         != NULL, NULL);
 	g_return_val_if_fail(name       != NULL, NULL);
 	g_return_val_if_fail(value_type != NULL, NULL);
 
-	attr = g_new0(PurpleStatusAttr, 1);
-	PURPLE_DBUS_REGISTER_POINTER(attr, PurpleStatusAttr);
+	attr = g_new0(PurpleStatusAttribute, 1);
+	PURPLE_DBUS_REGISTER_POINTER(attr, PurpleStatusAttribute);
 
 	attr->id         = g_strdup(id);
 	attr->name       = g_strdup(name);
@@ -456,7 +456,7 @@ purple_status_attr_new(const char *id, c
 }
 
 void
-purple_status_attr_destroy(PurpleStatusAttr *attr)
+purple_status_attribute_destroy(PurpleStatusAttribute *attr)
 {
 	g_return_if_fail(attr != NULL);
 
@@ -470,7 +470,7 @@ purple_status_attr_destroy(PurpleStatusA
 }
 
 const char *
-purple_status_attr_get_id(const PurpleStatusAttr *attr)
+purple_status_attribute_get_id(const PurpleStatusAttribute *attr)
 {
 	g_return_val_if_fail(attr != NULL, NULL);
 
@@ -478,7 +478,7 @@ purple_status_attr_get_id(const PurpleSt
 }
 
 const char *
-purple_status_attr_get_name(const PurpleStatusAttr *attr)
+purple_status_attribute_get_name(const PurpleStatusAttribute *attr)
 {
 	g_return_val_if_fail(attr != NULL, NULL);
 
@@ -486,7 +486,7 @@ purple_status_attr_get_name(const Purple
 }
 
 GValue *
-purple_status_attr_get_value(const PurpleStatusAttr *attr)
+purple_status_attribute_get_value(const PurpleStatusAttribute *attr)
 {
 	g_return_val_if_fail(attr != NULL, NULL);
 
@@ -777,14 +777,14 @@ purple_status_set_active_with_attrs_list
 	status_type = purple_status_get_status_type(status);
 	l = purple_status_type_get_attrs(status_type);
 	while (l != NULL) {
-		PurpleStatusAttr *attr;
+		PurpleStatusAttribute *attr;
 
 		attr = l->data;
 		l = l->next;
 
 		if (!g_list_find_custom(specified_attr_ids, attr->id, (GCompareFunc)strcmp)) {
 			GValue *default_value;
-			default_value = purple_status_attr_get_value(attr);
+			default_value = purple_status_attribute_get_value(attr);
 			if (G_VALUE_TYPE(default_value) == G_TYPE_STRING) {
 				const char *cur = purple_status_get_attr_string(status, attr->id);
 				const char *def = g_value_get_string(default_value);
@@ -1015,9 +1015,9 @@ purple_status_type_copy(PurpleStatusType
 	                                               status_type->independent);
 
 	for (l = status_type->attrs; l != NULL; l = l->next) {
-		PurpleStatusAttr *new_attr, *attr = l->data;
+		PurpleStatusAttribute *new_attr, *attr = l->data;
 



More information about the Commits mailing list