diff options
| author | Donald Lee <dlqs@gmx.com> | 2021-06-14 14:54:58 +0800 |
|---|---|---|
| committer | Donald Lee <dlqs@gmx.com> | 2021-06-22 04:51:22 +0800 |
| commit | 43a5106d42b6054ca1dbdee7d455a5212c3094ca (patch) | |
| tree | 6ce00b0d13c73aeead3db705b45821e8eb8afc1b /lib/frrscript.c | |
| parent | 249cd5daa70e32163fda202d27cfe5839eee0e6d (diff) | |
lib: make frrscript_call encode args based on type
Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'lib/frrscript.c')
| -rw-r--r-- | lib/frrscript.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/frrscript.c b/lib/frrscript.c index 10d400886d..1a9f3639dd 100644 --- a/lib/frrscript.c +++ b/lib/frrscript.c @@ -104,24 +104,8 @@ static void codec_free(struct codec *c) /* Generic script APIs */ -int frrscript_call(struct frrscript *fs, struct frrscript_env *env) +int _frrscript_call(struct frrscript *fs) { - struct frrscript_codec c = {}; - const void *arg; - const char *bindname; - - /* Encode script arguments */ - for (int i = 0; env && env[i].val != NULL; i++) { - bindname = env[i].name; - c.typename = env[i].typename; - arg = env[i].val; - - struct frrscript_codec *codec = hash_lookup(codec_hash, &c); - assert(codec && "No encoder for type"); - codec->encoder(fs->L, arg); - - lua_setglobal(fs->L, bindname); - } int ret = lua_pcall(fs->L, 0, 0, 0); |
