2 *------------------------------------------------------------------
12 * Revision 1.5 1997/04/26 14:35:55 tytso
13 * Checkin of e2fsprogs 1.02.
15 * Revision 1.1 1993/06/03 12:31:25 tytso
18 * Revision 1.1 1991/12/21 16:41:47 eichin
21 * Revision 1.1 1991/12/21 11:13:39 eichin
24 * Revision 1.2 89/01/25 07:52:27 raeburn
25 * *** empty log message ***
27 * Revision 1.1 88/01/23 15:50:26 raeburn
31 *------------------------------------------------------------------
35 static char const rcsid_test_c[] =
42 extern ss_request_table test_cmds;
47 static char def_subsystem_name[5] = "test";
48 static char version [4] = "1.0";
49 extern void ss_listen();
56 char *argv0 = argv[0];
57 char *initial_request = (char *)NULL;
58 int quit = FALSE; /* quit after processing request */
62 subsystem_name = def_subsystem_name;
64 for (; *argv; ++argv, --argc) {
65 printf("checking arg: %s\n", *argv);
66 if (!strcmp(*argv, "-prompt")) {
69 "No argument supplied with -prompt\n");
73 subsystem_name = *argv;
75 else if (!strcmp(*argv, "-request") || !strcmp(*argv, "-rq")) {
78 "No string supplied with -request.\n");
82 initial_request = *argv;
84 else if (!strcmp(*argv, "-quit"))
86 else if (!strcmp(*argv, "-no_quit"))
88 else if (**argv == '-') {
89 fprintf(stderr, "Unknown control argument %s\n",
92 "Usage: %s [gateway] [ -prompt name ] [ -request name ] [ -quit ]\n",
98 sci_idx = ss_create_invocation(subsystem_name, version,
99 (char *)NULL, &test_cmds, &code);
101 ss_perror(sci_idx, code, "creating invocation");
105 (void) ss_add_request_table (sci_idx, &ss_std_requests, 1, &code);
107 ss_perror (sci_idx, code, "adding standard requests");
112 printf("test version %s. Type '?' for a list of commands.\n\n",
115 if (initial_request != (char *)NULL) {
116 code = ss_execute_line(sci_idx, initial_request);
118 ss_perror(sci_idx, code, initial_request);
121 (void) ss_listen (sci_idx, &code);
126 void test_cmd (argc, argv)
130 while (++argv, --argc)
131 fputs(*argv, stdout);