summaryrefslogtreecommitdiff
path: root/tests/lib/cli/common_cli.c
diff options
context:
space:
mode:
authorwhitespace / reindent <invalid@invalid.invalid>2017-08-09 11:49:42 +0200
committerwhitespace / reindent <invalid@invalid.invalid>2017-08-09 12:03:17 +0200
commitac4d0be5874fafd14212d6007fff7495edc9b152 (patch)
tree5e2f0d3189de928c849f9983406389ade3b098cb /tests/lib/cli/common_cli.c
parent76a86854181c27819e5cf71b12ae1fa5ccd9e02a (diff)
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'tests/lib/cli/common_cli.c')
-rw-r--r--tests/lib/cli/common_cli.c83
1 files changed, 40 insertions, 43 deletions
diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c
index 56db460438..93d6382a63 100644
--- a/tests/lib/cli/common_cli.c
+++ b/tests/lib/cli/common_cli.c
@@ -33,65 +33,62 @@
struct thread_master *master;
-int dump_args(struct vty *vty, const char *descr,
- int argc, struct cmd_token *argv[])
+int dump_args(struct vty *vty, const char *descr, int argc,
+ struct cmd_token *argv[])
{
- int i;
- vty_out (vty, "%s with %d args.%s", descr, argc, VTY_NEWLINE);
- for (i = 0; i < argc; i++)
- {
- vty_out (vty, "[%02d]: %s%s", i, argv[i]->arg, VTY_NEWLINE);
- }
-
- return CMD_SUCCESS;
+ int i;
+ vty_out(vty, "%s with %d args.%s", descr, argc, VTY_NEWLINE);
+ for (i = 0; i < argc; i++) {
+ vty_out(vty, "[%02d]: %s%s", i, argv[i]->arg, VTY_NEWLINE);
+ }
+
+ return CMD_SUCCESS;
}
static void vty_do_exit(void)
{
- printf ("\nend.\n");
- cmd_terminate ();
- vty_terminate ();
- thread_master_free (master);
- closezlog ();
-
- log_memstats_stderr ("testcli");
- exit (0);
+ printf("\nend.\n");
+ cmd_terminate();
+ vty_terminate();
+ thread_master_free(master);
+ closezlog();
+
+ log_memstats_stderr("testcli");
+ exit(0);
}
/* main routine. */
-int
-main (int argc, char **argv)
+int main(int argc, char **argv)
{
- struct thread thread;
+ struct thread thread;
- /* Set umask before anything for security */
- umask (0027);
+ /* Set umask before anything for security */
+ umask(0027);
- /* master init. */
- master = thread_master_create ();
+ /* master init. */
+ master = thread_master_create();
- openzlog("common-cli", "NONE", 0, LOG_CONS | LOG_NDELAY | LOG_PID,
- LOG_DAEMON);
- zlog_set_level(ZLOG_DEST_SYSLOG, ZLOG_DISABLED);
- zlog_set_level(ZLOG_DEST_STDOUT, ZLOG_DISABLED);
- zlog_set_level(ZLOG_DEST_MONITOR, LOG_DEBUG);
+ openzlog("common-cli", "NONE", 0, LOG_CONS | LOG_NDELAY | LOG_PID,
+ LOG_DAEMON);
+ zlog_set_level(ZLOG_DEST_SYSLOG, ZLOG_DISABLED);
+ zlog_set_level(ZLOG_DEST_STDOUT, ZLOG_DISABLED);
+ zlog_set_level(ZLOG_DEST_MONITOR, LOG_DEBUG);
- /* Library inits. */
- cmd_init (1);
- cmd_hostname_set ("test");
+ /* Library inits. */
+ cmd_init(1);
+ cmd_hostname_set("test");
- vty_init (master);
- memory_init ();
+ vty_init(master);
+ memory_init();
- test_init (argc, argv);
+ test_init(argc, argv);
- vty_stdio (vty_do_exit);
+ vty_stdio(vty_do_exit);
- /* Fetch next active thread. */
- while (thread_fetch (master, &thread))
- thread_call (&thread);
+ /* Fetch next active thread. */
+ while (thread_fetch(master, &thread))
+ thread_call(&thread);
- /* Not reached. */
- exit (0);
+ /* Not reached. */
+ exit(0);
}
-