~ubuntu-branches/ubuntu/trusty/gnustep-base/trusty

« back to all changes in this revision

Viewing changes to Testing/server.h

Tags: upstream-1.20.0
ImportĀ upstreamĀ versionĀ 1.20.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Test/example program for the base library
2
 
 
3
 
   Copyright (C) 2005 Free Software Foundation, Inc.
4
 
   
5
 
  Copying and distribution of this file, with or without modification,
6
 
  are permitted in any medium without royalty provided the copyright
7
 
  notice and this notice are preserved.
8
 
 
9
 
   This file is part of the GNUstep Base Library.
10
 
*/
11
 
#ifndef _server_h
12
 
#define _server_h
13
 
 
14
 
#include <GNUstepBase/preface.h>
15
 
#include <Foundation/NSConnection.h>
16
 
 
17
 
typedef struct _small_struct {
18
 
  unsigned char z;
19
 
} small_struct;
20
 
 
21
 
typedef struct _foo {
22
 
  char c;
23
 
  double d;
24
 
  int i;
25
 
  char *s;
26
 
  unsigned long l;
27
 
} foo;
28
 
 
29
 
struct myarray {
30
 
  int a[3];
31
 
};
32
 
 
33
 
#define ADD_CONST 47
34
 
 
35
 
@protocol ClientProtocol 
36
 
- (BOOL) callback;
37
 
@end
38
 
 
39
 
@protocol ServerProtocol 
40
 
- (void) addObject: (id)o;
41
 
- (BOOL) sendBoolean: (BOOL)b;
42
 
- (void) getBoolean: (BOOL*)bp;
43
 
- (unsigned char) sendUChar: (unsigned char)uc;
44
 
- (void) getUChar: (unsigned char *)ucp;
45
 
- (char) sendChar: (char)uc;
46
 
- (void) getChar: (char *)ucp;
47
 
- (short) sendShort: (short)num;
48
 
- (void) getShort: (short *)num;
49
 
- (int) sendInt: (int)num;
50
 
- (void) getInt: (int *)num;
51
 
- (long) sendLong: (long)num;
52
 
- (void) getLong: (long *)num;
53
 
- (float) sendFloat: (float)num;
54
 
- (void) getFloat: (float *)num;
55
 
- (double) sendDouble: (double)num;
56
 
- (void) getDouble: (double *)num;
57
 
- sendDouble: (double)dbl andFloat: (float)flt;
58
 
 
59
 
- (small_struct) sendSmallStruct: (small_struct)str;
60
 
- (void) getSmallStruct: (small_struct *)str;
61
 
- (foo) sendStruct: (foo)str;
62
 
- (void) getStruct: (foo *)str;
63
 
- (id) sendObject: (id)str;
64
 
- (void) getObject: (id *)str;
65
 
- (char *) sendString: (char *)str;
66
 
- (void) getString: (char **)str;
67
 
 
68
 
- print: (const char *)str;
69
 
 
70
 
- objectAt: (unsigned)i;
71
 
- (unsigned) count;
72
 
- echoObject: obj;
73
 
 
74
 
- (oneway void) shout;
75
 
- bounce: sender count: (int)c;
76
 
- (oneway void) outputStats:obj;
77
 
 
78
 
- sendArray: (int[3])a;
79
 
- sendStructArray: (struct myarray)ma;
80
 
 
81
 
- sendBycopy: (bycopy id)o;
82
 
#ifdef  _F_BYREF
83
 
- sendByref: (byref id)o;
84
 
- modifyByref: (byref NSMutableString *)o;
85
 
#endif
86
 
- manyArgs: (int)i1 : (int)i2 : (int)i3 : (int)i4 : (int)i5 : (int)i6
87
 
: (int)i7 : (int)i8 : (int)i9 : (int)i10 : (int)i11 : (int)i12;
88
 
- (int) exceptionTest1;
89
 
- (void) exceptionTest2;
90
 
- (oneway void) exceptionTest3;
91
 
 
92
 
- (oneway void) registerClient: (id<ClientProtocol>)client;
93
 
- (oneway void) unregisterClient: (id<ClientProtocol>)client;
94
 
- (BOOL) tryClientCallback;
95
 
@end
96
 
 
97
 
#ifdef  IN_SERVER
98
 
/*
99
 
 * We don't want the client to know about some methods, so we can
100
 
 * check that they work when it doesn't know them.
101
 
 */
102
 
@protocol privateServer
103
 
- quietBycopy: (bycopy id)o;
104
 
@end
105
 
@interface Server : NSObject <ServerProtocol,privateServer>
106
 
{
107
 
  id the_array;
108
 
  id<ClientProtocol> registered_client;
109
 
}
110
 
@end
111
 
#else
112
 
@interface Server : NSObject <ServerProtocol>
113
 
{
114
 
  id the_array;
115
 
  id<ClientProtocol> registered_client;
116
 
}
117
 
@end
118
 
#endif
119
 
 
120
 
#endif /* _server_h */