Пример #1
0
Файл: cmd.c Проект: taysom/tau
int pp (int argc, char *argv[])
{
	t_dump(TreeA);
	t_dump(TreeB);
	return 0;
}
Пример #2
0
void dds_dump (DDS_DomainParticipant part)
{
	char		buf [256], cmd [64];
	const char	*sp;

	ARG_NOT_USED (part)

	LIST_INIT (topics);
	LIST_INIT (endpoints);

	tty_init ();
	DDS_Handle_attach (tty_stdin,
			   POLLIN | POLLPRI | POLLERR | POLLHUP | POLLNVAL,
			   tty_input,
			   NULL);

	printf ("Technicolor DDS Dump program.\r\n");
	printf ("Type 'help' for a list ofcommands.\r\n");
	while (!aborting) {
		printf (">");
		fflush (stdout);
		tty_gets (sizeof (buf), buf, 0, 0);
		sp = buf;
		skip_blanks (&sp);
		skip_string (&sp, cmd);
		if (!memcmp (cmd, "help", 1)) {
			printf ("Following commands are available:\r\n");
			printf ("\tlist                  List all discovered domain topics.\r\n");
			printf ("\tauto <name_spec>      Automatically monitor new matching topics.\r\n");
			printf ("\tmonitor <name_spec>   Start monitoring matching topic(s).\r\n");
			printf ("\tignore <name_spec>    Stop monitoring matching topic(s).\r\n");
			printf ("\ttrace                 Toggle tracing of discovery traffic.\r\n");
#ifndef DDS_DEBUG
			printf ("\tpause                 Pause monitoring.\r\n");
			printf ("\tresume                Resume monitoring.\r\n");
			printf ("\tquit                  Quit the program.\r\n");
#else
			DDS_Debug_help ();
#endif
		}
		else if (!memcmp (cmd, "list", 2))
			t_dump ();
		else if (!memcmp (cmd, "auto", 2))
			t_auto (sp);
		else if (!memcmp (cmd, "monitor", 2))
			t_monitor (sp, part);
		else if (!memcmp (cmd, "ignore", 2))
			t_ignore (sp, part);
		else if (!memcmp (cmd, "trace", 2))
			t_trace ();			
#ifndef DDS_DEBUG
		else if (!memcmp (cmd, "pause", 1))
			paused = 1;
		else if (!memcmp (cmd, "resume", 1))
			paused = 0;
		else if (!memcmp (cmd, "quit", 1))
			aborting = 1;
		else
			printf ("?%s\r\n", buf);
#else
		else
			DDS_Debug_command (buf);
#endif
	}