Skip to content

Commit

Permalink
pequenas mudanças
Browse files Browse the repository at this point in the history
mudanças na doc
  • Loading branch information
thiago committed Sep 17, 2007
1 parent bf87cc2 commit a54a28f
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 40 deletions.
14 changes: 12 additions & 2 deletions doc/us/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,17 @@ <h1>LuaJava</h1>
<h2><a name="history"></a>History</h2>

<dl class="history">
<dt><strong>1.1</strong> [24/Jan/2007]</dt>
<dt><strong>1.2</strong> [24/May/2007]</dt>
<dd>
<ul>
<li>Java object fields can be set in Lua. eg: <code>javaObj.intField=1</code> ;</li>
<li>Java arrays can be read and set in Lua;</li>
<li>Corrected bug of missing function pushinteger in C;</li>
<li>Corrected possible memory leak when a Java object proxy metatable could not be set;</li>
<li>Static fields and java.lang.Class fields are accessible.</li>
</ul>
</dd>
<dt><strong><a href="1.1/">1.1</a></strong> [24/Jan/2007]</dt>
<dd>
<ul>
<li>changes to comply with Lua 5.1 API;</li>
Expand Down Expand Up @@ -118,7 +128,7 @@ <h2><a name="history"></a>History</h2>
<div id="about">
<p><a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
<p><small>$Id: history.html,v 1.18 2007-01-23 22:37:28 thiago Exp $</small></p>
<p><small>$Id: history.html,v 1.19 2007-09-17 19:28:40 thiago Exp $</small></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->
Expand Down
17 changes: 11 additions & 6 deletions doc/us/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,30 @@ <h2><a name="overview"></a>Overview</h2>

<h2><a name="status"></a>Status</h2>

<p>LuaJava version 1.1 for Lua 5.1.1 is now available for <a href="#download">download</a>.</p>
<p>LuaJava version 1.2 for Lua 5.1.* is now available for <a href="#download">download</a>.</p>

<h2><a name="dependencies"></a>Dependencies</h2>

<p>LuaJava uses <a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.1 and Java JDK 1.4 or above.</p>
<p>LuaJava uses <a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.* and Java JDK 1.4 or above.</p>

<h2><a name="download"></a>Download</h2>

<p>
LuaJava can be download from the <a href="http://luaforge.net/projects/luajava/files">LuaForge</a>
page. If you are using
<a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.1
<a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.2
a Windows pre-compiled version of LuaJava can also be found at the same
LuaForge page.</p>


<h2><a name="credits"></a>Credits</h2>

<dl>
<dt><strong>LuaJava 1.2</strong></dt>
<dd>LuaJava 1.2 was developed by Thiago Ponte and sponsored by Finep.<br/>
</dd>


<dt><strong>LuaJava 1.1</strong></dt>
<dd>LuaJava 1.1 was developed by Thiago Ponte.<br/>
</dd>
Expand All @@ -121,8 +126,8 @@ <h2><a name="contact"></a>Contact us</h2>
<p>For more information please <a href="mailto:info-NO-SPAM-THANKS@keplerproject.org">contact</a>
us. Comments are welcome!</p>

<p>You can also reach other Kepler developers and users on the Kepler Project
<a href="http://luaforge.net/mail/?group_id=104">mailing list</a>.</p>
<p>You can also reach the developers and users on the LuaJava
<a href="http://luaforge.net/mail/?group_id=10">mailing list</a>.</p>


</div> <!-- id="content" -->
Expand All @@ -133,7 +138,7 @@ <h2><a name="contact"></a>Contact us</h2>
<div id="about">
<p><a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
<p><small>$Id: index.html,v 1.19 2007-01-23 22:37:28 thiago Exp $</small></p>
<p><small>$Id: index.html,v 1.20 2007-09-17 19:28:40 thiago Exp $</small></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->
Expand Down
20 changes: 10 additions & 10 deletions doc/us/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ <h3>Windows</h3>
To do that, run the <code>VCVARS32.BAT</code> command before running nmake:</p>

<pre class="example">
c:\luajava-1.1&gt;&quot;drive:\complete_path_to\VCVARS32.bat&quot;
c:\luajava-1.1&gt;nmake -f nmakefile
c:\luajava-1.2&gt;&quot;drive:\complete_path_to\VCVARS32.bat&quot;
c:\luajava-1.2&gt;nmake -f nmakefile
</pre>

<h3>Linux</h3>
Expand All @@ -87,16 +87,16 @@ <h3>Linux</h3>

<h2><a name="install"></a>Installing</h2>

<p>LuaJava compilation generates two files: <code>luajava-1.1.jar</code> and
<code>luajava-1.1.dll</code> (or <code>libluajava-1.1.so</code> in Unix, or
<code>libluajava-1.1.jnilib</code> in MacOSX).
<p>LuaJava compilation generates two files: <code>luajava-1.2.jar</code> and
<code>luajava-1.2.dll</code> (or <code>libluajava-1.2.so</code> in Unix, or
<code>libluajava-1.2.jnilib</code> in MacOSX).
</p>

<dl>
<dt><strong>luajava-1.1.jar</strong></dt>
<dt><strong>luajava-1.2.jar</strong></dt>
<dd>This file must be copied to a path in the java application CLASSPATH.</dd>

