Skip to content

Commit fe739de

Browse files
author
Federico Fissore
committed
Getting rid of other unused jna stuff
1 parent e8ef0d9 commit fe739de

File tree

3 files changed

+0
-63
lines changed

3 files changed

+0
-63
lines changed

arduino-core/src/processing/app/Platform.java

-29
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
package processing.app;
2424

2525
import cc.arduino.packages.BoardPort;
26-
import com.sun.jna.Library;
27-
import com.sun.jna.Native;
2826
import processing.app.debug.TargetBoard;
2927
import processing.app.debug.TargetPackage;
3028
import processing.app.debug.TargetPlatform;
@@ -180,33 +178,6 @@ public String resolveDeviceByBoardID(Map<String, TargetPackage> packages, String
180178

181179
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
182180

183-
184-
public interface CLibrary extends Library {
185-
CLibrary INSTANCE = (CLibrary)Native.loadLibrary("c", CLibrary.class);
186-
int setenv(String name, String value, int overwrite);
187-
String getenv(String name);
188-
int unsetenv(String name);
189-
int putenv(String string);
190-
}
191-
192-
193-
public void setenv(String variable, String value) {
194-
CLibrary clib = CLibrary.INSTANCE;
195-
clib.setenv(variable, value, 1);
196-
}
197-
198-
199-
public String getenv(String variable) {
200-
CLibrary clib = CLibrary.INSTANCE;
201-
return clib.getenv(variable);
202-
}
203-
204-
205-
public int unsetenv(String variable) {
206-
CLibrary clib = CLibrary.INSTANCE;
207-
return clib.unsetenv(variable);
208-
}
209-
210181
public String getName() {
211182
return PConstants.platformNames[PConstants.OTHER];
212183
}

arduino-core/src/processing/app/macosx/Platform.java

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import processing.app.legacy.PConstants;
3333
import processing.app.tools.CollectStdOutExecutor;
3434

35-
import javax.swing.*;
3635
import java.awt.*;
3736
import java.io.*;
3837
import java.lang.reflect.Method;

arduino-core/src/processing/app/windows/Platform.java

-33
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@
2222

2323
package processing.app.windows;
2424

25-
import com.sun.jna.Library;
26-
import com.sun.jna.Native;
2725
import org.apache.commons.exec.CommandLine;
2826
import org.apache.commons.exec.Executor;
2927
import processing.app.PreferencesData;
3028
import processing.app.debug.TargetPackage;
3129
import processing.app.legacy.PApplet;
3230
import processing.app.legacy.PConstants;
3331
import processing.app.tools.CollectStdOutExecutor;
34-
import processing.app.tools.CollectStdOutStdErrExecutor;
3532
import processing.app.windows.Registry.REGISTRY_ROOT_KEY;
3633

3734
import java.io.ByteArrayOutputStream;
@@ -282,36 +279,6 @@ public void openFolder(File file) throws Exception {
282279
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
283280

284281

285-
// Code partially thanks to Richard Quirk from:
286-
// http://quirkygba.blogspot.com/2009/11/setting-environment-variables-in-java.html
287-
288-
static WinLibC clib = (WinLibC) Native.loadLibrary("msvcrt", WinLibC.class);
289-
290-
public interface WinLibC extends Library {
291-
//WinLibC INSTANCE = (WinLibC) Native.loadLibrary("msvcrt", WinLibC.class);
292-
//libc = Native.loadLibrary("msvcrt", WinLibC.class);
293-
public int _putenv(String name);
294-
}
295-
296-
297-
public void setenv(String variable, String value) {
298-
//WinLibC clib = WinLibC.INSTANCE;
299-
clib._putenv(variable + "=" + value);
300-
}
301-
302-
303-
public String getenv(String variable) {
304-
return System.getenv(variable);
305-
}
306-
307-
308-
public int unsetenv(String variable) {
309-
//WinLibC clib = WinLibC.INSTANCE;
310-
//clib._putenv(variable + "=");
311-
//return 0;
312-
return clib._putenv(variable + "=");
313-
}
314-
315282
@Override
316283
public String getName() {
317284
return PConstants.platformNames[PConstants.WINDOWS];

0 commit comments

Comments
 (0)