quick sketches of various SWT 3.3 dependencies

This commit is contained in:
Joel Dice
2007-09-11 19:13:05 -06:00
parent 132936ba2e
commit cb03240c64
25 changed files with 340 additions and 37 deletions

View File

@ -21,6 +21,7 @@
# define STRUCT_STAT struct _stat
# define MKDIR(path, mode) _mkdir(path)
# define CREAT _creat
# define UNLINK _unlink
# define OPEN_MASK O_BINARY
#else
# include <unistd.h>
@ -32,6 +33,7 @@
# define STRUCT_STAT struct stat
# define MKDIR mkdir
# define CREAT creat
# define UNLINK unlink
# define OPEN_MASK 0
#endif
@ -150,6 +152,18 @@ Java_java_io_File_createNewFile(JNIEnv* e, jclass, jstring path)
}
}
extern "C" JNIEXPORT jboolean JNICALL
Java_java_io_File_delete(JNIEnv* e, jclass, jstring path)
{
const char* chars = e->GetStringUTFChars(path, 0);
int r = -1;
if (chars) {
r = UNLINK(chars);
e->ReleaseStringUTFChars(path, chars);
}
return r == 0;
}
extern "C" JNIEXPORT jboolean JNICALL
Java_java_io_File_exists(JNIEnv* e, jclass, jstring path)
{