Affix
view release on metacpan or search on metacpan
infix/src/core/loader.c view on Meta::CPAN
return nullptr;
#if defined(INFIX_OS_WINDOWS)
return (void *)GetProcAddress((HMODULE)lib->handle, symbol_name);
#else
return dlsym(lib->handle, symbol_name);
#endif
}
/**
* @brief Reads the value of an exported global variable from a library into a buffer.
*
* This function first looks up the symbol's address. It then uses the `infix`
* signature parser (`infix_type_from_signature`) to determine the size of the
* variable. This ensures that the correct number of bytes are copied from the
* library's data segment into the user's buffer, preventing buffer overflows.
*
* @param[in] lib The library handle.
* @param[in] symbol_name The name of the global variable.
* @param[in] type_signature The `infix` signature string describing the variable's type (e.g., `"int32"`,
* `"{double,double}"`).
* @param[out] buffer A pointer to the destination buffer to receive the data. This buffer must be large enough to hold
* the type described by the signature.
( run in 2.818 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )