| CODENOTIFIER | HelpYou are not signed inSign in |
Project: JNA
Revision: 644
Author: twalljava
Date: 14 Aug 2008 10:53:14
Changes:Diff:| ... | ...@@ -3,7 +3,7 @@ | |
| 3 | 3 | <meta name="author" content="Timothy Wall"> |
| 4 | 4 | <meta name="keywords" content="java,jna,jni,c,c++,native,method,function,call,ctypes,ffi,foreign function interface,jdirect,jinvoke,pinvoke,platform invoke,native library access,native access,call native from java,java c library,easy jni,call c from java,avoid jni,jni alternative,jni replacement,legacy,call from java"> |
| 5 | 5 | <meta name="description" content="Java Native Access (JNA): access native libraries with pure Java code."> |
| 6 | <meta name="date" content="2008-08-08"> | |
| 6 | <meta name="date" content="2008-08-13"> | |
| 7 | 7 | <title>Java Native Access (JNA): Pure Java access to native libraries</title> |
| 8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 9 | 9 | </head> |
| ... | ...@@ -50,14 +50,16 @@ | |
| 50 | 50 | <td valign=center> |
| 51 | 51 | <a name=top></a> |
| 52 | 52 | <h2>Java Native Access (JNA) </h2> |
| 53 | JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation.</p> | |
| 54 | <p>JNA's design aims to provide native access in a natural way with a minimum of effort. No boilerplate or generated code is required. While some attention is paid to performance, correctness and ease of use take priority.</p> | |
| 53 | <p>JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation.</p> | |
| 54 | <p>JNA allows you to call directly into native functions using natural Java method invocation. The Java call looks just like it does in native code. Most calls require no special handling or configuration, and boilerplate or generated code is required.</p> | |
| 55 | 55 | <p>The JNA library uses a small native library stub to dynamically invoke native code. The developer uses a Java interface to describe functions and structures in the target native library. This makes it quite easy to take advantage of native platform features without incurring the high overhead of configuring and building JNI code for multiple platforms.</p> |
| 56 | <p>While some attention is paid to performance, correctness and ease of use take priority.</p> | |
| 56 | 57 | </td> |
| 57 | 58 | <td valign=center> |
| 58 | 59 | <ul> |
| 59 | 60 | <li><a href="#getting_started">Getting Started</a> |
| 60 | <li><a href="javadoc/overview-summary.html">API Overview (JavaDoc)</a> | |
| 61 | <li><a href="javadoc/overview-summary.html">Documentation</a> | |
| 62 | <li><a href="/nonav/javadoc/index.html">API (JavaDoc)</a> | |
| 61 | 63 | <li><a href="#mapping">Mapping between Java and Native</a> |
| 62 | 64 | <li><a href="#pointers">Using Pointers and Arrays</a> |
| 63 | 65 | <li><a href="#structures">Using Structures and Unions</a> |
| ... | ...@@ -234,7 +236,9 @@ | |
| 234 | 236 | </textarea> |
| 235 | 237 | </blockquote> |
| 236 | 238 | <p> |
| 237 | Arrays of C strings (the <code>char* argv[]</code> to the C <code>main</code>, for example), may be represented by <code>String[]</code> in Java code. | |
| 239 | Arrays of C strings (the <code>char* argv[]</code> to the C <code>main</code>, | |
| 240 | for example), may be represented by <code>String[]</code> in Java code. JNA | |
| 241 | will pass an equivalent array with a NULL final element. | |
| 238 | 242 | <p> |
| 239 | 243 | |
| 240 | 244 | <a href=#top>Top</a> |
| ... | ...@@ -555,10 +559,10 @@ | |
| 555 | 559 | <a name=building></a> |
| 556 | 560 | <h3>Building and Multi-platform support</h3> |
| 557 | 561 | JNA has been built and tested on OSX (ppc, x86, x86_64), linux (x86, amd64), |
| 558 | FreeBSD (x86, amd64), SunOS (x86, amd64, sparc, sparcv9) and Windows (x86). | |
| 559 | The ant build script's test target will build and run the test suite, which | |
| 560 | has decent coverage and is a quick way to determine if your environment is set | |
| 561 | up correctly.<p> | |
| 562 | FreeBSD/OpenBSD (x86, amd64), Solaris (x86, amd64, sparc, sparcv9) and Windows | |
| 563 | (x86). The ant build script's test target will build and run the test suite, | |
| 564 | which has decent coverage and is a quick way to determine if your environment | |
| 565 | is set up correctly.<p> | |
| 562 | 566 | If you want to do a build yourself, you'll need <a |
| 563 | 567 | href="http://ant.apache.org">ANT</a>, <a |
| 564 | 568 | href="http://directory.fsf.org/make.html">GNU make</a> and <a |