File:  [MW Coherent from dump] / coherent / d / bin / lpr / opr.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:39 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * 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);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.