diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-03-22 14:57:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-22 14:57:35 +0100 |
commit | fbe2722941f10bfb0883af216959445a5446cbd3 (patch) | |
tree | 2fc39ec8cd67b8913a7bf1d565fad6f6ca5ad923 /lib.c | |
parent | 3eaca1db52be980f62aed281fedf319eff599fbd (diff) | |
parent | 8b5dc6079f1f9fcfb6535ba305c9352488bdd5ab (diff) |
Merge pull request #59 from jow-/stdlib-function-getter
lib: provide API function to obtain stdlib function implementations
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -3194,3 +3194,15 @@ uc_stdlib_load(uc_value_t *scope) { uc_function_list_register(scope, uc_stdlib_functions); } + +uc_cfn_ptr_t +uc_stdlib_function(const char *name) +{ + size_t i; + + for (i = 0; i < ARRAY_SIZE(uc_stdlib_functions); i++) + if (!strcmp(uc_stdlib_functions[i].name, name)) + return uc_stdlib_functions[i].func; + + return NULL; +} |