home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Programming / GDBbundle-1.0-MIS / src / TextEdit / GdbBundle.bproj / test.m < prev    next >
Encoding:
Text File  |  1997-04-28  |  612 b   |  28 lines

  1. #include <libc.h>
  2. #import <Foundation/Foundation.h>
  3. #include "Variable.h"
  4.  
  5. void main(int argc, char** argv)
  6. {
  7.   NSArray* variables;
  8.   NSString* fileContents;
  9.   NSAutoreleasePool* pool = [NSAutoreleasePool new];
  10.  
  11.   if (argc < 2) {
  12.     printf ("usage: %s filename\n", argv[0]);
  13.     exit(1);
  14.   }
  15.  
  16.   fileContents = [NSString stringWithContentsOfFile:
  17.                   [NSString stringWithCString:argv[1]]];
  18.   if (!fileContents) {
  19.     NSLog (@"file %s does not exist!", argv[1]);
  20.     exit (1);
  21.   }
  22.  
  23.   variables = [Variable variablesFromDescription:fileContents];
  24.   NSLog (@"variables =\n%@", variables);
  25.   [pool release];
  26. }
  27.  
  28.