2 * Copyright 1987, 1988 by MIT Student Information Processing Board
4 * For copyright information, see copyright.h.
7 #include "ss_internal.h"
12 typedef void sigret_t;
14 #ifdef lint /* "lint returns a value which is sometimes ignored" */
15 #define DONT_USE(x) x=x;
20 static char const twentyfive_spaces[26] =
22 static char const NL[2] = "\n";
24 ss_list_requests(argc, argv, sci_idx, info_ptr)
30 register ss_request_entry *entry;
31 register char const * const *name;
33 register ss_request_table **table;
49 mask = sigblock(sigmask(SIGINT));
50 func = signal(SIGINT, SIG_IGN);
51 fd = ss_pager_create();
52 output = fdopen(fd, "w");
55 fprintf (output, "Available %s requests:\n\n",
56 ss_info (sci_idx) -> subsystem_name);
58 for (table = ss_info(sci_idx)->rqt_tables; *table; table++) {
59 entry = (*table)->requests;
60 for (; entry->command_names; entry++) {
63 if (entry->flags & SS_OPT_DONT_LIST)
65 for (name = entry->command_names; *name; name++) {
66 register int len = strlen(*name);
67 strncat(buffer, *name, len);
75 fputs(buffer, output);
79 strncat(buffer, twentyfive_spaces, 25-spacing);
80 strcat(buffer, entry->info_string);
82 fputs(buffer, output);
89 (void) signal(SIGINT, func);