#import <Foundation/Foundation.h>
#import "ProgramServer.h"


int main (int argc, const char *argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    ProgramServer *server;
    NSConnection *defaultConn = [NSConnection defaultConnection];

    server = [[ProgramServer alloc] init];
    [defaultConn setRootObject:server];
    if ([defaultConn registerName:@"ProgramServer"] == NO) {
        NSLog(@"Failed to register server as ProgramServer. Exiting.\n");
        exit(EXIT_FAILURE);
    }

    NSLog(@"Server successfully launched.\n");
    [[NSRunLoop currentRunLoop] run];


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