mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 11:30:55 +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, \
|
.attr = attrs, \
|
||||||
.daemon = dnum, \
|
.daemon = dnum, \
|
||||||
.name = #cmdname, \
|
.name = #cmdname, \
|
||||||
};
|
.xref = XREF_INIT(XREFT_DEFUN, NULL, #funcname), \
|
||||||
|
}; \
|
||||||
|
XREF_LINK(cmdname.xref); \
|
||||||
|
/* end */
|
||||||
|
|
||||||
|
|
||||||
#define DEFUN_CMD_FUNC_DECL(funcname) \
|
#define DEFUN_CMD_FUNC_DECL(funcname) \
|
||||||
static int funcname(const struct cmd_element *, struct vty *, int, \
|
static int funcname(const struct cmd_element *, struct vty *, int, \
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
|
#include "xref.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -105,6 +106,7 @@ struct cmd_element {
|
|||||||
struct cmd_token *[]);
|
struct cmd_token *[]);
|
||||||
|
|
||||||
const char *name; /* symbol name for debugging */
|
const char *name; /* symbol name for debugging */
|
||||||
|
struct xref xref;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* text for <cr> command */
|
/* text for <cr> command */
|
||||||
|
@ -29,6 +29,8 @@ enum xref_type {
|
|||||||
XREFT_THREADSCHED = 0x100,
|
XREFT_THREADSCHED = 0x100,
|
||||||
|
|
||||||
XREFT_LOGMSG = 0x200,
|
XREFT_LOGMSG = 0x200,
|
||||||
|
|
||||||
|
XREFT_DEFUN = 0x300,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* struct xref is the "const" part; struct xrefdata is the writable part. */
|
/* struct xref is the "const" part; struct xrefdata is the writable part. */
|
||||||
|
Loading…
Reference in New Issue
Block a user