@napi-ffi/get-symbol-from-current-process-h
v1.0.4
Published
C function to get a symbol from the current process
Maintainers
Readme
@napi-ffi/get-symbol-from-current-process-h
Cross-platform C function to get a symbol from the current process
This package provides a header-only C library for retrieving symbols from the current process in a cross-platform manner. It works on Unix-like systems (using dlsym) and Windows (using GetProcAddress).
Originally authored by Anna Henningsen as part of the node-ffi-napi project. This is a maintained fork under the @napi-ffi organization.
Installation
Install with npm:
npm install @napi-ffi/get-symbol-from-current-process-hUsage
In your binding.gyp:
'include_dirs': [
"<!@(node -p \"require('@napi-ffi/get-symbol-from-current-process-h').include\")"
]In your C/C++ code:
#include <get-symbol-from-current-process.h>
void* sym = get_symbol_from_current_process("my_function");
if (sym != NULL) {
// Use the symbol
}API
void* get_symbol_from_current_process(const char* name)
Retrieves a symbol from the current process by name.
Parameters:
name: The name of the symbol to retrieve (must not be NULL)
Returns:
- Pointer to the symbol if found
NULLif the symbol is not found or an error occurs
This package requires Node.js >= 20.0.0
License
ISC License - See LICENSE file for details
