mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 11:48:50 +00:00
lib/xref: add xrefs for DEFUNs
This allows grabbing a list of all DEFUNs and their help texts through the xref extraction mechanics. Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
parent
131879fb92
commit
feb06e7a93
@ -239,7 +239,11 @@ struct cmd_node {
|
||||
.attr = attrs, \
|
||||
.daemon = dnum, \
|
||||
.name = #cmdname, \
|
||||
};
|
||||
.xref = XREF_INIT(XREFT_DEFUN, NULL, #funcname), \
|
||||
}; \
|
||||
XREF_LINK(cmdname.xref); \
|
||||
/* end */
|
||||
|
||||
|
||||
#define DEFUN_CMD_FUNC_DECL(funcname) \
|
||||
static int funcname(const struct cmd_element *, struct vty *, int, \
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "memory.h"
|
||||
#include "vector.h"
|
||||
#include "graph.h"
|
||||
#include "xref.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -105,6 +106,7 @@ struct cmd_element {
|
||||
struct cmd_token *[]);
|
||||
|
||||
const char *name; /* symbol name for debugging */
|
||||
struct xref xref;
|
||||
};
|
||||
|
||||
/* text for <cr> command */
|
||||
|
@ -29,6 +29,8 @@ enum xref_type {
|
||||
XREFT_THREADSCHED = 0x100,
|
||||
|
||||
XREFT_LOGMSG = 0x200,
|
||||
|
||||
XREFT_DEFUN = 0x300,
|
||||
};
|
||||
|
||||
/* struct xref is the "const" part; struct xrefdata is the writable part. */
|
||||
|
Loading…
Reference in New Issue
Block a user