diff options
| author | David Lamparter <equinox@diac24.net> | 2019-11-14 23:27:29 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-11-30 00:38:32 +0100 |
| commit | 154e9ca142bddf748f12a8042519ec6438364625 (patch) | |
| tree | d96c1306241b608e8c2048f73862a369abaa5470 /lib/command.h | |
| parent | fa751d15a01c976058cad8492be4b5c8226edae7 (diff) | |
lib: make cmd_element & qobj_type const
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/command.h')
| -rw-r--r-- | lib/command.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/command.h b/lib/command.h index 68ac86f769..c8dd04604d 100644 --- a/lib/command.h +++ b/lib/command.h @@ -165,7 +165,7 @@ enum node_type { extern vector cmdvec; extern const struct message tokennames[]; -extern const char *node_names[]; +extern const char *const node_names[]; /* Node which has some commands and prompt string and configuration function pointer . */ @@ -217,7 +217,7 @@ struct cmd_node { /* helper defines for end-user DEFUN* macros */ #define DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, attrs, dnum) \ - static struct cmd_element cmdname = { \ + static const struct cmd_element cmdname = { \ .string = cmdstr, \ .func = funcname, \ .doc = helpstr, \ @@ -421,11 +421,11 @@ struct cmd_node { /* Prototypes. */ extern void install_node(struct cmd_node *, int (*)(struct vty *)); extern void install_default(enum node_type); -extern void install_element(enum node_type, struct cmd_element *); +extern void install_element(enum node_type, const struct cmd_element *); /* known issue with uninstall_element: changes to cmd_token->attr (i.e. * deprecated/hidden) are not reversed. */ -extern void uninstall_element(enum node_type, struct cmd_element *); +extern void uninstall_element(enum node_type, const struct cmd_element *); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated string with a space between each element (allocated using |
