2012-04-24 17:06:48 +09:30
|
|
|
package org.servalproject.servald;
|
|
|
|
|
2012-04-30 17:45:24 +09:30
|
|
|
import java.util.List;
|
|
|
|
import java.util.LinkedList;
|
2012-04-24 17:06:48 +09:30
|
|
|
|
|
|
|
class ServalD
|
|
|
|
{
|
2012-04-30 17:45:24 +09:30
|
|
|
int status;
|
|
|
|
List<String> outv;
|
|
|
|
|
2012-04-24 17:06:48 +09:30
|
|
|
public ServalD()
|
|
|
|
{
|
|
|
|
System.loadLibrary("servald");
|
|
|
|
}
|
|
|
|
|
2012-04-30 17:45:24 +09:30
|
|
|
public native int rawCommand(List<String> outv, String... args);
|
|
|
|
|
|
|
|
public void command(String... args)
|
|
|
|
{
|
|
|
|
this.outv = new LinkedList<String>();
|
|
|
|
this.status = this.rawCommand(this.outv, args);
|
|
|
|
}
|
2012-04-24 17:06:48 +09:30
|
|
|
|
|
|
|
public static void main(String[] args)
|
|
|
|
{
|
2012-04-30 17:45:24 +09:30
|
|
|
ServalD servald = new ServalD();
|
|
|
|
servald.command(args);
|
|
|
|
for (String s: servald.outv) {
|
2012-04-24 17:06:48 +09:30
|
|
|
System.out.println(s);
|
|
|
|
}
|
2012-04-30 17:45:24 +09:30
|
|
|
System.exit(servald.status);
|
2012-04-24 17:06:48 +09:30
|
|
|
}
|
|
|
|
}
|