/soc/2013/ankitkv/gobjectification: a665f6acdb41: Merged default...

Ankit Vani a at nevitus.org
Tue Feb 4 04:00:28 EST 2014


Changeset: a665f6acdb4132d64cec05a32bcc88df7db604a4
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-04 14:22 +0530
Branch:	 gtkdoc-conversion
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/a665f6acdb41

Description:

Merged default branch

diffstat:

 libpurple/example/defines.h                  |   23 ++++
 libpurple/example/nullclient.c               |   11 +-
 libpurple/http.c                             |   57 +++++++----
 libpurple/keyring.c                          |   30 +++--
 libpurple/plugins/keyrings/gnomekeyring.c    |   21 ++-
 libpurple/plugins/keyrings/internalkeyring.c |    6 +-
 libpurple/plugins/keyrings/kwallet.cpp       |    6 +-
 libpurple/plugins/keyrings/secretservice.c   |   83 ++++++++--------
 libpurple/plugins/keyrings/wincred.c         |    3 +-
 libpurple/protocols/gg/account.c             |   31 ++----
 libpurple/protocols/gg/avatar.c              |   34 ++----
 libpurple/protocols/gg/blist.c               |    9 +-
 libpurple/protocols/gg/chat.c                |  103 +++++++-------------
 libpurple/protocols/gg/deprecated.c          |    3 +-
 libpurple/protocols/gg/edisc.c               |    6 +-
 libpurple/protocols/gg/gg.c                  |   32 ++---
 libpurple/protocols/gg/html.c                |   12 +-
 libpurple/protocols/gg/image.c               |   46 +++-----
 libpurple/protocols/gg/libgadu-events.c      |   12 +-
 libpurple/protocols/gg/libgaduw.c            |   18 +--
 libpurple/protocols/gg/message-prpl.c        |  135 ++++++++------------------
 libpurple/protocols/gg/oauth/oauth-purple.c  |   31 ++----
 libpurple/protocols/gg/pubdir-prpl.c         |   87 +++++++----------
 libpurple/protocols/gg/purplew.c             |   17 +-
 libpurple/protocols/gg/resolver-purple.c     |   26 +---
 libpurple/protocols/gg/roster.c              |  108 +++++++--------------
 libpurple/protocols/gg/servconn.c            |    3 +-
 libpurple/protocols/gg/status.c              |   45 +++-----
 libpurple/protocols/gg/utils.c               |   21 +--
 libpurple/protocols/gg/xml.c                 |   22 +---
 30 files changed, 429 insertions(+), 612 deletions(-)

diffs (truncated from 2985 to 300 lines):

diff --git a/libpurple/example/defines.h b/libpurple/example/defines.h
--- a/libpurple/example/defines.h
+++ b/libpurple/example/defines.h
@@ -1,3 +1,26 @@
+/*
+ * pidgin
+ *
+ * Pidgin 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
+ *
+ */
+
 #define CUSTOM_USER_DIRECTORY  "/dev/null"
 #define CUSTOM_PLUGIN_PATH     ""
 #define PLUGIN_SAVE_PREF       "/purple/nullclient/plugins/saved"
diff --git a/libpurple/example/nullclient.c b/libpurple/example/nullclient.c
--- a/libpurple/example/nullclient.c
+++ b/libpurple/example/nullclient.c
@@ -64,13 +64,13 @@ static gboolean purple_glib_io_invoke(GI
 		purple_cond |= PURPLE_INPUT_WRITE;
 
 	closure->function(closure->data, g_io_channel_unix_get_fd(source),
-			  purple_cond);
+		purple_cond);
 
 	return TRUE;
 }
 
-static guint glib_input_add(gint fd, PurpleInputCondition condition, PurpleInputFunction function,
-							   gpointer data)
+static guint glib_input_add(gint fd, PurpleInputCondition condition,
+	PurpleInputFunction function, gpointer data)
 {
 	PurpleGLibIOClosure *closure = g_new0(PurpleGLibIOClosure, 1);
 	GIOChannel *channel;
@@ -89,8 +89,8 @@ static guint glib_input_add(gint fd, Pur
 #else
 	channel = g_io_channel_unix_new(fd);
 #endif
-	closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond,
-					      purple_glib_io_invoke, closure, purple_glib_io_destroy);
+	closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT,
+		cond, purple_glib_io_invoke, closure, purple_glib_io_destroy);
 
 	g_io_channel_unref(channel);
 	return closure->result;
@@ -315,4 +315,3 @@ int main(int argc, char *argv[])
 
 	return 0;
 }
