1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

[224873] committing contributed patch: WinCE subsystem cleanup part 2

This commit is contained in:
Martin Oberhuber 2008-04-02 11:59:17 +00:00
parent 9f9f310e02
commit 8fd22a181c
17 changed files with 53 additions and 47 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rse.subsystems.wince;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: org.eclipse.rse.internal.subsystems.files.wince.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -14,7 +14,7 @@
# NLS_ENCODING=UTF-8
providerName = Eclipse.org
pluginName = RSE WinCE Services
pluginName = RSE WinCE Services (Incubation)
systemType.label.0 = WinCE
configuration.description.0 = This configuration allows you to work with files on remote WinCE-based device using ActiveSync/RAPI2 connection.
configuration.name.0 = WinCE Files

View file

@ -13,7 +13,7 @@
# NLS_ENCODING=UTF-8
# "featureName" property - name of the feature
featureName=RSE WinCE Services
featureName=RSE WinCE Services (Incubation)
# "providerName" property - name of the company that provides the feature
providerName=Eclipse.org

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.rapi.examples
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: org.eclipse.tm.rapi.examples.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -14,4 +14,4 @@
# NLS_ENCODING=UTF-8
providerName = Eclipse.org
pluginName = RAPI2 Java wrapper examples
pluginName = RAPI2 Java wrapper examples (Incubation)

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.rapi.tests
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 0.1.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.junit,

View file

@ -14,4 +14,4 @@
# NLS_ENCODING=UTF-8
providerName = Eclipse.org
pluginName = RAPI2 Java wrapper unit tests
pluginName = RAPI2 Java wrapper unit tests (Incubation)

View file

@ -29,3 +29,9 @@ Building the library:
8. Navigate to "Build", and click "Rebuild Solution" to rebuild the library.
The output dll will be placed in \lib\os\win32\x86
Environment used for building the committed jrapi.dll:
Windows 2000 SP4
Visual Studio 2005 Standard Edition
Windows Mobile 5.0 Pocket PC SDK
JDK 1.4.2_10

View file

@ -14,4 +14,4 @@
# NLS_ENCODING=UTF-8
providerName = Eclipse.org
pluginName = RAPI2 Java wrappers
pluginName = RAPI2 Java wrappers (Incubation)

View file

@ -30,13 +30,13 @@ public class RapiDesktop extends IRapiDesktop {
int[] ppIEnum = new int[1];
int rc = EnumDevices(addr, ppIEnum);
if (rc != OS.NOERROR) {
throw new RapiException("EnumDevices failed", rc);
throw new RapiException("EnumDevices failed", rc); //$NON-NLS-1$
}
return new RapiEnumDevices(ppIEnum[0]);
}
public String toString() {
return "[RapiDesktop] addr: " + Integer.toHexString(addr);
return "[RapiDesktop] addr: " + Integer.toHexString(addr); //$NON-NLS-1$
}
private final native int EnumDevices(int addr, int[] ppIEnum);

View file