<dt><strong>luajava-1.1.dll (or libluajava-1.1.so or libluajava-1.1.jnilib)</strong></dt>
<dt><strong>luajava-1.2.dll (or libluajava-1.2.so or libluajava-1.2.jnilib)</strong></dt>
<dd>This file must be copied to a path in your system path, that depends on your OS.
Windows users can place it in the JRE bin directory, or the windows system folder. Unix
users can place it in the JRE bin directory or a directory pointed by LD_LIBRARY_PATH
Expand All @@ -109,8 +109,8 @@ <h2><a name="console"></a>Running the LuaJava Console</h2>
<p>LuaJava is distributed with a simple console. To run it type :</p>

<pre class="example">
c:\luajava-1.1&gt;java -cp &quot;luajava-1.1.jar&quot;
org.keplerproject.luajava.Console
c:\luajava-1.2&gt;java -cp &quot;luajava-1.2.jar&quot;
luaforge.luajava.Console
</pre>


Expand Down Expand Up @@ -279,7 +279,7 @@ <h2><a name="javareference"></a>Java Reference</h2>
<div id="about">
<p><a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
<p><small>$Id: manual.html,v 1.20 2007-01-23 22:37:28 thiago Exp $</small></p>
<p><small>$Id: manual.html,v 1.21 2007-09-17 19:28:40 thiago Exp $</small></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->
Expand Down
3 changes: 3 additions & 0 deletions src/c/luajava.c
Original file line number Diff line number Diff line change
Expand Up @@ -2956,6 +2956,9 @@ JNIEXPORT void JNICALL Java_org_keplerproject_luajava_LuaState__1pushString__Lor

uniStr = ( *env )->GetStringUTFChars( env , str , NULL );

if ( uniStr == NULL )
return;

lua_pushstring( L , uniStr );

( *env )->ReleaseStringUTFChars( env , str , uniStr );
Expand Down
7 changes: 5 additions & 2 deletions src/java/org/keplerproject/luajava/Console.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: Console.java,v 1.7 2006-12-22 14:06:40 thiago Exp $
* $Id: Console.java,v 1.8 2007-09-17 19:28:40 thiago Exp $
* Copyright (C) 2003-2007 Kepler Project.
*
* Permission is hereby granted, free of charge, to any person obtaining
Expand Down Expand Up @@ -79,7 +79,10 @@ public static void main(String[] args)
int ret = L.LloadBuffer(line.getBytes(), "from console");
if (ret == 0)
{
ret = L.pcall(0, 0, 0);
synchronized (L)
{
ret = L.pcall(0, 0, 0);
}
}
if (ret != 0)
{
Expand Down
4 changes: 2 additions & 2 deletions src/java/org/keplerproject/luajava/LuaObject.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: LuaObject.java,v 1.6 2006-12-22 14:06:40 thiago Exp $
* $Id: LuaObject.java,v 1.7 2007-09-17 19:28:40 thiago Exp $
* Copyright (C) 2003-2007 Kepler Project.
*
* Permission is hereby granted, free of charge, to any person obtaining
Expand Down Expand Up @@ -379,7 +379,7 @@ public Object getObject() throws LuaException
}

/**
* If <code>this<code> is a table or userdata tries to set
* If <code>this<code> is a table or userdata tries to get
* a field value.
*/
public LuaObject getField(String field) throws LuaException
Expand Down
20 changes: 7 additions & 13 deletions src/java/org/keplerproject/luajava/LuaState.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: LuaState.java,v 1.10 2007-04-17 23:47:50 thiago Exp $
* $Id: LuaState.java,v 1.11 2007-09-17 19:28:40 thiago Exp $
* Copyright (C) 2003-2007 Kepler Project.
*
* Permission is hereby granted, free of charge, to any person obtaining
Expand Down Expand Up @@ -58,19 +58,13 @@ public class LuaState
/*
* error codes for `lua_load' and `lua_pcall'
*/
/**
* a runtime error.
*/
final public static Integer LUA_ERRRUN = new Integer(1);

final public static Integer LUA_YIELD = new Integer(1);

/**
*
*/
final public static Integer LUA_YIELD = new Integer(2);
/** a runtime error. */
final public static Integer LUA_ERRRUN = new Integer(2);

/**
* syntax error during pre-compilation.
*/
/** syntax error during pre-compilation. */
final public static Integer LUA_ERRSYNTAX = new Integer(3);

/**
Expand Down Expand Up @@ -250,7 +244,7 @@ public long getCPtrPeer()


// LuaLibAux
private synchronized native int _LdoFile(CPtr ptr, String fileName);
private static synchronized native int _LdoFile(CPtr ptr, String fileName);
private synchronized native int _LdoString(CPtr ptr, String string);
//private synchronized native int _doBuffer(CPtr ptr, byte[] buff, long sz, String n);

Expand Down
6 changes: 1 addition & 5 deletions test/org/keplerproject/luajava/test/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

package org.keplerproject.luajava.test;

import java.io.FileNotFoundException;
import java.io.IOException;

import org.keplerproject.luajava.LuaException;
import org.keplerproject.luajava.LuaObject;
import org.keplerproject.luajava.LuaState;
Expand All @@ -43,8 +40,7 @@ public class Main
"luaPrint={implements='org.keplerproject.luajava.test.Printable', print=function(str)print('Printing from lua :'..str)end }";


public static void main(String[] main_args)
throws IOException, FileNotFoundException, ClassNotFoundException, LuaException
public static void main(String[] main_args) throws LuaException, ClassNotFoundException
{
LuaState L = LuaStateFactory.newLuaState();
L.openBase();
Expand Down

0 comments on commit a54a28f

Please sign in to comment.