-
diff --git a/libpurple/http.c b/libpurple/http.c
--- a/libpurple/http.c
+++ b/libpurple/http.c
@@ -290,8 +290,10 @@ static GHashTable *purple_http_hc_by_ptr
 
 static time_t purple_http_rfc1123_to_time(const gchar *str)
 {
-	static const gchar *months[13] = {"jan", "feb", "mar", "apr", "may", "jun",
-		"jul", "aug", "sep", "oct", "nov", "dec", NULL};
+	static const gchar *months[13] = {
+		"jan", "feb", "mar", "apr", "may", "jun",
+		"jul", "aug", "sep", "oct", "nov", "dec", NULL
+	};
 	GMatchInfo *match_info;
 	gchar *d_date, *d_month, *d_year, *d_time;
 	int month;
@@ -314,8 +316,7 @@ static time_t purple_http_rfc1123_to_tim
 	g_match_info_free(match_info);
 
 	month = 0;
-	while (months[month] != NULL)
-	{
+	while (months[month] != NULL) {
 		if (0 == g_ascii_strcasecmp(d_month, months[month]))
 			break;
 		month++;
@@ -584,8 +585,7 @@ static void purple_http_headers_remove(P
 
 	/* Could be optimized to O(1). */
 	it = g_list_first(hdrs->list);
-	while (it)
-	{
+	while (it) {
 		PurpleKeyValuePair *kvp = it->data;
 		curr = it;
 		it = g_list_next(it);
@@ -853,7 +853,8 @@ static gboolean _purple_http_recv_header
 	}
 
 	while ((eol = strstr(hc->response_buffer->str, "\r\n"))
-		!= NULL) {
+		!= NULL)
+	{
 		gchar *hdrline = hc->response_buffer->str;
 		int hdrline_len = eol - hdrline;
 
@@ -883,7 +884,8 @@ static gboolean _purple_http_recv_header
 			hc->main_header_got = TRUE;
 			delim = strchr(hdrline, ' ');
 			if (delim == NULL || 1 != sscanf(delim + 1, "%d",
-				&hc->response->code)) {
+				&hc->response->code))
+			{
 				purple_debug_warning("http",
 					"Invalid response code\n");
 				_purple_http_error(hc, _("Error parsing HTTP"));
@@ -1106,7 +1108,8 @@ static gboolean _purple_http_recv_loopbo
 			hc->length_expected = hc->length_got;
 		}
 		if (hc->length_expected >= 0 &&
-			hc->length_got < (guint)hc->length_expected) {
+			hc->length_got < (guint)hc->length_expected)
+		{
 			purple_debug_warning("http", "No more data while reading"
 				" contents\n");
 			_purple_http_error(hc, _("Error parsing HTTP"));
@@ -1158,15 +1161,15 @@ static gboolean _purple_http_recv_loopbo
 			is_deflate = purple_http_headers_match(
 				hc->response->headers, "Content-Encoding",
 				"deflate");
-			if (is_gzip || is_deflate)
-			{
+			if (is_gzip || is_deflate) {
 				hc->gz_stream = purple_http_gz_new(
 					hc->request->max_length + 1,
 					is_deflate);
 			}
 		}
 		if (hc->headers_got && hc->response_buffer &&
-			hc->response_buffer->len > 0) {
+			hc->response_buffer->len > 0)
+		{
 			int buffer_len = hc->response_buffer->len;
 			gchar *buffer = g_string_free(hc->response_buffer, FALSE);
 			hc->response_buffer = NULL;
@@ -1218,7 +1221,8 @@ static gboolean _purple_http_recv_loopbo
 
 		if (purple_debug_is_unsafe() && purple_debug_is_verbose() &&
 			!purple_http_cookie_jar_is_empty(
-				hc->request->cookie_jar)) {
+				hc->request->cookie_jar))
+		{
 			gchar *cookies = purple_http_cookie_jar_dump(
 				hc->request->cookie_jar);
 			purple_debug_misc("http", "Cookies: %s\n", cookies);
@@ -1233,7 +1237,8 @@ static gboolean _purple_http_recv_loopbo
 		redirect = purple_http_headers_get(hc->response->headers,
 			"location");
 		if (redirect && (hc->request->max_redirects == -1 ||
-			hc->request->max_redirects > hc->redirects_count)) {
+			hc->request->max_redirects > hc->redirects_count))
+		{
 			PurpleHttpURL *url = purple_http_url_parse(redirect);
 
 			hc->redirects_count++;
@@ -1291,7 +1296,8 @@ static void _purple_http_send_got_data(P
 	estimated_length = hc->request_contents_written + stored;
 
 	if (hc->request->contents_length != -1 &&
-		hc->request->contents_length != estimated_length) {
+		hc->request->contents_length != estimated_length)
+	{
 		purple_debug_warning("http",
 			"Invalid amount of data has been written\n");
 	}
@@ -1461,7 +1467,8 @@ static gboolean _purple_http_reconnect(P
 
 	url = hc->url;
 	if (g_strcmp0(url->protocol, "") == 0 ||
-		g_ascii_strcasecmp(url->protocol, "http") == 0) {
+		g_ascii_strcasecmp(url->protocol, "http") == 0)
+	{
 		/* do nothing */
 	} else if (g_ascii_strcasecmp(url->protocol, "https") == 0) {
 		is_ssl = TRUE;
@@ -1827,7 +1834,8 @@ static void purple_http_conn_notify_prog
 
 	now = g_get_monotonic_time();
 	if (hc->watcher_last_call + hc->watcher_interval_threshold
-		> now && processed != total) {
+		> now && processed != total)
+	{
 		if (hc->watcher_delayed_handle)
 			return;
 		hc->watcher_delayed_handle = purple_timeout_add_seconds(
@@ -1934,7 +1942,8 @@ static void purple_http_cookie_jar_parse
 		semicolon = strchr(cookie, ';');
 
 		if (eqsign == NULL || eqsign == cookie ||
-			(semicolon != NULL && semicolon < eqsign)) {
+			(semicolon != NULL && semicolon < eqsign))
+		{
 			if (purple_debug_is_unsafe())
 				purple_debug_warning("http",
 					"Invalid cookie: [%s]\n", cookie);
@@ -1990,7 +1999,8 @@ static gchar * purple_http_cookie_jar_ge
 
 	g_hash_table_iter_init(&it, cookie_jar->tab);
 	while (g_hash_table_iter_next(&it, (gpointer*)&key,
-		(gpointer*)&cookie)) {
+		(gpointer*)&cookie))
+	{
 		if (cookie->expires != -1 && cookie->expires <= now)
 			continue;
 		g_string_append_printf(str, "%s=%s; ", key, cookie->value);
@@ -2903,9 +2913,11 @@ purple_http_url_parse(const char *raw_ur
 		gchar *port_str;
 
 		if (!g_regex_match(purple_http_re_url_host, host_full, 0,
-			&match_info)) {
+			&match_info))
+		{
 			if (purple_debug_is_verbose() &&
-				purple_debug_is_unsafe()) {
+				purple_debug_is_unsafe())
+			{
 				purple_debug_warning("http",
 					"Invalid host provided for URL: %s\n",
 					raw_url);
@@ -3003,7 +3015,8 @@ purple_http_url_relative(PurpleHttpURL *
 
 	if (relative_url->path) {
 		if (relative_url->path[0] == '/' ||
-			base_url->path == NULL) {
+			base_url->path == NULL)
+		{
 			g_free(base_url->path);
 			base_url->path = g_strdup(relative_url->path);
 		} else {
diff --git a/libpurple/keyring.c b/libpurple/keyring.c
--- a/libpurple/keyring.c
+++ b/libpurple/keyring.c
@@ -270,7 +270,8 @@ purple_keyring_set_inuse_save_cb(PurpleA
 	if (error == NULL) {
 		/* no error */
 	} else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
-		PURPLE_KEYRING_ERROR_NOPASSWORD)) {
+		PURPLE_KEYRING_ERROR_NOPASSWORD))
+	{
 		if (purple_debug_is_verbose()) {
 			purple_debug_misc("keyring", "No password found while "
 				"changing keyring for account %s: %s.\n",
@@ -278,7 +279,8 @@ purple_keyring_set_inuse_save_cb(PurpleA
 				error->message);
 		}
 	} else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
-		PURPLE_KEYRING_ERROR_ACCESSDENIED)) {
+		PURPLE_KEYRING_ERROR_ACCESSDENIED))
+	{
 		purple_debug_info("keyring", "Access denied while changing "
 			"keyring for account %s: %s.\n",
 			purple_keyring_print_account(account), error->message);
@@ -287,7 +289,8 @@ purple_keyring_set_inuse_save_cb(PurpleA
 			g_error_free(tracker->error);
 		tracker->error = g_error_copy(error);
 	} else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
-		PURPLE_KEYRING_ERROR_CANCELLED)) {
+		PURPLE_KEYRING_ERROR_CANCELLED))
+	{
 		purple_debug_info("keyring", "Operation cancelled while "
 			"changing keyring for account %s: %s.\n",
 			purple_keyring_print_account(account), error->message);
@@ -295,7 +298,8 @@ purple_keyring_set_inuse_save_cb(PurpleA
 		if (tracker->error == NULL)
 			tracker->error = g_error_copy(error);
 	} else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
-		PURPLE_KEYRING_ERROR_BACKENDFAIL)) {
+		PURPLE_KEYRING_ERROR_BACKENDFAIL))
+	{
 		purple_debug_error("keyring", "Failed to communicate with "
 			"backend while changing keyring for account %s: %s. "
 			"Aborting changes.\n",
@@ -349,7 +353,8 @@ purple_keyring_set_inuse_read_cb(PurpleA
 	if (error != NULL) {
 		if (tracker->force == TRUE || g_error_matches(error,
 			PURPLE_KEYRING_ERROR,
-			PURPLE_KEYRING_ERROR_NOPASSWORD)) {
+			PURPLE_KEYRING_ERROR_NOPASSWORD))
+		{
 			/* Don't save password, and ignore it. */
 		} else {
 			tracker->abort = TRUE;
@@ -464,7 +469,8 @@ purple_keyring_register(PurpleKeyring *k
 	if (purple_keyring_get_id(keyring) == NULL ||



More information about the Commits mailing list