diff options
author | Dave Beazley <dave-swig@dabeaz.com> | 2002-11-30 22:01:28 +0000 |
---|---|---|
committer | Dave Beazley <dave-swig@dabeaz.com> | 2002-11-30 22:01:28 +0000 |
commit | 12a43edc2df8853e8e0315f742e57be88f0c4269 (patch) | |
tree | e3237f5f8c0a67c9bfa9bb5d6d095a739a49e4b2 /Examples/java/typemap | |
parent | 5fcae5eb66d377e1c3f81da7465c44a62295a72b (diff) | |
download | swig-12a43edc2df8853e8e0315f742e57be88f0c4269.tar.gz |
The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/java/typemap')
-rw-r--r-- | Examples/java/typemap/.cvsignore | 11 | ||||
-rw-r--r-- | Examples/java/typemap/Makefile | 7 | ||||
-rw-r--r-- | Examples/java/typemap/README | 8 | ||||
-rw-r--r-- | Examples/java/typemap/index.html | 34 | ||||
-rw-r--r-- | Examples/java/typemap/main.java | 3 |
5 files changed, 50 insertions, 13 deletions
diff --git a/Examples/java/typemap/.cvsignore b/Examples/java/typemap/.cvsignore new file mode 100644 index 000000000..49312b8c6 --- /dev/null +++ b/Examples/java/typemap/.cvsignore @@ -0,0 +1,11 @@ +*.class +*.java +*_wrap.c +*_wrap.cxx +example.dll +example.dsw +example.ncb +example.opt +example.plg +Release +Debug diff --git a/Examples/java/typemap/Makefile b/Examples/java/typemap/Makefile index ddba664d9..e8b93c0d3 100644 --- a/Examples/java/typemap/Makefile +++ b/Examples/java/typemap/Makefile @@ -1,17 +1,18 @@ TOP = ../.. SWIG = $(TOP)/../swig SRCS = -TARGET = libexample +TARGET = example INTERFACE = example.i -SWIGOPT = +SWIGOPT = -noproxy all:: java java:: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java + javac *.java clean:: - rm -f *_wrap* *.o core *~ *.so *.class example.java + $(MAKE) -f $(TOP)/Makefile java_clean check: all diff --git a/Examples/java/typemap/README b/Examples/java/typemap/README deleted file mode 100644 index 67dabbfdc..000000000 --- a/Examples/java/typemap/README +++ /dev/null @@ -1,8 +0,0 @@ -Example of a typemap to handle return values in char * arguments. - -type: -make -javac *.java -export LD_LIBRARY_PATH=. # sh -setenv LD_LIBRARY_PATH . # csh -java main diff --git a/Examples/java/typemap/index.html b/Examples/java/typemap/index.html new file mode 100644 index 000000000..259f42953 --- /dev/null +++ b/Examples/java/typemap/index.html @@ -0,0 +1,34 @@ +<html> +<head> +<title>SWIG:Examples:java:typemap</title> +</head> + +<body bgcolor="#ffffff"> + + +<tt>SWIG/Examples/java/typemap/</tt> +<hr> + +<H2>Typemaps in Java</H2> + +<tt>$Header$</tt><br> + +<p> +This example shows how typemaps can be used to modify the default behaviour of the Java SWIG module. + +<ul> +<li><a href="example.i">example.i</a>. Interface file. +<li><a href="main.java">main.java</a>. Sample Java program. +</ul> + +<h2>Notes</h2> + +<ul> +<li>Shows how to pass strings to Java from c and visa versa. +<li>Typemaps can modify the default behaviour of the Java SWIG module. +<li>The default c to java mapping can be modified using typemaps. +</ul> + +<hr> +</body> +</html> diff --git a/Examples/java/typemap/main.java b/Examples/java/typemap/main.java index f7da20cdc..bd9a4e1b6 100644 --- a/Examples/java/typemap/main.java +++ b/Examples/java/typemap/main.java @@ -1,4 +1,3 @@ -import example; public class main { @@ -6,7 +5,7 @@ public class main { try { System.loadLibrary("example"); } catch (UnsatisfiedLinkError e) { - System.err.println("Cannot load the example native code.\nMake sure your LD_LIBRARY_PATH contains \'.\'\n" + e); + System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); System.exit(1); } } |