h04370
s 00041/00000/00000
d D 1.1 84/11/01 22:38:36 dock 1 0
c date and time created 84/11/01 22:38:36 by dock
e
u
U
t
T
I 1
/* synop.c -- print a synopsis of monitor commands
 * copyright (c) 1984  American Information Systems Corporation
 *  Dock Williams
 *  January, 1984
 *
 */

#include "mondef.h"

/* externally defined read only data, see rodata.c */
extern SYNOP cmdtab[];

synop(argv)
    char *argv[];
{
    register int i;
    register char c, *cp;

    cp = argv[0];
    while(c = *cp++) {
       	switch(c) {
	    case '?':
	        prdname(1);
	        for (i=0; '\0' != cmdtab[i].key;i++) {
        		if(cmdtab[i].cmd != 0)
			    printf("%16s%s\n",cmdtab[i].cmd,cmdtab[i].desc);
	        }
	        break;
	    default:
	        for (i=0; '\0' != cmdtab[i].key; i++) {
		        if (c == cmdtab[i].key) {
		            if(*cmdtab[i].cmd == '\0')
			        printf("    %s\n",cmdtab[i].desc);
		            else
				printf("%16s%s\n",cmdtab[i].cmd,cmdtab[i].desc);
		        }
	        }
	    }
    }
}

E 1
