cp-tools-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cp-tools-discuss] Patch: FYI: remove native2ascii


From: Tom Tromey
Subject: [Cp-tools-discuss] Patch: FYI: remove native2ascii
Date: 22 May 2006 00:05:07 -0600

I moved native2ascii to classpath, so I'm removing it from
classpath-tools to avoid confusion.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * Makefile.am (bin_PROGRAMS): Removed native2ascii.
        (bin_SCRIPTS): Likewise.
        (dist-hook): Likewise.
        (native2ascii_SOURCES): Removed.
        (native2ascii_LDFLAGS): Likewise.
        (native2ascii): Removed.
        * src/gnu/classpath/tools/native2ascii/Native2ASCII.java: Moved
        to Classpath.

Index: Makefile.am
===================================================================
RCS file: /cvsroot/classpath/cp-tools/Makefile.am,v
retrieving revision 1.6
diff -u -r1.6 Makefile.am
--- Makefile.am 6 Feb 2006 10:21:08 -0000 1.6
+++ Makefile.am 22 May 2006 06:06:09 -0000
@@ -17,7 +17,7 @@
 BUILT_SOURCES = $(data_JARS)
 
 if ENABLE_GCJ_BINARY
-bin_PROGRAMS = javap javah serialver localegen currencygen native2ascii \
+bin_PROGRAMS = javap javah serialver localegen currencygen \
                rmic rmiregistry
 lib_LTLIBRARIES = libcptools.la 
 lib_LTLIBRARIES += libasm.la
@@ -27,7 +27,7 @@
 nodist_libbytecode_la_SOURCES = $(BYTECODE_JAR)
 endif
 else
-bin_SCRIPTS = javap javah serialver localegen currencygen native2ascii \
+bin_SCRIPTS = javap javah serialver localegen currencygen \
                rmic rmiregistry
 endif
 
@@ -59,10 +59,6 @@
 serialver_LDFLAGS = --main=gnu.classpath.tools.serialver.SerialVer \
        -Dgnu.gcj.runtime.VMClassLoader.library_control=never
 
-native2ascii_SOURCES = \
-       src/gnu/classpath/tools/native2ascii/Native2ASCII.java
-native2ascii_LDFLAGS = --main=gnu.classpath.tools.native2ascii.Native2ASCII
-
 localegen_SOURCES = \
        src/gnu/ldml/AliasElement.java \
        src/gnu/ldml/Analyzer.java \
@@ -116,10 +112,6 @@
        cp $< $@
        chmod +x $@
 
-native2ascii: $(srcdir)/bin/native2ascii
-       cp $< $@
-       chmod +x $@
-
 localegen: $(srcdir)/bin/localegen
        cp $< $@
        chmod +x $@
Index: src/gnu/classpath/tools/native2ascii/Native2ASCII.java
===================================================================
RCS file: src/gnu/classpath/tools/native2ascii/Native2ASCII.java
diff -N src/gnu/classpath/tools/native2ascii/Native2ASCII.java
--- src/gnu/classpath/tools/native2ascii/Native2ASCII.java 30 Dec 2005 15:16:37 
-0000 1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,109 +0,0 @@
-/*
- * Java core library component.
- * 
- * Copyright (c) 2003 Ito Kazumitsu <address@hidden>. All rights reserved.
- * 
- * See the file "license.terms" for information on usage and redistribution of
- * this file.
- */
-package gnu.classpath.tools.native2ascii;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-
-public class Native2ASCII
-{
-  public static void main(String[] args)
-  {
-    String encoding = System.getProperty("file.encoding");
-    String input = null;
-    String output = null;
-    for (int i = 0; i < args.length; i++)
-      {
-        if (args[i].equals("-encoding"))
-          {
-            i++;
-            if (i >= args.length)
-              {
-                System.err.println("encoding is missing");
-              }
-            else
-              {
-                encoding = args[i];
-              }
-          }
-        else if (args[i].equals("-reverse") || args[i].startsWith("-J"))
-          {
-            System.err.println(args[i] + ": not supported");
-          }
-        else
-          {
-            if (input == null)
-              {
-                input = args[i];
-              }
-            else if (output == null)
-              {
-                output = args[i];
-              }
-            else
-              {
-                System.err.println(args[i] + ": ignored");
-              }
-          }
-      }
-    try
-      {
-        InputStream is = (input == null ? System.in
-            : new FileInputStream(input));
-        OutputStream os = (output == null ? (OutputStream) System.out
-            : new FileOutputStream(output));
-        BufferedReader rdr = new BufferedReader(new InputStreamReader(is,
-                                                                      
encoding));
-        PrintWriter wtr = new PrintWriter(
-                                          new BufferedWriter(
-                                                             new 
OutputStreamWriter(
-                                                                               
     os,
-                                                                               
     encoding)));
-        while (true)
-          {
-            String s = rdr.readLine();
-            if (s == null)
-              break;
-            StringBuffer sb = new StringBuffer(s.length() + 80);
-            for (int i = 0; i < s.length(); i++)
-              {
-                char c = s.charAt(i);
-                if ((int)c <= 127)
-                  {
-                    sb.append(c);
-                  }
-                else
-                  {
-                    sb.append("\\u");
-                    if ((int)c <= 0xff)
-                      sb.append("00");
-                    else if ((int)c <= 0xfff)
-                      sb.append("0");
-                    sb.append(Integer.toHexString((int) c));
-                  }
-              }
-            wtr.println(sb.toString());
-          }
-        rdr.close();
-        wtr.flush();
-        wtr.close();
-      }
-    catch (Exception e)
-      {
-        e.printStackTrace();
-      }
-  }
-}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]