#import "PBTypes.h"

@implementation PBTypes
+ new
{	static id pbTypes;	// HashTable: NXAtom -> NXAtom

	if (! pbTypes)
	{	pbTypes = [[self alloc] initKeyDesc:"%" valueDesc:"%"];

#define add(a,b) [pbTypes insertKey:NXUniqueString(#a) value:(void *)b], \
		 [pbTypes insertKey:NXUniqueString(#b) value:(void *)b]

		add(eps, NXPostScriptPboardType);
		add(rtf, NXRTFPboardType);
		add(tif, NXTIFFPboardType);
		add(tiff, NXTIFFPboardType);

#undef add
	}
	return pbTypes;
}
- (NXAtom)type:(const char *)ext
{	NXAtom result = [self valueForKey:NXUniqueString(ext)];

	return result ? result : NXAsciiPboardType;
}
@end
