lib: Rename frrscript_unload to delete

frrscript_load now loads a function instead of a file, so frrscript_unload
should be renamed since it does not unload a function.

Signed-off-by: Donald Lee <dlqs@gmx.com>
This commit is contained in:
Donald Lee 2021-07-08 17:51:14 +08:00
parent 8a04c1e74e
commit 64d457d7ac
5 changed files with 5 additions and 5 deletions

View File

@ -434,7 +434,7 @@ route_match_script(void *rule, const struct prefix *prefix, void *object)
break;
}
frrscript_unload(fs);
frrscript_delete(fs);
return status;
}

View File

@ -2443,7 +2443,7 @@ DEFUN(script,
vty_out(vty, "p: %s\n", buf);
vty_out(vty, "Script result: %d\n", ret);
frrscript_unload(fs);
frrscript_delete(fs);
return CMD_SUCCESS;
}

View File

@ -319,7 +319,7 @@ fail:
return 1;
}
void frrscript_unload(struct frrscript *fs)
void frrscript_delete(struct frrscript *fs)
{
hash_iterate(fs->lua_function_hash, lua_function_free, NULL);
XFREE(MTYPE_SCRIPT, fs->name);

View File

@ -89,7 +89,7 @@ int frrscript_load(struct frrscript *fs, const char *function_name,
/*
* Destroy FRR script.
*/
void frrscript_unload(struct frrscript *fs);
void frrscript_delete(struct frrscript *fs);
/*
* Register a Lua codec for a type.

View File

@ -98,7 +98,7 @@ int main(int argc, char **argv)
result = frrscript_call(fs, "bad_return4");
assert(result == 1);
frrscript_unload(fs);
frrscript_delete(fs);
return 0;
}