PageRenderTime 60ms CodeModel.GetById 53ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/java/native/index.html

#
HTML | 33 lines | 24 code | 9 blank | 0 comment | 0 complexity | 09b4edc840b30c1d138360cbbd780d76 MD5 | raw file
 1<html>
 2<head>
 3<title>SWIG:Examples:java:native</title>
 4</head>
 5
 6<body bgcolor="#ffffff">
 7
 8
 9<tt>SWIG/Examples/java/native/</tt>
10<hr>
11
12<H2>SWIG wrapped and manually wrapped functions in Java</H2>
13
14Click <a href="../../../Doc/Manual/Java.html#using_own_jni_functions">here</a> for the relevant section in the SWIG and Java documentation.
15<p>
16This example compares wrapping a c global function using the manual way and the SWIG way.
17</p>
18
19<ul>
20<li><a href="example.i">example.i</a>. Interface file comparing code wrapped by SWIG and wrapped manually. 
21<li><a href="runme.java">runme.java</a>. Sample Java program showing calls to both manually wrapped and SWIG wrapped c functions.
22</ul>
23
24<h2>Notes</h2>
25
26<ul>
27<li>SWIG writes all the awkward JNI code for you. You just have to tell SWIG which functions to wrap.
28<li>If memory is allocated in c it needs to be free'd. A function, such as free(), can be provided with access from Java to free the memory.
29</ul>
30
31<hr>
32</body>
33</html>