This is Questor_API_Demo2Listener.m in view mode; [Download] [Up]
#import <appkit/appkit.h> #import "Questor_API_Demo2Listener.h" #import <mach.h> #import <sys/message.h> #import <servers/netname.h> extern port_t name_server_port; extern id NXResponsibleDelegate(); @implementation Questor_API_Demo2Listener :Listener {} static NXRemoteMethod *remoteMethods = NULL; #define REMOTEMETHODS 1 + (void)initialize /* */ { if (!remoteMethods) { remoteMethods = (NXRemoteMethod *) malloc((REMOTEMETHODS+1)*sizeof(NXRemoteMethod)); remoteMethods[0].key = @selector(questorData:len:fromRow:fromCol:toRow:toCol:sheet:ok:); remoteMethods[0].types = "biiiicI"; remoteMethods[REMOTEMETHODS].key = NULL; } } -(int)questorData : (char *) buf len : (int) len fromRow : (int) fromRow fromCol : (int) fromCol toRow : (int) toRow toCol : (int) toCol sheet : (char *) path ok : (int *) ok /* */ { id _NXd; if (_NXd = NXResponsibleDelegate(self, @selector(questorData:len:fromRow:fromCol:toRow:toCol:sheet:ok:))) return [_NXd questorData : buf len : len fromRow : fromRow fromCol : fromCol toRow : toRow toCol : toCol sheet : path ok : ok]; return -1; } - (int) performRemoteMethod : (NXRemoteMethod *) method paramList : (NXParamValue *) paramList { /* */ switch (method - remoteMethods) { case 0: return [self questorData : paramList[0].bval.p len : paramList[0].bval.len fromRow : paramList[1].ival fromCol : paramList[2].ival toRow : paramList[3].ival toCol : paramList[4].ival sheet : paramList[5].bval.p ok : ¶mList[6].ival]; 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.