1994-11-04 16:29:24 +00:00
|
|
|
#ifndef _server_h
|
|
|
|
#define _server_h
|
|
|
|
|
2003-07-31 23:49:32 +00:00
|
|
|
#include <GNUstepBase/preface.h>
|
1997-09-01 21:59:51 +00:00
|
|
|
#include <Foundation/NSConnection.h>
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
typedef struct _small_struct {
|
|
|
|
unsigned char z;
|
|
|
|
} small_struct;
|
|
|
|
|
|
|
|
typedef struct _foo {
|
2003-04-10 16:28:07 +00:00
|
|
|
char c;
|
|
|
|
double d;
|
1994-11-04 16:29:24 +00:00
|
|
|
int i;
|
|
|
|
char *s;
|
|
|
|
unsigned long l;
|
|
|
|
} foo;
|
|
|
|
|
|
|
|
struct myarray {
|
|
|
|
int a[3];
|
|
|
|
};
|
2000-08-07 22:00:31 +00:00
|
|
|
|
|
|
|
#define ADD_CONST 47
|
1994-11-04 16:29:24 +00:00
|
|
|
|
2003-10-21 14:28:34 +00:00
|
|
|
@protocol ClientProtocol
|
|
|
|
- (BOOL) callback;
|
|
|
|
@end
|
|
|
|
|
1994-11-04 16:29:24 +00:00
|
|
|
@protocol ServerProtocol
|
2004-04-25 07:40:19 +00:00
|
|
|
- (void) addObject: (id)o;
|
2000-08-07 22:00:31 +00:00
|
|
|
- (BOOL) sendBoolean: (BOOL)b;
|
|
|
|
- (void) getBoolean: (BOOL*)bp;
|
|
|
|
- (unsigned char) sendUChar: (unsigned char)uc;
|
|
|
|
- (void) getUChar: (unsigned char *)ucp;
|
|
|
|
- (char) sendChar: (char)uc;
|
|
|
|
- (void) getChar: (char *)ucp;
|
|
|
|
- (short) sendShort: (short)num;
|
|
|
|
- (void) getShort: (short *)num;
|
|
|
|
- (int) sendInt: (int)num;
|
|
|
|
- (void) getInt: (int *)num;
|
|
|
|
- (long) sendLong: (long)num;
|
|
|
|
- (void) getLong: (long *)num;
|
|
|
|
- (float) sendFloat: (float)num;
|
|
|
|
- (void) getFloat: (float *)num;
|
|
|
|
- (double) sendDouble: (double)num;
|
|
|
|
- (void) getDouble: (double *)num;
|
|
|
|
- sendDouble: (double)dbl andFloat: (float)flt;
|
|
|
|
|
|
|
|
- (small_struct) sendSmallStruct: (small_struct)str;
|
|
|
|
- (void) getSmallStruct: (small_struct *)str;
|
|
|
|
- (foo) sendStruct: (foo)str;
|
|
|
|
- (void) getStruct: (foo *)str;
|
|
|
|
- (id) sendObject: (id)str;
|
|
|
|
- (void) getObject: (id *)str;
|
|
|
|
- (char *) sendString: (char *)str;
|
|
|
|
- (void) getString: (char **)str;
|
|
|
|
|
|
|
|
- print: (const char *)str;
|
|
|
|
|
1994-11-04 16:29:24 +00:00
|
|
|
- objectAt: (unsigned)i;
|
|
|
|
- (unsigned) count;
|
2000-08-07 22:00:31 +00:00
|
|
|
- echoObject: obj;
|
|
|
|
|
1994-11-04 16:29:24 +00:00
|
|
|
- (oneway void) shout;
|
|
|
|
- bounce: sender count: (int)c;
|
1997-09-01 21:59:51 +00:00
|
|
|
- (oneway void) outputStats:obj;
|
2000-08-07 22:00:31 +00:00
|
|
|
|
1994-11-04 16:29:24 +00:00
|
|
|
- sendArray: (int[3])a;
|
|
|
|
- sendStructArray: (struct myarray)ma;
|
2000-08-07 22:00:31 +00:00
|
|
|
|
1994-11-04 16:29:24 +00:00
|
|
|
- sendBycopy: (bycopy id)o;
|
1998-03-23 20:49:54 +00:00
|
|
|
#ifdef _F_BYREF
|
|
|
|
- sendByref: (byref id)o;
|
2002-03-20 06:11:36 +00:00
|
|
|
- modifyByref: (byref NSMutableString *)o;
|
1998-03-23 20:49:54 +00:00
|
|
|
#endif
|
1994-11-04 16:29:24 +00:00
|
|
|
- manyArgs: (int)i1 : (int)i2 : (int)i3 : (int)i4 : (int)i5 : (int)i6
|
|
|
|
: (int)i7 : (int)i8 : (int)i9 : (int)i10 : (int)i11 : (int)i12;
|
2001-09-20 10:22:09 +00:00
|
|
|
- (int) exceptionTest1;
|
|
|
|
- (void) exceptionTest2;
|
|
|
|
- (oneway void) exceptionTest3;
|
2003-10-21 14:28:34 +00:00
|
|
|
|
|
|
|
- (oneway void) registerClient: (id<ClientProtocol>)client;
|
|
|
|
- (oneway void) unregisterClient: (id<ClientProtocol>)client;
|
|
|
|
- (BOOL) tryClientCallback;
|
1994-11-04 16:29:24 +00:00
|
|
|
@end
|
|
|
|
|
2003-07-04 09:33:53 +00:00
|
|
|
#ifdef IN_SERVER
|
|
|
|
/*
|
|
|
|
* We don't want the client to know about some methods, so we can
|
|
|
|
* check that they work when it doesn't know them.
|
|
|
|
*/
|
|
|
|
@protocol privateServer
|
|
|
|
- quietBycopy: (bycopy id)o;
|
|
|
|
@end
|
|
|
|
@interface Server : NSObject <ServerProtocol,privateServer>
|
|
|
|
{
|
|
|
|
id the_array;
|
2003-10-21 14:28:34 +00:00
|
|
|
id<ClientProtocol> registered_client;
|
2003-07-04 09:33:53 +00:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
#else
|
1996-03-07 00:39:28 +00:00
|
|
|
@interface Server : NSObject <ServerProtocol>
|
1994-11-04 16:29:24 +00:00
|
|
|
{
|
1996-03-07 00:39:28 +00:00
|
|
|
id the_array;
|
2003-10-21 14:28:34 +00:00
|
|
|
id<ClientProtocol> registered_client;
|
1994-11-04 16:29:24 +00:00
|
|
|
}
|
|
|
|
@end
|
2003-07-04 09:33:53 +00:00
|
|
|
#endif
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
#endif /* _server_h */
|