[kazehakase-svn] [3250] * src/utils/kz-base64.[ch]: Removed.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Wed Oct 3 11:49:33 JST 2007


Revision: 3250
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3250
Author:   ikezoe
Date:     2007-10-03 11:49:33 +0900 (Wed, 03 Oct 2007)

Log Message:
-----------
* src/utils/kz-base64.[ch]: Removed.
* src/net/kz-http.c: Use g_base64_encode() instead of
kz_base64_encode().

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/net/kz-http.c
    kazehakase/trunk/src/utils/Makefile.am

Removed Paths:
-------------
    kazehakase/trunk/src/utils/kz-base64.c
    kazehakase/trunk/src/utils/kz-base64.h

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2007-10-03 02:39:40 UTC (rev 3249)
+++ kazehakase/trunk/ChangeLog	2007-10-03 02:49:33 UTC (rev 3250)
@@ -4,6 +4,9 @@
 	GtkNotebook itself.
 	* src/kz-window.[ch], src/kz-notebook.[ch]: Remove needless functions
 	due to the last commit.
+	* src/utils/kz-base64.[ch]: Removed.
+	* src/net/kz-http.c: Use g_base64_encode() instead of
+	kz_base64_encode().
 
 2007-09-29  Kouhei Sutou  <kou****@cozmi*****>
 

Modified: kazehakase/trunk/src/net/kz-http.c
===================================================================
--- kazehakase/trunk/src/net/kz-http.c	2007-10-03 02:39:40 UTC (rev 3249)
+++ kazehakase/trunk/src/net/kz-http.c	2007-10-03 02:49:33 UTC (rev 3250)
@@ -47,7 +47,6 @@
 #include "kz-profile.h"
 #include "kz-proxy-item.h"
 #include "kz-prompt-dialog.h"
-#include "kz-base64.h"
 #include "eggmd5.h"
 
 #define BUFFER_SIZE 256
@@ -1405,7 +1404,7 @@
 		 {
 			gchar *str, *base64;
 			str = g_strdup_printf("%s:%s", user, pass);
-			base64 = kz_base64_encode(str);
+			base64 = g_base64_encode(str);
 			ap->string = g_strdup_printf("Basic %s", base64);
 			g_free(str);
 			if (base64)

Modified: kazehakase/trunk/src/utils/Makefile.am
===================================================================
--- kazehakase/trunk/src/utils/Makefile.am	2007-10-03 02:39:40 UTC (rev 3249)
+++ kazehakase/trunk/src/utils/Makefile.am	2007-10-03 02:49:33 UTC (rev 3250)
@@ -24,7 +24,6 @@
 	glib-utils.c glib-utils.h		\
 	gtk-utils.c gtk-utils.h			\
 	gobject-utils.h				\
-	kz-base64.h kz-base64.c			\
 	kz-history-utils.h kz-history-utils.c	\
 	utils.c					\
 	$(libkzutils_public_h_sources)

Deleted: kazehakase/trunk/src/utils/kz-base64.c
===================================================================
--- kazehakase/trunk/src/utils/kz-base64.c	2007-10-03 02:39:40 UTC (rev 3249)
+++ kazehakase/trunk/src/utils/kz-base64.c	2007-10-03 02:49:33 UTC (rev 3250)
@@ -1,76 +0,0 @@
-/* public domain */
-
-/*
- * arbitrary data on stdin -> BASE64 data on stdout
- *
- * UNIX's newline convention is used, i.e. one ASCII control-j (10 decimal).
- */
-
-#include <glib.h>
-#include "kz-base64.h"
-
-unsigned char alphabet[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-gchar *
-kz_base64_encode (const gchar *input)
-{
-    int cols, bits, c, char_count, i;
-    GString *work;
-
-    char_count = 0;
-    bits = 0;
-    cols = 0;
-    i = 0;
-    work = g_string_new(NULL);
-    while (input[i] != '\0')
-    {
-	    c = input[i];
-	    if (c > 255)
-	    {
-		    g_string_free(work, TRUE);
-		    return NULL;
-	    }
-	    bits += c;
-	    char_count++;
-	    if (char_count == 3)
-	    {
-		    g_string_append_c(work, alphabet[bits >> 18]);
-		    g_string_append_c(work, alphabet[(bits >> 12) & 0x3f]);
-		    g_string_append_c(work, alphabet[(bits >> 6) & 0x3f]);
-		    g_string_append_c(work, alphabet[bits & 0x3f]);
-		    cols += 4;
-		    if (cols == 72)
-		    {
-			    g_string_append_c(work, '\n');
-			    cols = 0;
-		    }
-		    bits = 0;
-		    char_count = 0;
-	    }
-	    else 
-	    {
-		    bits <<= 8;
-	    }
-	    i++;
-    }
-    if (char_count != 0)
-    {
-	    bits <<= 16 - (8 * char_count);
-	    g_string_append_c(work, alphabet[bits >> 18]);
-	    g_string_append_c(work, alphabet[(bits >> 12) & 0x3f]);
-	    if (char_count == 1)
-	    {
-		    g_string_append_c(work, '=');
-		    g_string_append_c(work, '=');
-	    }
-	    else 
-	    {
-		    g_string_append_c(work, alphabet[(bits >> 6) & 0x3f]);
-		    g_string_append_c(work, '=');
-	    }
-	    if (cols > 0)
-		    g_string_append_c(work, '\n');
-    }
-
-    return g_string_free(work, FALSE);
-}

Deleted: kazehakase/trunk/src/utils/kz-base64.h
===================================================================
--- kazehakase/trunk/src/utils/kz-base64.h	2007-10-03 02:39:40 UTC (rev 3249)
+++ kazehakase/trunk/src/utils/kz-base64.h	2007-10-03 02:49:33 UTC (rev 3250)
@@ -1,3 +0,0 @@
-#include <glib.h>
-
-gchar *kz_base64_encode (const gchar *input);




More information about the Kazehakase-cvs mailing list
Back to archive index