public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Delete unused inua code. Date: Fri, 11 Apr 2008 22:17:00 -0000 [thread overview] Message-ID: <20080411221740.3236.qmail@sourceware.org> (raw) The branch, master has been updated via edcbffeacef28be267f416367d0bc0c45f114848 (commit) from 9ba7717362d7e1868e51711d4864149fd5c9eb29 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit edcbffeacef28be267f416367d0bc0c45f114848 Author: Andrew Cagney <cagney@redhat.com> Date: Fri Apr 11 18:16:37 2008 -0400 Delete unused inua code. frysk-sys/inua/ChangeLog 2008-04-11 Andrew Cagney <cagney@redhat.com> * eio/TestMmap.java: Delete. * eio/MmapByteBuffer.java: Delete. * eio/cni/MmapByteBuffer.cxx: Delete. * eio/jni/MmapByteBuffer.cxx: Delete. ----------------------------------------------------------------------- Summary of changes: frysk-sys/inua/ChangeLog | 5 ++ frysk-sys/inua/eio/MmapByteBuffer.java | 87 ------------------------- frysk-sys/inua/eio/TestMmap.java | 97 ---------------------------- frysk-sys/inua/eio/cni/MmapByteBuffer.cxx | 100 ----------------------------- frysk-sys/inua/eio/jni/MmapByteBuffer.cxx | 71 -------------------- 5 files changed, 5 insertions(+), 355 deletions(-) delete mode 100644 frysk-sys/inua/eio/MmapByteBuffer.java delete mode 100644 frysk-sys/inua/eio/TestMmap.java delete mode 100644 frysk-sys/inua/eio/cni/MmapByteBuffer.cxx delete mode 100644 frysk-sys/inua/eio/jni/MmapByteBuffer.cxx First 500 lines of diff: diff --git a/frysk-sys/inua/ChangeLog b/frysk-sys/inua/ChangeLog index 2109a25..a606daa 100644 --- a/frysk-sys/inua/ChangeLog +++ b/frysk-sys/inua/ChangeLog @@ -1,5 +1,10 @@ 2008-04-11 Andrew Cagney <cagney@redhat.com> + * eio/TestMmap.java: Delete. + * eio/MmapByteBuffer.java: Delete. + * eio/cni/MmapByteBuffer.cxx: Delete. + * eio/jni/MmapByteBuffer.cxx: Delete. + * jni/MmapByteBuffer.cxx: New. 2008-02-11 Andrew Cagney <cagney@redhat.com> diff --git a/frysk-sys/inua/eio/MmapByteBuffer.java b/frysk-sys/inua/eio/MmapByteBuffer.java deleted file mode 100644 index aaaac02..0000000 --- a/frysk-sys/inua/eio/MmapByteBuffer.java +++ /dev/null @@ -1,87 +0,0 @@ -// This file is part of INUA. Copyright 2004, 2005, Andrew Cagney -// Copyright 2007, Red Hat Inc. -// -// INUA 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; version 2 of the License. -// -// INUA 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 INUA; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Andrew Cagney. gives You the -// additional right to link the code of INUA with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of INUA through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Andrew Cagney may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the INUA code and other code -// used in conjunction with INUA except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. -package inua.eio; - -public class MmapByteBuffer - extends ByteBuffer -{ - private static final class Mmap - { - static private native final long mmap (String name, long length); - long capacity; - long byteData; - private Mmap (String name) - { - java.io.File file = new java.io.File (name); - capacity = file.length (); - byteData = mmap (name, capacity); - } - } - - Mmap map; - - private MmapByteBuffer (Mmap map, long lowExtreem, long highExtreem) - { - super (lowExtreem, highExtreem); - this.map = map; - } - - private MmapByteBuffer (Mmap map) - { - this (map, 0, map.capacity); - } - - public MmapByteBuffer (String name) - { - this (new Mmap (name)); - } - - protected ByteBuffer subBuffer (ByteBuffer parent, long lowExtreem, - long highExtreem) - { - return new MmapByteBuffer (((MmapByteBuffer)parent).map, - lowExtreem, highExtreem); - } - - - native protected final int peek (long index); - native protected final void poke (long index, int val); - - native protected final int peek (long index, byte[] bytes, - int off, int len); -} diff --git a/frysk-sys/inua/eio/TestMmap.java b/frysk-sys/inua/eio/TestMmap.java deleted file mode 100644 index 277782a..0000000 --- a/frysk-sys/inua/eio/TestMmap.java +++ /dev/null @@ -1,97 +0,0 @@ -// This file is part of INUA. Copyright 2004, 2005, Andrew Cagney -// -// INUA 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; version 2 of the License. -// -// INUA 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 INUA; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Andrew Cagney. gives You the -// additional right to link the code of INUA with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of INUA through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Andrew Cagney may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the INUA code and other code -// used in conjunction with INUA except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. -package inua.eio; - -import java.io.File; -import java.io.PrintWriter; -import java.io.FileWriter; -import junit.framework.TestCase; - -public class TestMmap - extends TestCase -{ - public void testMmap () - { - File file; - PrintWriter tmpFile; - try { - file = File.createTempFile ("TestMmap.", ".tmp"); - file.deleteOnExit (); - tmpFile = new PrintWriter (new FileWriter (file)); - } - catch (Exception e) { - throw new RuntimeException (e); - } - String line = "A really long line that goes for at least ten (i.e., one-zero) characters"; - tmpFile.println (line); - tmpFile.flush (); - - ByteBuffer map = new MmapByteBuffer (file.getPath ()); - assertNotNull ("Opening " + file.getPath (), map); - - for (int i = 0; i < 10; i++) { - assertEquals ("Test get(): Character " + i + " wrong", - line.charAt (i), map.get ()); - } - for (int i = 0; i < 10; i++) { - assertEquals ("Test get(i):Character " + i + " wrong", - line.charAt (i), - map.get (0 + i)); - } - - for (int i = 0; i < 10; i++) { - assertEquals ("Test 10+get(): Character " + i + " wrong", - line.charAt (10 + i), map.get ()); - } - for (int i = 0; i < 10; i++) { - assertEquals ("Test get(10+i): Character " + i + " wrong", - line.charAt (10 + i), map.get (10 + i)); - - } - - ByteBuffer slice = map.slice (20, 30); - for (int i = 0; i < 10; i++) { - assertEquals ("Test slice 20..30: Character " + i + " wrong", - line.charAt (20 + i), slice.get ()); - } - for (int i = 0; i < 10; i++) { - assertEquals ("Test slice 20..30 (i): Character " + i + " wrong", - line.charAt (20 + i), slice.get (i)); - } - } -} - diff --git a/frysk-sys/inua/eio/cni/MmapByteBuffer.cxx b/frysk-sys/inua/eio/cni/MmapByteBuffer.cxx deleted file mode 100644 index 9146992..0000000 --- a/frysk-sys/inua/eio/cni/MmapByteBuffer.cxx +++ /dev/null @@ -1,100 +0,0 @@ -// This file is part of INUA. Copyright 2004, 2005, Andrew Cagney -// Copyright 2007, Red Hat Inc. -// -// INUA 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; version 2 of the License. -// -// INUA 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 INUA; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Andrew Cagney. gives You the -// additional right to link the code of INUA with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of INUA through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Andrew Cagney may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the INUA code and other code -// used in conjunction with INUA except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. -#include <sys/mman.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <alloca.h> -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> - -#include <gcj/cni.h> -#include "inua/eio/Buffer.h" -#include "inua/eio/ByteBuffer.h" -#include "inua/eio/MmapByteBuffer.h" -#include "inua/eio/MmapByteBuffer$Mmap.h" - -jlong -inua::eio::MmapByteBuffer$Mmap::mmap (jstring file, jlong length) -{ - int pathlength = JvGetStringUTFLength (file); - char *pathname = (char *) alloca (pathlength + 1); - JvGetStringUTFRegion (file, 0, file->length(), pathname); - pathname[pathlength] = '\0'; - - errno = 0; - int fd = open (pathname, O_RDONLY); - if (errno != 0) { - ::perror ("open"); - ::exit (errno); - } - - errno = 0; - void* buffer = ::mmap (NULL, length, PROT_READ | PROT_WRITE, MAP_PRIVATE, - fd, 0); - if (errno != 0) { - ::perror ("mmap"); - ::exit (errno); - } - - return (jlong) (long) buffer; -} - -jint -inua::eio::MmapByteBuffer::peek (jlong caret) -{ - u_int8_t *p = (u_int8_t*) (long) this->map->byteData; - return p[caret]; -} - -void -inua::eio::MmapByteBuffer::poke (jlong caret, jint value) -{ - u_int8_t *p = (u_int8_t*) (long) this->map->byteData; - p[caret] = value; -} - -jint -inua::eio::MmapByteBuffer::peek (jlong caret, jbyteArray bytes, jint off, - jint len) -{ - u_int8_t *p = (u_int8_t*) (long) this->map->byteData; - memcpy (elements (bytes) + off, p + caret, len); - return len; -} diff --git a/frysk-sys/inua/eio/jni/MmapByteBuffer.cxx b/frysk-sys/inua/eio/jni/MmapByteBuffer.cxx deleted file mode 100644 index 3bc85bd..0000000 --- a/frysk-sys/inua/eio/jni/MmapByteBuffer.cxx +++ /dev/null @@ -1,71 +0,0 @@ -// This file is part of the program FRYSK. -// -// Copyright 2008, Red Hat Inc. -// -// FRYSK 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; version 2 of the License. -// -// FRYSK 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 FRYSK; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Red Hat, Inc. gives You the -// additional right to link the code of FRYSK with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of FRYSK through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Red Hat, Inc. may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the FRYSK code and other code -// used in conjunction with FRYSK except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. - -#include "inua_eio_MmapByteBuffer.h" - - -JNIEXPORT jint -Java_inua_eio_MmapByteBuffer_peek__J (JNIEnv *env, jobject, jlong) -{ - jclass cls = env->FindClass("java/lang/RuntimeException"); - if (cls != NULL) { - env->ThrowNew(cls, __FILE__ ":Java_inua_eio_MmapByteBuffer_peek__J not implemented"); - } - return 0; -} - -JNIEXPORT void -Java_inua_eio_MmapByteBuffer_poke (JNIEnv *env, jobject, jlong, jint) -{ - jclass cls = env->FindClass("java/lang/RuntimeException"); - if (cls != NULL) { - env->ThrowNew(cls, __FILE__ ":Java_inua_eio_MmapByteBuffer_poke not implemented"); - } - return; -} - -JNIEXPORT jint -Java_inua_eio_MmapByteBuffer_peek__J_3BII (JNIEnv *env, jobject, jlong, jbyteArray, jint, jint) -{ - jclass cls = env->FindClass("java/lang/RuntimeException"); - if (cls != NULL) { - env->ThrowNew(cls, __FILE__ ":Java_inua_eio_MmapByteBuffer_peek__J_3BII not implemented"); - } - return 0; -} hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-04-11 22:17 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080411221740.3236.qmail@sourceware.org \ --to=cagney@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).