ftp.nice.ch/pub/next/connectivity/protocol/Timer.N.bs.tar.gz#/Timer/TimerListener.m

This is TimerListener.m in view mode; [Download] [Up]

#import <appkit/appkit.h>
#import "TimerListener.h"
#import <mach/mach.h>
#import <mach/message.h>
#import <servers/netname.h>
extern port_t name_server_port;
extern id NXResponsibleDelegate();
@implementation  TimerListener :Listener
{}
static NXRemoteMethod *remoteMethods = NULL;
#define REMOTEMETHODS 2
+ initialize 
/* */
{
    if (!remoteMethods) {
	remoteMethods =
	(NXRemoteMethod *) malloc((REMOTEMETHODS+1)*sizeof(NXRemoteMethod));
	remoteMethods[0].key = 
	@selector(resetUnits);
	remoteMethods[0].types = "";
	remoteMethods[1].key = 
	@selector(exit);
	remoteMethods[1].types = "";
	remoteMethods[REMOTEMETHODS].key = NULL;
    }
    return self;
}
-(int)resetUnits
/* */
{
    id _NXd;
    if (_NXd = NXResponsibleDelegate(self,
	@selector(resetUnits)))
	return [_NXd resetUnits];
    return -1;
}

-(int)exit
/* */
{
    id _NXd;
    if (_NXd = NXResponsibleDelegate(self,
	@selector(exit)))
	return [_NXd exit];
    return -1;
}

- (int) performRemoteMethod : (NXRemoteMethod *) method
                  paramList : (NXParamValue *) paramList {
/* */
    switch (method - remoteMethods) {
    case 0:
	return [self resetUnits];
    case 1:
	return [self exit];
    default:
	return [super performRemoteMethod : method paramList : paramList];
    }
}
- (NXRemoteMethod *) remoteMethodFor: (SEL) aSel {
/* */
    NXRemoteMethod *rm;
    if (rm = NXRemoteMethodFromSel(aSel,remoteMethods))
        return rm;
    return [super remoteMethodFor : aSel];
}
@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.