ftp.nice.ch/pub/next/unix/text/rtfdtohtml.1.3.s.tar.gz#/rtfdtohtml-1.3/pbtools/check.m

This is check.m in view mode; [Download] [Up]

#import <appkit/Listener.h>	// NXIsServicesMenuItemEnabled
#import "Filter.h"

@interface Check: Object
{
	int any;
}
@end

@implementation Check
- (void) filter: (Filter *) f flag: (char) ch
{
	NXPrintf(f->err, "usage: %s [menu...]\n", f->progname),
	NXFlush(f->err);
	exit(1);
}

- (int) filter: (Filter *) f arg: (const char *) menu
{
	if (menu)
	NXPrintf(f->out, "\"%s\" %s enabled\n", menu,
		(any |= NXIsServicesMenuItemEnabled(menu)) ? "is" : "is not");
	return 0;
}

- (int) filter: (Filter *) f exit: (int) code
{
	return any == 0;	// success if any is enabled
}
@end

int main (int argc, char * argv [])
{
	return [[[Filter alloc] initFor: [Check new]] run: argv];
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.