Questions tagged [ffi]
Machine code and assembly code is sometimes called native code when referring to platform-dependent parts of language features or libraries.
12
questions with no upvoted or accepted answers
8
votes
0
answers
340
views
.NET DLL Injector in C++
I built a DLL Injector with User-Interface.
The program lists all processes, the user chooses one of them and a DLL, and inject it.
It's my first project in C++, and I know it's not exactly C++ ...
5
votes
0
answers
713
views
Calculating complex exponential numbers using OpenMP in Cython
I am trying to create a function that can either beat numexpr or perform comparably for the vectorized mathematical operation ...
4
votes
1
answer
93
views
C# wrapper that binds to Rust FFI, for the purpose of running CavalierContours functions in Unity
I have attempted to write c# bindings for a Rust library. I have never worked with unmanned code / languages before. Superficially this code does work with no apparent bugs or memory leaks.
I want to ...
4
votes
0
answers
146
views
C++ Trie implementation with Python wrapper
I'm just starting to use C++ so beginner feedback is fine here.
CPP code
(main.cpp, node.h, node.cpp, trie.h, trie.cpp, utils.h)
main.cpp
...
4
votes
0
answers
229
views
Reduce encoded length of UTF-8 encoded Ruby string in C extension
I'm writing a Ruby extension in C. It's a string processing module working on UTF-8 encoded strings only.
One method, full_width_to_ascii!, converts full width ...
3
votes
0
answers
29
views
Unsafe Rust FFI code to access Razer products on macOS
I am new to Rust and specially new to FFI programming, and I am porting a macOS specific C library called librazermacos to Rust.
While writing some public APIs I came up with my first two methods ...
3
votes
0
answers
789
views
Return a 2D matrix from a C++ function in Python: ctypes versus pybind11
I found two ways in which I can use a custom C++ function (returning a 2D matrix) in Python. One approach that uses the Python module ctypes and another that uses the Python module pybind11.
Approach ...
3
votes
0
answers
124
views
Racket macro for variadic FFI
I'm working on FFI wrapper for SDL2 library in Racket. The library includes several variadic functions (e.g. SDL_SetError, SDL_LogMessage etc); Racket FFI does not have straight way for importing ...
3
votes
0
answers
118
views
Launcher for python.exe within a self-contained application package
Below is code modified from the source code for python.exe. The motivation is to be able to build a suite of python applications that can be distributed with an installer, that share an isolated run-...
2
votes
0
answers
167
views
NativeScript - Angular Service to watch iOS keyboard event listeners
I'm writing an app with NativeScript 6.4.1 and Angular version 8.
There are a series of UI events in iOS that you can watch to see what the keyboard is doing:
https://developer.apple.com/...
2
votes
0
answers
1k
views
Wrapping C++ library in C++/CLI using shared_ptr
Background: I'm writing C++ code after a fairly long time, so I may not be up to date on the best practices, so please bear with me. I'm only trying to improve and learn.
Problem I need to write a ...
1
vote
0
answers
42
views
Reading (typed) data from file over FFI with `libc`
This is a solution for a workshop which gave me some problems. This solution also available via git: https://github.com/skaunov/6991_ws09/. After the code there also couple of theory questions which ...