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

@implementation GdbManager

- init
{
    [super init];
    displayProvider = nil;
    return self;
}

- (void)dealloc
{
    if (displayProvider)
        [displayProvider release];
    if (displayProviderConnectionName)
        [displayProviderConnectionName release];
    if (displayProviderHostName)
        [displayProviderHostName release];
    [super dealloc];
}

- (void) setDisplayProviderConnectionName:(const char *)connName
                                     host:(const char *)hostName
{
    if (connName) {
        displayProviderConnectionName = [[NSString alloc]
        				      initWithCString:connName];
    }
    else {
        displayProviderConnectionName = nil;
    }

    if (hostName) {
        displayProviderHostName = [[NSString alloc]
 					initWithCString:hostName];
    }
    else {
        displayProviderHostName = nil;
    }

}
- (NSString *) displayProviderConnectionName
{
    return displayProviderConnectionName;
}

- (NSString *) displayProviderHostName
{
    return displayProviderHostName;
}


- (void) setDisplayProvider:(id)dP
{
    displayProvider = [dP retain];
}


// called from Gdb thread; returns nil if client doesn't support
// the requested protocol.
- displayProviderForProtocol: (Protocol *)p
{
    if ([displayProvider conformsToProtocol:p])
        return displayProvider;
    else
        return nil;
}

- (WindowHookFunction) windowHookFunction
{
    return NULL;
}

- (int) establishConnection
{
}

@end
