Use new scr_* functions
authorMyhailo Danylenko <isbear@ukrpost.net>
Thu, 25 Mar 2010 20:46:44 +0200
changeset 17 e26e6692b0d5
parent 16 19d13d97b3a1
child 18 887d772326a0
Use new scr_* functions
cmd.c
--- a/cmd.c	Sun Mar 14 21:36:29 2010 +0200
+++ b/cmd.c	Thu Mar 25 20:46:44 2010 +0200
@@ -45,7 +45,7 @@
 
 static module_info_t info_cmd_experimental = {
 	.branch          = "experimental",
-	.api             = 5,
+	.api             = 10,
 	.version         = PROJECT_VERSION,
 	.description     = DESCRIPTION,
 	.requires        = NULL,
@@ -56,7 +56,7 @@
 
 module_info_t info_cmd = {
 	.branch          = "dev",
-	.api             = 4,
+	.api             = 11,
 	.version         = PROJECT_VERSION,
 	.description     = DESCRIPTION,
 	.requires        = NULL,
@@ -90,7 +90,7 @@
 	xmpp_send_msg (to, body, room ? ROSTER_TYPE_ROOM : ROSTER_TYPE_USER, room ? NULL : subject, FALSE /* ? */, &crypted, LM_MESSAGE_SUB_TYPE_NOT_SET, &xep184);
 
 	if (crypted == -1) {
-		scr_LogPrint (LPRINT_LOGNORM, "cmd: Encryption error. Message not sent.");
+		scr_log_print (LPRINT_LOGNORM, "cmd: Encryption error. Message not sent.");
 		return FALSE;
 	}
 
@@ -119,7 +119,7 @@
 		chstat = g_io_channel_read_chars (channel, buf, HBB_BLOCKSIZE, &endpos, &error);
 
 		if (error) {
-			scr_LogPrint (LPRINT_DEBUG, "cmd: Reading error: %s.", error -> message);
+			scr_log_print (LPRINT_DEBUG, "cmd: Reading error: %s.", error -> message);
 			g_clear_error (&error);
 		}
 
@@ -137,7 +137,7 @@
 			g_string_append_len (input, buf, endpos);
 
 			if (!xmpp_is_online ()) {
-				scr_LogPrint (LPRINT_LOGNORM, "cmd: Connection is not ready, delaying data");
+				scr_log_print (LPRINT_LOGNORM, "cmd: Connection is not ready, delaying data");
 				return TRUE;
 			}
 
@@ -166,7 +166,7 @@
 						c = g_utf8_find_prev_char (utf8 + sent, c);
 
 						if (!c) {
-							scr_LogPrint (LPRINT_LOGNORM, "cmd: Cannot determine utf8 character end! End of data chunk will be discarded!");
+							scr_log_print (LPRINT_LOGNORM, "cmd: Cannot determine utf8 character end! End of data chunk will be discarded!");
 							break;
 						}
 
@@ -180,7 +180,7 @@
 						subject = g_strdup_printf (cb -> subject, cb -> seq);
 
 					if (!cmd_send_msg (cb->jid, subject, len ? bbuf : (utf8 + sent)))
-						scr_LogPrint (LPRINT_LOGNORM, "cmd: Encryption error. Message not sent.");
+						scr_log_print (LPRINT_LOGNORM, "cmd: Encryption error. Message not sent.");
 
 					if (subject)
 						g_free (subject);
@@ -199,7 +199,7 @@
 
 			} else {
 
-				scr_LogPrint (LPRINT_LOGNORM, "cmd: Character conversion error: %s", error->message);
+				scr_log_print (LPRINT_LOGNORM, "cmd: Character conversion error: %s", error->message);
 				g_error_free (error);
 				cb->source = 0;
 				return FALSE;
@@ -239,12 +239,12 @@
 		return;
 	
 	if (!jid) {
-		scr_LogPrint (LPRINT_LOGNORM, "Unsuitable buddy selected.");
+		scr_log_print (LPRINT_LOGNORM, "Unsuitable buddy selected.");
 		return;
 	}
 	
 	if (pipe (fd)) {
-		scr_LogPrint (LPRINT_LOGNORM, "Cannot create pipe: %s.", strerror (errno));
+		scr_log_print (LPRINT_LOGNORM, "Cannot create pipe: %s.", strerror (errno));
 		return;
 	}
 
@@ -274,7 +274,7 @@
 		}
 
 		if (res == -1) {
-			scr_LogPrint (LPRINT_NORMAL, "Cannot fork child: %s.", strerror (errno));
+			scr_log_print (LPRINT_NORMAL, "Cannot fork child: %s.", strerror (errno));
 			close (fd[0]);
 			close (fd[1]);
 			return;
@@ -289,13 +289,13 @@
 
 			g_io_channel_set_encoding (channel, NULL, &error);
 			if (error) {
-				scr_LogPrint (LPRINT_DEBUG, "cmd: Cannot unset channel encoding: %s.", error -> message);
+				scr_log_print (LPRINT_DEBUG, "cmd: Cannot unset channel encoding: %s.", error -> message);
 				g_clear_error (&error);
 			}
 			g_io_channel_set_buffered (channel, FALSE);
 			g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, &error);
 			if (error) {
-				scr_LogPrint (LPRINT_DEBUG, "cmd: Cannot set nonblocking flag on channel: %s.", error -> message);
+				scr_log_print (LPRINT_DEBUG, "cmd: Cannot set nonblocking flag on channel: %s.", error -> message);
 				g_error_free (error);
 			}
 			g_io_channel_set_close_on_unref (channel, TRUE);