Search completed in 1.14 seconds.
7 results for "unsigned_long":
Using Objective-C from js-ctypes
Mozillajs-ctypesExamplesUsing Objective-C from js-ctypes
ng encoding:(nsstringencoding)encoding and nsstringencoding is defined as: typedef unsigned long nsuinteger; typedef nsuinteger nsstringencoding; so, our function call can be converted into the following js-ctypes code: let text = objc_msgsend(tmp2, initwithcstring_encoding, ctypes.char.array()("hello, firefox!"), ctypes.unsigned_long(nsutf8stringencoding)); converted js-ctypes code finally, we have our converted code.
...jc_msgsend(tmp, initwithvoice, ctypes.voidptr_t(null)); let nsstring = objc_getclass("nsstring"); let initwithcstring_encoding = sel_registername("initwithcstring:encoding:"); let nsutf8stringencoding = 4; let tmp2 = objc_msgsend(nsstring, alloc); let text = objc_msgsend(tmp2, initwithcstring_encoding, ctypes.char.array()("hello, firefox!"), ctypes.unsigned_long(nsutf8stringencoding)); let startspeakingstring = sel_registername("startspeakingstring:"); objc_msgsend(synth, startspeakingstring, text); let isspeaking = sel_registername("isspeaking"); // wait until start speaking.
... */ // struct is seen here in docs: http://clang.llvm.org/docs/block-abi-apple.html var block_descriptor_1 = ctypes.structtype('block_descriptor_1', [ { reserved: ctypes.unsigned_long_long }, { size: ctypes.unsigned_long_long } ]); /** * we have to simulate what the llvm compiler does when it encounters a block * literal expression (see `block-abi-apple.txt` above).
Finding window handles - Archive of obsolete content
ArchiveAdd-onsCode snippetsFinding Window Handles
ctypes.unsigned_int : ctypes.unsigned_long; var xid = card32; var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var gdk_x11_drawable_get_xid = gdk.declare('gdk_x11_drawable_get_xid', ctypes.default_abi, xid, gdkdrawable.ptr); var gdkwindowptrstring = basewindow.nativehandle; var gdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); var gdkdrawptr = ctypes.cast(gdkwinptr, gdkdrawable.ptr); var xidofwin = gdk_x11_drawable_get_xid(gd...
...dules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var x11 = ctypes.open('libx11.so.6'); // types let guint32 = ctypes.uint32_t; let gdkwindow = ctypes.structtype('gdkwindow'); let gdkdrawable = ctypes.structtype('gdkdrawable'); let card32; if (/^(alpha|hppa|ia64|ppc64|s390|x86_64)-/.test(services.appinfo.xpcomabi)) { card32 = ctypes.unsigned_int; } else { card32 = ctypes.unsigned_long; } let xid = card32; //https://developer.gnome.org/gdk2/stable/gdk2-x-window-system-interaction.html#gdk-x11-drawable-get-xid var gdk_x11_drawable_get_xid = gdk.declare('gdk_x11_drawable_get_xid', ctypes.default_abi, xid, gdkdrawable.ptr); var browserwindow_madeintogdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); var browserwindow_madeintogdkdrawable = ctypes.cast(browserwindow_m...
ctypes
Mozillajs-ctypesjs-ctypes referencectypes
unsigned_long an unsigned long integer type that behaves like the corresponding c type on the platform.
... unsigned_long_long an unsigned integer type at least 64 bits wide.
Using COM from js-ctypes
Mozillajs-ctypesExamplesUsing COM from js-ctypes
ctypes.default_abi : ctypes.stdcall_abi; // libraries let lib = ctypes.open('ole32.dll'); // types // simple types let byte = ctypes.unsigned_char; let dword = ctypes.unsigned_long; let long = ctypes.long; let lpvoid = ctypes.voidptr_t; let void = ctypes.void_t; let ulong = ctypes.unsigned_long; let ushort = ctypes.unsigned_short; let wchar = ctypes.jschar; // advanced types - based on simple types let hresult = long; let lpcwstr = wchar.ptr; // guess types - these just work i couldnt find a proper defintion for it let lpunknown = ctypes.voidptr_t; // structures // simpl...
Declaring and Calling Functions
Mozillajs-ctypesUsing js-ctypesDeclaring and calling functions
const clock = lib.declare("clock", ctypes.default_abi, ctypes.unsigned_long); console.log("clocks since startup: " + clock()); the clock() function requires no input parameters; it simply returns an unsigned long.
Type conversion
Mozillajs-ctypesUsing js-ctypesType conversion
t8_t ctypes.int16_t ctypes.uint16_t ctypes.short ctypes.unsigned_short ctypes.int32_t ctypes.uint32_t ctypes.int ctypes.unsigned_int ctypes.long_long ctypes.uint64_t ctypes.uint8_t ctypes.uint16_t ctypes.unsigned_short ctypes.uint32_t ctypes.unsigned_int ctypes.unsigned_long_long ctypes.long_long ctypes.int8_t ctypes.uint8_t ctypes.int16_t ctypes.uint16_t ctypes.short ctypes.unsigned_short ctypes.int32_t ctypes.uint32_t ctypes.int ctypes.unsigned_int ctypes.int64_t ctypes.unsigned_long_long ctypes.uint8_t ctypes.uint16_t ctypes.unsigned_...
Using js-ctypes
Mozillajs-ctypesUsing js-ctypes
cu.import('resource://gre/modules/ctypes.jsm'); var libcf = ctypes.open('/system/library/frameworks/corefoundation.framework/corefoundation'); // define types var cfindex = ctypes.long; var cfoptionflags = ctypes.unsigned_long; var cftimeinterval = ctypes.double; var cftyperef = ctypes.voidptr_t; var sint32 = ctypes.long; var void = ctypes.void_t; var __cfstring = new ctypes.structtype("__cfstring"); var cfstringref = __cfstring.ptr; var __cfurl = new ctypes.structtype("__cfurl"); var cfurlref = __cfurl.ptr; var __cfallocator = new ctypes.structtype("__cfallocator"); var cfallocatorref = __cfallocator.ptr; var unic...