Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* The "ffi_type" is set for node-ffi functions.
*/
Function.prototype.ffi_type = bindings.FFI_TYPES.pointer;
/**
* The "size" is always pointer-sized.
*/
Function.prototype.size = ref.sizeof.pointer;
/**
* The "alignment" is always pointer-aligned.
*/
Function.prototype.alignment = ref.alignof.pointer;
/**
* The "indirection" is always 1 to ensure that our get()/set() get called.
*/
Function.prototype.indirection = 1;
/**
* Returns a ffi.Callback pointer (Buffer) of this function type for the
* given `fn` Function.
*/
Function.prototype.toPointer = function toPointer (fn) {
return Callback(this.retType, this.argTypes, this.abi, fn);
};