
#import <Foundation/Foundation.h>

volatile void usage(const char *pgm)
{
    fprintf(stderr, "usage: %s dictionaryPath\n", pgm);
    exit(1);
}

int main (int argc, const char *argv[])
{
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
   NSString *dictionaryPath;
   NSDictionary *dictionary;
   NSEnumerator *keyEnum;
   NSString *key;
   
   if (argc != 2)
       usage(argv[0]);

   dictionaryPath = [NSString stringWithCString: argv[1]];
   dictionary = [[NSDictionary alloc] initWithContentsOfFile: dictionaryPath];
   if (!dictionary) {
       NSLog(@"Could not find or open the file '%@'", dictionaryPath);
       exit(1);
   }

   keyEnum = [dictionary keyEnumerator];
   while ((key = [keyEnum nextObject]))
       printf("%s\n", [key cString]);
       
   // insert your code here

   [pool release];
   exit(0);       // insure the process exit status is 0
   return 0;      // ...and make main fit the ANSI spec.
}
