DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦87f415071⟧ TextFile

    Length: 650 (0x28a)
    Types: TextFile
    Notes: UNIX file
    Names: »opr.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »cmd/lpr/opr.c« 

TextFile

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