Many changes! Snapshots now working properly. Programmatic environment interface...
[RExecServer.git] / main.m
blob50da9ffb96e5442fc8a849d6360fa3e02679d02b
1 #import <Cocoa/Cocoa.h>
2 #import "RInterpreter.h"
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <sys/time.h>
7 #include <sys/resource.h>
9 int main(int argc, char *argv[])
11         NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
12         [[RInterpreter sharedInterpreter] setArgv:argv argc:argc];
13         NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
14         Class         Main = NSClassFromString([info objectForKey:@"NSPrincipalClass"]);
15         if(nil == Main) {
16                 NSLog(@"Unable to locate principal class: %@",[info objectForKey:@"NSPrincipalClass"]);
17                 [pool release];
18                 return 1;
19         }
20         //Let the application run its setup procedures
21         [Main sharedApplication];
22         [NSBundle loadNibNamed:[info objectForKey:@"NSMainNibFile"] owner:NSApp];
23         [NSApp run];
24         [pool release];
25         //Turn primary control over to the R event loop.
26         [[RInterpreter sharedInterpreter] run];
27         //If we get here then we should shut down the application.
28         return 0;