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
Filter by
Sorted by
Tagged with
8 votes
0 answers

.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++ ...
Gil Mans's user avatar
5 votes
0 answers

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 ...
Trekkie's user avatar
  • 151
4 votes
1 answer

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 ...
arcadeperfect's user avatar
4 votes
0 answers

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 ...
Luke's user avatar
  • 501
4 votes
0 answers

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 ...
bsa's user avatar
  • 795
3 votes
0 answers

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 ...
kolrie's user avatar
  • 131
3 votes
0 answers

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 ...
CafféSospeso's user avatar
3 votes
0 answers

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 ...
Andrew Kravchuk's user avatar
3 votes
0 answers

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-...
Vince W.'s user avatar
  • 131
2 votes
0 answers

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:
user1261710's user avatar
2 votes
0 answers

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 ...
oczkoisse's user avatar
  • 121
1 vote
0 answers

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: After the code there also couple of theory questions which ...
Sergey Kaunov's user avatar