[Tomoe-cvs 1041] CVS update: tomoe/lib

Zurück zum Archiv-Index

Takuro Ashie makei****@users*****
2006年 11月 26日 (日) 10:20:30 JST


Index: tomoe/lib/tomoe-dict.c
diff -u tomoe/lib/tomoe-dict.c:1.77 tomoe/lib/tomoe-dict.c:1.78
--- tomoe/lib/tomoe-dict.c:1.77	Sun Nov 26 10:04:57 2006
+++ tomoe/lib/tomoe-dict.c	Sun Nov 26 10:20:30 2006
@@ -21,7 +21,7 @@
  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  *  Boston, MA  02111-1307  USA
  *
- *  $Id: tomoe-dict.c,v 1.77 2006/11/26 01:04:57 makeinu Exp $
+ *  $Id: tomoe-dict.c,v 1.78 2006/11/26 01:20:30 makeinu Exp $
  */
 
 #include <stdio.h>
@@ -785,19 +785,29 @@
     return TRUE;
 }
 
-#warning FIXME: implement
-#if 0
 static void
 _write_meta_datum (gpointer key, gpointer value, gpointer user_data)
 {
+    FILE *f = user_data;
+    gchar buf[1024];
+
+    g_markup_printf_escaped (buf, G_N_ELEMENTS (buf), "<%s>%s</%s>\n",
+                             (gchar*)key, (gchar*)value, (gchar*)key);
+    fwrite (buf, strlen (buf), 1, f);
 }
 
 static gboolean
 _write_meta_data (TomoeChar *chr, FILE *f)
 {
+    const gchar *tag1 = "    <meta>\n";
+    const gchar *tag2 = "    </meta>\n";
+
+    if (fwrite (tag1, strlen (tag1), 1, f) < 1) return FALSE;
     tomoe_char_meta_data_foreach (chr, _write_meta_datum, f);
+    if (fwrite (tag2, strlen (tag2), 1, f) < 1) return FALSE;
+
+    return TRUE;
 }
-#endif
 
 static gboolean
 _write_character (TomoeChar *chr, FILE *f)
@@ -822,10 +832,10 @@
         if (!_write_writing (chr, f)) return FALSE;
 
     /* meta */
-    /*
-    if (tomoe_char_has_meta_data ())
+#if 0
+    if (tomoe_char_has_meta_data (chr))
+#endif
         if (!write_meta_data (chr, f)) return FALSE;
-    */
 
     /* close character element */
     g_snprintf (buf, G_N_ELEMENTS (buf), "  </character>\n");


tomoe-cvs メーリングリストの案内
Zurück zum Archiv-Index