Plan 9 from Bell Labs’s /usr/web/sources/contrib/quanstro/root/sys/src/cmd/compose/main.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include "compose.h"

void
usage(void)
{
	fprint(2, "usage: compose [-t] [-c chan] [-o drawop] img ...\n");
	exits("usage");
}

void
main(int argc, char **argv)
{
	int i;
	ulong chan, op;
	C *c;

	chan = 0;
	op = SoverD;
	ARGBEGIN{
	case 'c':
		chan = strtochan(EARGF(usage()));
		if(chan == 0)
			usage();
		break;
	case 'o':
		op = strtoop(EARGF(usage()));
		if(op == ~0)
			usage();
		break;
	case 't':
		flag['t'] = 1;
		break;
	default:
		usage();
	}ARGEND
	if(argc == 0)
		usage();
	c = malloc(argc*sizeof *c);
	if(c == nil)
		sysfatal("malloc: %r");
	for(i = 0; i < argc; i++)
		intimg(c + i, argv[i], -1);
	composer(c, argc, chan, op);
	exits("");
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.