usr.bin/mail/cmd1.c
/*
 * Print out all the possible commands.
 */
Print out all the possible commands.
Print out all the possible commands .
int
pcmdlist()
{
	register struct cmd *cp;
	register int cc;
	extern struct cmd cmdtab[];
	printf("Commands are:\n");
	for (cc = 0, cp = cmdtab; cp->c_name != NULL; cp++) {
		cc += strlen(cp->c_name) + 2;
		if (cc > 72) {
			printf("\n");
			cc = strlen(cp->c_name) + 2;
		}
		if ((cp+1)->c_name != NOSTR)
			printf("%s, ", cp->c_name);
		else
			printf("%s\n", cp->c_name);
	}
	return(0);
}
int pcmdlist ( ) { register struct cmd * cp ; register int cc ; extern struct cmd cmdtab [ ] ; printf ( " \n " ) ; for ( cc = 0 , cp = cmdtab ; cp -> c_name != NULL ; cp ++ ) { cc += strlen ( cp -> c_name ) + 2 ; if ( cc > 72 ) { printf ( " \n " ) ; cc = strlen ( cp -> c_name ) + 2 ; } if ( ( cp + 1 ) -> c_name != NOSTR ) printf ( " " , cp -> c_name ) ; else printf ( " \n " , cp -> c_name ) ; } return ( 0 ) ; }
Print out all the possible commands.
Print out all the possible commands .