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 void 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;
39 sigset_t omask, igmask;
53 sigaddset(&igmask, SIGINT);
54 sigprocmask(SIG_BLOCK, &igmask, &omask);
56 mask = sigblock(sigmask(SIGINT));
58 func = signal(SIGINT, SIG_IGN);
59 fd = ss_pager_create();
60 output = fdopen(fd, "w");
62 sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
67 fprintf (output, "Available %s requests:\n\n",
68 ss_info (sci_idx) -> subsystem_name);
70 for (table = ss_info(sci_idx)->rqt_tables; *table; table++) {
71 entry = (*table)->requests;
72 for (; entry->command_names; entry++) {
75 if (entry->flags & SS_OPT_DONT_LIST)
77 for (name = entry->command_names; *name; name++) {
78 register int len = strlen(*name);
79 strncat(buffer, *name, len);
87 fputs(buffer, output);
91 strncat(buffer, twentyfive_spaces, 25-spacing);
92 strcat(buffer, entry->info_string);
94 fputs(buffer, output);
101 (void) signal(SIGINT, func);