long /*int*/ lower = C.malloc (bytes.length); C.memmove (lower, bytes, bytes.length); range.lower = lower; range.lowerInclusive = LowerRangeInclusive; long /*int*/ upper = C.malloc (bytes.length); C.memmove (upper, bytes, bytes.length); range.upper = upper; range.upperInclusive = UpperRangeInclusive; long /*int*/ name = C.malloc (bytes.length); C.memmove (name, bytes, bytes.length); property.property = name; bytes = MozillaDelegate.wcsToMbcs (null, Arch () + GCC3, true); long /*int*/ value = C.malloc (bytes.length); C.memmove (value, bytes, bytes.length); property.value = value; long /*int*/ greBuffer = C.malloc (length); int rc = XPCOMInit.GRE_GetGREPathWithProperties (range, 1, property, 1, greBuffer, length); C.free (lower); bytes = MozillaDelegate.wcsToMbcs (null, GRERANGE_LOWER_FALLBACK, true); lower = C.malloc (bytes.length); C.memmove (lower, bytes, bytes.length); range.lower = lower; rc = XPCOMInit.GRE_GetGREPathWithProperties (range, 1, property, 0, greBuffer, length); /* note: propertiesLength is 0 */ C.free (value);
static String getProfilePath () { String baseDir = System.getProperty ("user.home"); //$NON-NLS-1$ /* * Bug in Sun JRE. Under some circumstances the value of java property "user.home" is * "?", even when the HOME environment variable has a valid value. If this happens * then attempt to read the value from the environment directly. */ if (baseDir.equals ("?")) { //$NON-NLS-1$ long /*int*/ ptr = C.getenv (wcsToMbcs (null, "HOME", true)); //$NON-NLS-1$ if (ptr != 0) { int length = C.strlen (ptr); byte[] bytes = new byte[length]; C.memmove (bytes, ptr, length); baseDir = new String (mbcsToWcs (null, bytes)); } } return baseDir + Mozilla.SEPARATOR_OS + ".mozilla" + Mozilla.SEPARATOR_OS + "eclipse"; //$NON-NLS-1$ //$NON-NLS-2$ }
int size = XPCOM.nsDynamicFunctionLoad_sizeof (); long /*int*/ ptr = C.malloc (size * 2); C.memset (ptr, 0, size * 2); nsDynamicFunctionLoad functionLoad = new nsDynamicFunctionLoad (); byte[] bytes = MozillaDelegate.wcsToMbcs (null, "XRE_NotifyProfile", true); //$NON-NLS-1$ functionLoad.functionName = C.malloc (bytes.length); C.memmove (functionLoad.functionName, bytes, bytes.length); functionLoad.function = C.malloc (C.PTR_SIZEOF); C.memmove (functionLoad.function, new long /*int*/[] {0} , C.PTR_SIZEOF); XPCOM.memmove (ptr, functionLoad, XPCOM.nsDynamicFunctionLoad_sizeof ()); XPCOM.XPCOMGlueLoadXULFunctions (ptr); C.memmove (result, functionLoad.function, C.PTR_SIZEOF); long /*int*/ functionPtr = result[0]; result[0] = 0; C.free (functionLoad.function); C.free (functionLoad.functionName); C.free (ptr);
if (rc != XPCOM.NS_OK) Mozilla.error (rc); } else { int /*long*/ arrayPtr = C.malloc (C.PTR_SIZEOF * length); for (int i = 0; i < length; i++) { Object currentObject = arrayValue[i]; try { nsIVariant currentVariant = convertToJS (currentObject, componentManager); C.memmove (arrayPtr + C.PTR_SIZEOF * i, new int /*long*/[] {currentVariant.getAddress ()}, C.PTR_SIZEOF); } catch (SWTException e) { C.free (arrayPtr); variant.Release (); C.memmove (ptr, arrayPtr + C.PTR_SIZEOF * j, C.PTR_SIZEOF); new nsISupports (ptr[0]).Release (); int /*long*/ idPtr = C.malloc (nsID.sizeof); XPCOM.memmove (idPtr, IIDStore.GetIID (nsIVariant.class), nsID.sizeof); rc = variant.SetAsArray (nsIDataType.VTYPE_INTERFACE_IS, idPtr, length, arrayPtr); C.free (idPtr); C.free (arrayPtr); if (rc != XPCOM.NS_OK) Mozilla.error (rc);
int getFlags (int /*long*/ flags) { C.memmove (flags, new int[] {nsIClassInfo.DOM_OBJECT}, 4); /* PRUint32 */ return XPCOM.NS_OK; }
result[0] = 0; long /*int*/ jsVal = memory.Alloc (jsval_sizeof); C.memset (jsVal, 0, jsval_sizeof); long /*int*/ globalObject = XPCOM.JS_GetGlobalObject (Mozilla.getJSLibPathBytes (), cx); rc = connect.VariantToJS (cx, globalObject, resultVariant.getAddress (), jsVal); if (rc == XPCOM.NS_OK) { C.memmove (vp, jsVal, jsval_sizeof); returnValue = XPCOM.JS_TRUE;
int /*long*/ body = WebKitGTK.SoupMessage_request_body (message); byte[] bytes = Converter.wcsToMbcs (null, postData, false); int /*long*/ data = C.malloc (bytes.length); C.memmove (data, bytes, bytes.length); WebKitGTK.soup_message_body_append (body, WebKitGTK.SOUP_MEMORY_TAKE, data, bytes.length); WebKitGTK.soup_message_body_flatten (body);
public XPCOMObject (int[] argCounts) { int /*long*/[] callbackAddresses = new int /*long*/[argCounts.length + OS_OFFSET]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++) { if ((Callbacks[i + OS_OFFSET][argCounts[i]]) == null) { Callbacks[i + OS_OFFSET][argCounts[i]] = new Callback (getClass (), "callback"+i, argCounts[i] + 1, true, XPCOM.NS_ERROR_FAILURE); //$NON-NLS-1$ } callbackAddresses[i + OS_OFFSET] = Callbacks[i + OS_OFFSET][argCounts[i]].getAddress (); if (callbackAddresses[i + OS_OFFSET] == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } } int /*long*/ pVtable = C.malloc (C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); XPCOM.memmove (pVtable, callbackAddresses, C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); ppVtable = C.malloc (C.PTR_SIZEOF); XPCOM.memmove (ppVtable, new int /*long*/[] {pVtable}, C.PTR_SIZEOF); ObjectMap.put (new LONG (ppVtable), this); }
int length = C.strlen (uriString); byte[] bytes = new byte[length]; OS.memmove (bytes, uriString, length);
int size = XPCOM.nsDynamicFunctionLoad_sizeof (); long /*int*/ ptr = C.malloc (size * 2); C.memset (ptr, 0, size * 2); nsDynamicFunctionLoad functionLoad = new nsDynamicFunctionLoad (); byte[] bytes = MozillaDelegate.wcsToMbcs (null, "XRE_NotifyProfile", true); //$NON-NLS-1$ functionLoad.functionName = C.malloc (bytes.length); C.memmove (functionLoad.functionName, bytes, bytes.length); functionLoad.function = C.malloc (C.PTR_SIZEOF); C.memmove (functionLoad.function, new long /*int*/[] {0} , C.PTR_SIZEOF); XPCOM.memmove (ptr, functionLoad, XPCOM.nsDynamicFunctionLoad_sizeof ()); XPCOM.XPCOMGlueLoadXULFunctions (ptr); C.memmove (result, functionLoad.function, C.PTR_SIZEOF); long /*int*/ functionPtr = result[0]; result[0] = 0; C.free (functionLoad.function); C.free (functionLoad.functionName); C.free (ptr);
if (rc != XPCOM.NS_OK) Mozilla.error (rc); } else { long /*int*/ arrayPtr = C.malloc (C.PTR_SIZEOF * length); for (int i = 0; i < length; i++) { Object currentObject = arrayValue[i]; try { nsIVariant currentVariant = convertToJS (currentObject, componentManager); C.memmove (arrayPtr + C.PTR_SIZEOF * i, new long /*int*/[] {currentVariant.getAddress ()}, C.PTR_SIZEOF); } catch (SWTException e) { C.free (arrayPtr); variant.Release (); C.memmove (ptr, arrayPtr + C.PTR_SIZEOF * j, C.PTR_SIZEOF); new nsISupports (ptr[0]).Release (); long /*int*/ idPtr = C.malloc (nsID.sizeof); XPCOM.memmove (idPtr, Mozilla.IsPre_4 ? nsIVariant.NS_IVARIANT_IID : nsIVariant.NS_IVARIANT_10_IID, nsID.sizeof); rc = variant.SetAsArray (nsIDataType.VTYPE_INTERFACE_IS, idPtr, length, arrayPtr); C.free (idPtr); C.free (arrayPtr); if (rc != XPCOM.NS_OK) Mozilla.error (rc);
int getFlags (int /*long*/ flags) { C.memmove (flags, new int[] {nsIClassInfo.DOM_OBJECT}, 4); /* PRUint32 */ return XPCOM.NS_OK; }
long /*int*/ body = WebKitGTK.SoupMessage_request_body (message); byte[] bytes = Converter.wcsToMbcs (null, postData, false); long /*int*/ data = C.malloc (bytes.length); C.memmove (data, bytes, bytes.length); WebKitGTK.soup_message_body_append (body, WebKitGTK.SOUP_MEMORY_TAKE, data, bytes.length); WebKitGTK.soup_message_body_flatten (body);
public XPCOMObject (int[] argCounts) { long /*int*/[] callbackAddresses = new long /*int*/[argCounts.length + OS_OFFSET]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++) { if ((Callbacks[i + OS_OFFSET][argCounts[i]]) == null) { Callbacks[i + OS_OFFSET][argCounts[i]] = new Callback (getClass (), "callback"+i, argCounts[i] + 1, true, XPCOM.NS_ERROR_FAILURE); //$NON-NLS-1$ } callbackAddresses[i + OS_OFFSET] = Callbacks[i + OS_OFFSET][argCounts[i]].getAddress (); if (callbackAddresses[i + OS_OFFSET] == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } } long /*int*/ pVtable = C.malloc (C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); XPCOM.memmove (pVtable, callbackAddresses, C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); ppVtable = C.malloc (C.PTR_SIZEOF); XPCOM.memmove (ppVtable, new long /*int*/[] {pVtable}, C.PTR_SIZEOF); ObjectMap.put (new LONG (ppVtable), this); }
int length = C.strlen (uriString); byte[] bytes = new byte[length]; OS.memmove (bytes, uriString, length);