vtysh: fix function prototypes
This makes a whole bunch of vtysh functions static, fixes prototypes for
a few more, and masks user_free() and user_write_config() (both unused.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 5490b33..d64b4e0 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -251,7 +251,7 @@
}
}
-void
+static void
vtysh_exit_ripd_only (void)
{
if (ripd_client)
@@ -547,7 +547,7 @@
}
/* We don't care about the point of the cursor when '?' is typed. */
-int
+static int
vtysh_rl_describe (void)
{
int ret;
@@ -821,7 +821,7 @@
extern struct cmd_node vty_node;
/* When '^Z' is received from vty, move down to the enable mode. */
-int
+static int
vtysh_end (void)
{
switch (vty->node)
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index f9cb6a7..1ddaac0 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -47,19 +47,19 @@
struct list *config_top;
-int
+static int
line_cmp (char *c1, char *c2)
{
return strcmp (c1, c2);
}
-void
+static void
line_del (char *line)
{
XFREE (MTYPE_VTYSH_CONFIG_LINE, line);
}
-struct config *
+static struct config *
config_new ()
{
struct config *config;
@@ -67,13 +67,13 @@
return config;
}
-int
+static int
config_cmp (struct config *c1, struct config *c2)
{
return strcmp (c1->name, c2->name);
}
-void
+static void
config_del (struct config* config)
{
list_delete (config->line);
@@ -82,7 +82,7 @@
XFREE (MTYPE_VTYSH_CONFIG, config);
}
-struct config *
+static struct config *
config_get (int index, const char *line)
{
struct config *config;
@@ -121,13 +121,13 @@
return config;
}
-void
+static void
config_add_line (struct list *config, const char *line)
{
listnode_add (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line));
}
-void
+static void
config_add_line_uniq (struct list *config, const char *line)
{
struct listnode *node, *nnode;
@@ -141,7 +141,7 @@
listnode_add_sort (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line));
}
-void
+static void
vtysh_config_parse_line (const char *line)
{
char c;
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index 893c1a1..d243670 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -63,7 +63,7 @@
FILE *logfile;
/* SIGTSTP handler. This function care user's ^Z input. */
-void
+static void
sigtstp (int sig)
{
/* Execute "end" command. */
@@ -84,7 +84,7 @@
}
/* SIGINT handler. This function care user's ^Z input. */
-void
+static void
sigint (int sig)
{
/* Check this process is not child process. */
@@ -121,7 +121,7 @@
}
/* Initialization of signal handles. */
-void
+static void
vtysh_signal_init ()
{
vtysh_signal_set (SIGINT, sigint);
@@ -168,7 +168,7 @@
};
/* Read a string, and return a pointer to it. Returns NULL on EOF. */
-char *
+static char *
vtysh_rl_gets ()
{
HIST_ENTRY *last;
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c
index 8f2cf42..e1c611c 100644
--- a/vtysh/vtysh_user.c
+++ b/vtysh/vtysh_user.c
@@ -99,19 +99,21 @@
struct list *userlist;
-struct vtysh_user *
+static struct vtysh_user *
user_new ()
{
return XCALLOC (0, sizeof (struct vtysh_user));
}
-void
+#if 0
+static void
user_free (struct vtysh_user *user)
{
XFREE (0, user);
}
+#endif
-struct vtysh_user *
+static struct vtysh_user *
user_lookup (const char *name)
{
struct listnode *node, *nnode;
@@ -125,7 +127,8 @@
return NULL;
}
-void
+#if 0
+static void
user_config_write ()
{
struct listnode *node, *nnode;
@@ -137,8 +140,9 @@
printf (" username %s nopassword\n", user->name);
}
}
+#endif
-struct vtysh_user *
+static struct vtysh_user *
user_get (const char *name)
{
struct vtysh_user *user;
@@ -167,7 +171,7 @@
}
int
-vtysh_auth ()
+vtysh_auth (void)
{
struct vtysh_user *user;
struct passwd *passwd;
@@ -188,7 +192,7 @@
}
void
-vtysh_user_init ()
+vtysh_user_init (void)
{
userlist = list_new ();
install_element (CONFIG_NODE, &username_nopassword_cmd);
diff --git a/vtysh/vtysh_user.h b/vtysh/vtysh_user.h
index 8d0a4cf..c485c23 100644
--- a/vtysh/vtysh_user.h
+++ b/vtysh/vtysh_user.h
@@ -22,6 +22,7 @@
#ifndef _VTYSH_USER_H
#define _VTYSH_USER_H
-int vtysh_auth ();
+int vtysh_auth (void);
+void vtysh_user_init (void);
#endif /* _VTYSH_USER_H */