Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/refer/glue3.c

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


#include "refer.h"

void callhunt(char *in, char *out, char *arg, int outlen)
{
# define ALEN 50
	char	*argv[20], abuff[ALEN];
	extern int	typeindex;
	int	argc;
	extern char	one[];
	extern int	onelen;
	argv[0] = "hunt";
	argv[1] = "-i";
	argv[2] = in;
	argv[3] = "-t";
	argv[4] = out;
	argv[5] = (char *)outlen;
	argv[6] = "-T";
	argv[7] = "-F1";
	argv[8] = "-o";
	argv[9] = one;
	argv[10] = (char *)onelen;
	argv[11] = abuff;
	argv[12] = 0;
	if (strlen(arg) >= ALEN)
		err("abuff not big enough %d", strlen(arg));
	strcpy(abuff, arg);
	for (argc=0; argv[argc]; argc++)
		;
	huntmain(argc, argv);
}

void dodeliv(char *in, char *out, char *arg, int outlen)
{
# if D1
	fprintf(stderr, "in dodeliv, arg /%s/\n", arg ? arg : "");
# endif
	if (arg && arg[0])
		if (chdir(arg) < 0)
			err("can't chdir to %s", arg);
	findline(in, out, outlen, 0L);
	restodir();
}

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.