Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/wip/mboxfs/test.c

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


#include "a.h"

void
main(int argc, char *argv[]) {
	char *f=nil;
	Mailbox *b;
	String *s;

	ARGBEGIN {
	case 'f':
		f=ARGF();
		break;
	default:
		print(" badflag('%c')", ARGC());
	} ARGEND

	if (f==nil) {
		print("Specify a file name with -f\n");
		exits("error");
	}
	
	b=mbox_new(f);
	b->fetch(b);
	s = b->ml[0].getheader(&b->ml[0],"Received");
	print("Received: %s\n",s_to_c(s));
	mbox_free(b);
	exits(nil);
}

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.