|  | DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 | 
This is an automatic "excavation" of a thematic subset of
 See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. | 
top - metrics - download
    Length: 650 (0x28a)
    Types: TextFile
    Notes: UNIX file
    Names: »opr.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX Filesystem
        └─⟦this⟧ »cmd/lpr/opr.c« 
/*
 * Submit an off-line print request
 * Select the appropriate spooler for
 * the specified printer location.
 */
#include <stdio.h>
struct	dests	{
	char	*d_name;
	char	*d_comm;
}	dests[] = {
	"-lp", "/bin/lpr",
	"-vp", "/bin/vpr",
};
#define	NDEST	(sizeof(dests)/sizeof(dests[0]))
main(argc, argv)
char *argv[];
{
	register struct dests *dp, *xdp;
	dp = dests;
	if (argc>1 && *argv[1]=='-')
		for (xdp = dests; xdp < &dests[NDEST]; xdp++)
			if (strcmp(xdp->d_name, argv[1]) == 0) {
				argc--;
				argv++;
				dp = xdp;
			}
	argv[0] = dp->d_comm;
	execv(dp->d_comm, argv);
	fprintf(stderr, "opr: %s unavailable\n", dp->d_name);
	exit(1);
}