mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:33:15 +00:00
lib: make encoder type a typedef
Need to use it for casts regularly. Signed-off-by: Quentin Young <qlyoung@nvidia.com>
This commit is contained in:
parent
3d19ffc5ef
commit
f944ec671c
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
struct encoder {
|
struct encoder {
|
||||||
char *typename;
|
char *typename;
|
||||||
int (*encoder)(struct lua_State *, const void *);
|
encoder_func encoder;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hash *encoder_hash;
|
struct hash *encoder_hash;
|
||||||
@ -82,7 +82,7 @@ int frrscript_lua_call(struct frrscript *fs, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void frrscript_register_type_encoder(const char *typename,
|
void frrscript_register_type_encoder(const char *typename,
|
||||||
int (*encoder)(lua_State *L, void *))
|
encoder_func encoder)
|
||||||
{
|
{
|
||||||
struct encoder e = {
|
struct encoder e = {
|
||||||
.typename = (char *) typename,
|
.typename = (char *) typename,
|
||||||
|
@ -27,6 +27,8 @@ extern "C" {
|
|||||||
|
|
||||||
#define FRRSCRIPT_PATH "/etc/frr/scripts"
|
#define FRRSCRIPT_PATH "/etc/frr/scripts"
|
||||||
|
|
||||||
|
typedef int (*encoder_func)(struct lua_State *, const void *);
|
||||||
|
|
||||||
struct frrscript {
|
struct frrscript {
|
||||||
/* Script name */
|
/* Script name */
|
||||||
char *name;
|
char *name;
|
||||||
@ -59,8 +61,7 @@ void frrscript_unload(struct frrscript *fs);
|
|||||||
* associated with the chosen 'tname' to the provided stack.
|
* associated with the chosen 'tname' to the provided stack.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void frrscript_register_type_encoder(const char *tname,
|
void frrscript_register_type_encoder(const char *tname, encoder_func encoder);
|
||||||
int (*encoder)(lua_State *, void *));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize scripting subsystem. Call this before anything else.
|
* Initialize scripting subsystem. Call this before anything else.
|
||||||
|
Loading…
Reference in New Issue
Block a user