diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-31 18:31:11 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-31 18:31:11 +0100 |
| commit | 430778293e4ce7c2ae418ff11601d61833b99a67 (patch) | |
| tree | ffecb08293844375252de54f63ecd99e3dd8ec3d /src/plugins/PluginAPI.hpp | |
| parent | de3b00b5eea6fae5fd55164af06342c82a31d108 (diff) | |
plugins: Add an API entry for finding functions by name
Diffstat (limited to 'src/plugins/PluginAPI.hpp')
| -rw-r--r-- | src/plugins/PluginAPI.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/PluginAPI.hpp b/src/plugins/PluginAPI.hpp index 813d7462..ff1f1ffe 100644 --- a/src/plugins/PluginAPI.hpp +++ b/src/plugins/PluginAPI.hpp @@ -33,6 +33,12 @@ typedef struct { std::string version; } PLUGIN_DESCRIPTION_INFO; +struct SFunctionMatch { + void* address = nullptr; + std::string signature; + std::string demangled; +}; + #define APICALL extern "C" #define EXPORT __attribute__((visibility("default"))) #define REQUIRED @@ -230,4 +236,13 @@ namespace HyprlandAPI { returns: true on success. False otherwise. */ APICALL bool addNotificationV2(HANDLE handle, const std::unordered_map<std::string, std::any>& data); + + /* + Returns a vector of found functions matching the provided name. + + These addresses will not change, and should be made static. Lookups are slow. + + Empty means either none found or handle was invalid + */ + APICALL std::vector<SFunctionMatch> findFunctionsByName(HANDLE handle, const std::string& name); };
\ No newline at end of file |