@ -32,7 +32,7 @@ public class RapiDevice extends IRapiDevice {
int[] ppISession = new int[1];
int rc = CreateSession(addr, ppISession);
if (rc != OS.NOERROR) {
throw new RapiException("CreateSession failed", rc);
throw new RapiException("CreateSession failed", rc); //$NON-NLS-1$
}
return new RapiSession(ppISession[0]);
}
@ -41,7 +41,7 @@ public class RapiDevice extends IRapiDevice {
RapiConnectionInfo connInfo = new RapiConnectionInfo();
int rc = GetConnectionInfo(addr, connInfo);
if (rc != OS.NOERROR) {
throw new RapiException("GetConnectionInfo failed", rc);
throw new RapiException("GetConnectionInfo failed", rc); //$NON-NLS-1$
}
return connInfo;
}
@ -50,7 +50,7 @@ public class RapiDevice extends IRapiDevice {
RapiDeviceInfo devInfo = new RapiDeviceInfo();
int rc = GetDeviceInfo(addr, devInfo);
if (rc != OS.NOERROR) {
throw new RapiException("GetDeviceInfo failed", rc);
throw new RapiException("GetDeviceInfo failed", rc); //$NON-NLS-1$
}
return devInfo;
}
@ -59,13 +59,13 @@ public class RapiDevice extends IRapiDevice {
int[] status = new int[1];
int rc = GetConnectStat(addr, status);
if (rc != OS.NOERROR) {
throw new RapiException("GetConnectStat failed", rc);
throw new RapiException("GetConnectStat failed", rc); //$NON-NLS-1$
}
return status[0] == 1;
}
public String toString() {
return "[RapiDevice] addr: " + Integer.toHexString(addr);
return "[RapiDevice] addr: " + Integer.toHexString(addr); //$NON-NLS-1$
}
private final native int CreateSession(int addr, int[] ppISession);

View file

@ -30,13 +30,13 @@ public class RapiEnumDevices extends IRapiEnumDevices {
int[] ppIDevice = new int[1];
int rc = Next(addr, ppIDevice);
if (rc != OS.NOERROR) {
throw new RapiException("Next failed", rc);
throw new RapiException("Next failed", rc); //$NON-NLS-1$
}
return new RapiDevice(ppIDevice[0]);
}
public String toString() {
return "[RapiEnumDevices] addr: " + Integer.toHexString(addr);
return "[RapiEnumDevices] addr: " + Integer.toHexString(addr); //$NON-NLS-1$
}
private final native int Next(int addr, int[] ppIDevice);

View file

