1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

Getting rid of other unused jna stuff

This commit is contained in:
Federico Fissore 2015-03-30 13:33:05 +02:00
parent e8ef0d9047
commit fe739de2ad
3 changed files with 0 additions and 63 deletions

View File

@ -23,8 +23,6 @@
package processing.app; package processing.app;
import cc.arduino.packages.BoardPort; import cc.arduino.packages.BoardPort;
import com.sun.jna.Library;
import com.sun.jna.Native;
import processing.app.debug.TargetBoard; import processing.app.debug.TargetBoard;
import processing.app.debug.TargetPackage; import processing.app.debug.TargetPackage;
import processing.app.debug.TargetPlatform; import processing.app.debug.TargetPlatform;
@ -180,33 +178,6 @@ public class Platform {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
public interface CLibrary extends Library {
CLibrary INSTANCE = (CLibrary)Native.loadLibrary("c", CLibrary.class);
int setenv(String name, String value, int overwrite);
String getenv(String name);
int unsetenv(String name);
int putenv(String string);
}
public void setenv(String variable, String value) {
CLibrary clib = CLibrary.INSTANCE;
clib.setenv(variable, value, 1);
}
public String getenv(String variable) {
CLibrary clib = CLibrary.INSTANCE;
return clib.getenv(variable);
}
public int unsetenv(String variable) {
CLibrary clib = CLibrary.INSTANCE;
return clib.unsetenv(variable);
}
public String getName() { public String getName() {
return PConstants.platformNames[PConstants.OTHER]; return PConstants.platformNames[PConstants.OTHER];
} }

View File

@ -32,7 +32,6 @@ import processing.app.legacy.PApplet;
import processing.app.legacy.PConstants; import processing.app.legacy.PConstants;
import processing.app.tools.CollectStdOutExecutor; import processing.app.tools.CollectStdOutExecutor;
import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.io.*; import java.io.*;
import java.lang.reflect.Method; import java.lang.reflect.Method;

View File

@ -22,8 +22,6 @@
package processing.app.windows; package processing.app.windows;
import com.sun.jna.Library;
import com.sun.jna.Native;
import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.Executor; import org.apache.commons.exec.Executor;
import processing.app.PreferencesData; import processing.app.PreferencesData;
@ -31,7 +29,6 @@ import processing.app.debug.TargetPackage;
import processing.app.legacy.PApplet; import processing.app.legacy.PApplet;
import processing.app.legacy.PConstants; import processing.app.legacy.PConstants;
import processing.app.tools.CollectStdOutExecutor; import processing.app.tools.CollectStdOutExecutor;
import processing.app.tools.CollectStdOutStdErrExecutor;
import processing.app.windows.Registry.REGISTRY_ROOT_KEY; import processing.app.windows.Registry.REGISTRY_ROOT_KEY;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -282,36 +279,6 @@ public class Platform extends processing.app.Platform {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
// Code partially thanks to Richard Quirk from:
// http://quirkygba.blogspot.com/2009/11/setting-environment-variables-in-java.html
static WinLibC clib = (WinLibC) Native.loadLibrary("msvcrt", WinLibC.class);
public interface WinLibC extends Library {
//WinLibC INSTANCE = (WinLibC) Native.loadLibrary("msvcrt", WinLibC.class);
//libc = Native.loadLibrary("msvcrt", WinLibC.class);
public int _putenv(String name);
}
public void setenv(String variable, String value) {
//WinLibC clib = WinLibC.INSTANCE;
clib._putenv(variable + "=" + value);
}
public String getenv(String variable) {
return System.getenv(variable);
}
public int unsetenv(String variable) {
//WinLibC clib = WinLibC.INSTANCE;
//clib._putenv(variable + "=");
//return 0;
return clib._putenv(variable + "=");
}
@Override @Override
public String getName() { public String getName() {
return PConstants.platformNames[PConstants.WINDOWS]; return PConstants.platformNames[PConstants.WINDOWS];