@ -42,14 +42,14 @@ public class RapiSession extends IRapiSession {
public void init() throws RapiException {
int rc = CeRapiInit(addr);
if (rc != OS.NOERROR) {
throw new RapiException("CeRapiInit failed", rc);
throw new RapiException("CeRapiInit failed", rc); //$NON-NLS-1$
}
}
public void uninit() throws RapiException {
int rc = CeRapiUninit(addr);
if (rc != OS.NOERROR) {
throw new RapiException("CeRapiUninit failed", rc);
throw new RapiException("CeRapiUninit failed", rc); //$NON-NLS-1$
}
}
@ -59,7 +59,7 @@ public class RapiSession extends IRapiSession {
int handle = CeCreateFile(addr, fileName, desiredAccess, shareMode,
creationDisposition, flagsAndAttributes);
if (handle == OS.INVALID_HANDLE_VALUE) {
throw new RapiException("CeCreateFile failed", getError());
throw new RapiException("CeCreateFile failed", getError()); //$NON-NLS-1$
}
return handle;
}
@ -71,7 +71,7 @@ public class RapiSession extends IRapiSession {
int[] bytesRead = new int[1];
boolean res = CeReadFile(addr, handle, b, b.length, bytesRead);
if (!res) {
throw new RapiException("CeReadFile failed", getError());
throw new RapiException("CeReadFile failed", getError()); //$NON-NLS-1$
}
return bytesRead[0] > 0 ? bytesRead[0] : -1;
}
@ -79,7 +79,7 @@ public class RapiSession extends IRapiSession {
public int readFile(int handle, byte[] b, int off, int len)
throws RapiException {
if (off < 0 || len < 0 || off + len > b.length) {
throw new IndexOutOfBoundsException("Incorrect offset/length");
throw new IndexOutOfBoundsException("Incorrect offset/length"); //$NON-NLS-1$
}
if (len == 0) {
return 0;
@ -89,7 +89,7 @@ public class RapiSession extends IRapiSession {
int[] bytesRead = new int[1];
boolean res = CeReadFile(addr, handle, tmp, tmp.length, bytesRead);
if (!res) {
throw new RapiException("CeReadFile failed", getError());
throw new RapiException("CeReadFile failed", getError()); //$NON-NLS-1$
}
System.arraycopy(tmp, 0, b, off, len);
return bytesRead[0] > 0 ? bytesRead[0] : -1;
@ -99,7 +99,7 @@ public class RapiSession extends IRapiSession {
int[] bytesWritten = new int[1];
boolean res = CeWriteFile(addr, handle, b, b.length, bytesWritten);
if (!res) {
throw new RapiException("CeWriteFile failed", getError());
throw new RapiException("CeWriteFile failed", getError()); //$NON-NLS-1$
}
}
@ -107,7 +107,7 @@ public class RapiSession extends IRapiSession {
throws RapiException {
if (off < 0 || len < 0 || off + len > b.length) {
throw new IndexOutOfBoundsException("Incorrect offset/length");
throw new IndexOutOfBoundsException("Incorrect offset/length"); //$NON-NLS-1$
}
//TODO: add support for setting offset in the native code and remove this tmp array
byte[] tmp = new byte[len];
@ -115,14 +115,14 @@ public class RapiSession extends IRapiSession {
int[] bytesWritten = new int[1];
boolean res = CeWriteFile(addr, handle, tmp, tmp.length, bytesWritten);
if (!res) {
throw new RapiException("CeWriteFile failed", getError());
throw new RapiException("CeWriteFile failed", getError()); //$NON-NLS-1$
}
}
public void closeHandle(int handle) throws RapiException {
boolean res = CeCloseHandle(addr, handle);
if (!res) {
throw new RapiException("CeCloseHandle failed", getError());
throw new RapiException("CeCloseHandle failed", getError()); //$NON-NLS-1$
}
}
@ -130,42 +130,42 @@ public class RapiSession extends IRapiSession {
//overwrite by default
boolean res = CeCopyFile(addr, existingFile, newFile, false);
if (!res) {
throw new RapiException("CeCopyFile failed", getError());
throw new RapiException("CeCopyFile failed", getError()); //$NON-NLS-1$
}
}
public void deleteFile(String fileName) throws RapiException {
boolean res = CeDeleteFile(addr, fileName);
if (!res) {
throw new RapiException("CeDeleteFile failed", getError());
throw new RapiException("CeDeleteFile failed", getError()); //$NON-NLS-1$
}
}
public void moveFile(String existingFileName, String newFileName) throws RapiException {
boolean res = CeMoveFile(addr, existingFileName, newFileName);
if (!res) {
throw new RapiException("CeMoveFile failed", getError());
throw new RapiException("CeMoveFile failed", getError()); //$NON-NLS-1$
}
}
public void createDirectory(String pathName) throws RapiException {
boolean res = CeCreateDirectory(addr, pathName);
if (!res) {
throw new RapiException("CeCreateDirectory failed", getError());
throw new RapiException("CeCreateDirectory failed", getError()); //$NON-NLS-1$
}
}
public void removeDirectory(String pathName) throws RapiException {
boolean res = CeRemoveDirectory(addr, pathName);
if (!res) {
throw new RapiException("CeRemoveDirectory failed", getError());
throw new RapiException("CeRemoveDirectory failed", getError()); //$NON-NLS-1$
}
}
public int findFirstFile(String fileName, RapiFindData findData) throws RapiException {
int handle = CeFindFirstFile(addr, fileName, findData);
if (handle == OS.INVALID_HANDLE_VALUE) {
throw new RapiException("CeFindFirstFile failed", getError());
throw new RapiException("CeFindFirstFile failed", getError()); //$NON-NLS-1$
}
return handle;
}
@ -180,7 +180,7 @@ public class RapiSession extends IRapiSession {
public void findClose(int handle) throws RapiException {
boolean res = CeFindClose(addr, handle);
if (!res) {
throw new RapiException("CeFindClose failed", getError());
throw new RapiException("CeFindClose failed", getError()); //$NON-NLS-1$
}
}
@ -199,7 +199,7 @@ public class RapiSession extends IRapiSession {
}
int hRes = CeFindAllFilesEx(addr, count, dataArr[0], findDataArr);
if (hRes != OS.NOERROR) {
throw new RapiException("CeFindAllFilesEx failed", hRes);
throw new RapiException("CeFindAllFilesEx failed", hRes); //$NON-NLS-1$
}
return findDataArr;
}
@ -224,7 +224,7 @@ public class RapiSession extends IRapiSession {
long[] lwTime = new long[1];
boolean res = CeGetFileTime(addr, handle, crTime, laTime, lwTime);
if (!res) {
throw new RapiException("CeGetFileTime failed", getError());
throw new RapiException("CeGetFileTime failed", getError()); //$NON-NLS-1$
}
return new Date((crTime[0] / 10000) - OS.TIME_DIFF);
}
@ -235,7 +235,7 @@ public class RapiSession extends IRapiSession {
long[] lwTime = new long[1];
boolean res = CeGetFileTime(addr, handle, crTime, laTime, lwTime);
if (!res) {
throw new RapiException("CeGetFileTime failed", getError());
throw new RapiException("CeGetFileTime failed", getError()); //$NON-NLS-1$
}
return new Date((laTime[0] / 10000) - OS.TIME_DIFF);
}
@ -246,13 +246,13 @@ public class RapiSession extends IRapiSession {
long[] lwTime = new long[1];
boolean res = CeGetFileTime(addr, handle, crTime, laTime, lwTime);
if (!res) {
throw new RapiException("CeGetFileTime failed", getError());
throw new RapiException("CeGetFileTime failed", getError()); //$NON-NLS-1$
}
return new Date((lwTime[0] / 10000) - OS.TIME_DIFF);
}
public String toString() {
return "[RapiSession] addr: " + Integer.toHexString(addr);
return "[RapiSession] addr: " + Integer.toHexString(addr); //$NON-NLS-1$
}
private final native int CeRapiInit(int addr);

View file

@ -35,7 +35,7 @@ public abstract class IRapiDesktop extends IUnknown {
int[] rapiDesktop = new int[1];
int rc = OS.CreateRapiDesktop(rapiDesktop);
if (rc != OS.NOERROR) {
throw new RapiException("CreateRapiDesktop failed", rc);
throw new RapiException("CreateRapiDesktop failed", rc); //$NON-NLS-1$
}
return new RapiDesktop(rapiDesktop[0]);
}

View file

@ -18,7 +18,7 @@ package org.eclipse.tm.rapi;
public class OS {
static {
System.loadLibrary("lib/os/win32/x86/jrapi");
System.loadLibrary("lib/os/win32/x86/jrapi"); //$NON-NLS-1$
}
public static final int NOERROR = 0;

View file

@ -31,12 +31,12 @@ public class RapiConnectionInfo {
public String toString() {
switch (connectionType) {
case RAPI_CONNECTION_USB: return "USB";
case RAPI_CONNECTION_IR: return "IR";
case RAPI_CONNECTION_SERIAL: return "Serial";
case RAPI_CONNECTION_NETWORK: return "Network";
case RAPI_CONNECTION_USB: return "USB"; //$NON-NLS-1$
case RAPI_CONNECTION_IR: return "IR"; //$NON-NLS-1$
case RAPI_CONNECTION_SERIAL: return "Serial"; //$NON-NLS-1$
case RAPI_CONNECTION_NETWORK: return "Network"; //$NON-NLS-1$
}
return "Unknown";
return "Unknown"; //$NON-NLS-1$
}
}

View file

@ -26,7 +26,7 @@ public class RapiException extends Exception {
}
public RapiException(String msg, int errCode) {
super(msg + " errorCode: 0x" + Integer.toHexString(errCode));
super(msg + " errorCode: 0x" + Integer.toHexString(errCode)); //$NON-NLS-1$
this.errorCode = errCode;
}