Release 1.3.7.
[wine/gsoc-2012-control.git] / dlls / rpcrt4 / tests / server.idl
blob89f9930fc7461e59ed3803a913ed0669149036d4
1 /*
2 * A simple interface to test the RPC server.
4 * Copyright (C) Google 2007 (Dan Hipschman)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "server_defines.h"
23 typedef struct tag_vector
25 int x;
26 int y;
27 int z;
28 } vector_t;
30 typedef int fnprintf(const char *format, ...);
33 uuid(00000000-4114-0704-2301-000000000000),
34 #ifndef __midl
35 implicit_handle(handle_t IServer_IfHandle)
36 #endif
38 interface IServer
40 cpp_quote("#if 0")
41 typedef wchar_t WCHAR;
42 cpp_quote("#endif")
44 typedef [string] char *str_t;
45 typedef [string] WCHAR *wstr_t;
47 typedef struct
49 int *pi;
50 int **ppi;
51 int ***pppi;
52 } pints_t;
54 typedef struct
56 char *pc;
57 short *ps;
58 long *pl;
59 float *pf;
60 double *pd;
61 } ptypes_t;
63 typedef struct
65 vector_t *pu;
66 vector_t **pv;
67 } pvectors_t;
69 typedef struct
71 [switch_is(s)] union
73 [case(SUN_I)] int i;
74 [case(SUN_F1, SUN_F2)] float f;
75 [case(SUN_PI)] int *pi;
76 } u;
78 int s;
79 } sun_t;
81 int int_return(void);
82 int square(int x);
83 int sum(int x, int y);
84 void square_out(int x, [out] int *y);
85 void square_ref([in, out] int *x);
86 int str_length([string] const char *s);
87 int str_t_length(str_t s);
88 int cstr_length([string, size_is(n)] const char *s, int n);
89 int dot_self(vector_t *v);
90 double square_half(double x, [out] double *y);
91 float square_half_float(float x, [out] float *y);
92 long square_half_long(long x, [out] long *y);
93 int sum_fixed_array(int a[5]);
94 int pints_sum(pints_t *pints);
95 double ptypes_sum(ptypes_t *ptypes);
96 int dot_pvectors(pvectors_t *pvectors);
98 /* don't use this anywhere except in sp_t */
99 typedef struct
101 int x;
102 } sp_inner_t;
104 typedef struct
106 int x;
107 sp_inner_t *s;
108 } sp_t;
110 int sum_sp(sp_t *sp);
111 double square_sun(sun_t *su);
113 typedef struct test_list
115 int t;
116 [switch_is(t)] union
118 [case(TL_NULL)] char x; /* end of list */
119 [case(TL_LIST)] struct test_list *tail;
120 } u;
121 } test_list_t;
123 typedef [ref] int *refpint_t;
125 int test_list_length(test_list_t *ls);
126 int sum_fixed_int_3d(int m[2][3][4]);
127 int sum_conf_array([size_is(n)] int x[], int n);
128 int sum_conf_ptr_by_conf_ptr(int n1, [size_is(n1)] int *n2_then_x1, [size_is(*n2_then_x1)] int *x2);
129 int sum_unique_conf_array([size_is(n), unique] int x[], int n);
130 int sum_unique_conf_ptr([size_is(n), unique] int *x, int n);
131 int sum_var_array([length_is(n)] int x[20], int n);
132 int dot_two_vectors(vector_t vs[2]);
133 void get_number_array([out, length_is(*n)] int x[20], [out] int *n);
135 typedef struct
137 int n;
138 [size_is(n)] int ca[];
139 } cs_t;
141 typedef struct
143 int *pn;
144 [size_is(*pn)] int *ca1;
145 [size_is(n * 2)] int *ca2;
146 int n;
147 } cps_t;
149 typedef struct
151 [size_is(c ? a : b)] int *ca;
152 int a;
153 int b;
154 int c;
155 } cpsc_t;
157 int sum_cs(cs_t *cs);
158 int sum_cps(cps_t *cps);
159 int sum_cpsc(cpsc_t *cpsc);
160 int sum_complex_array(int n, refpint_t pi[n]);
162 typedef [wire_marshal(int)] void *puint_t;
163 int square_puint(puint_t p);
165 typedef struct
167 [size_is(n)] puint_t *ps;
168 int n;
169 } puints_t;
171 /* Same thing as puints_t, but make it complex (needs padding). */
172 typedef struct
174 [size_is(n)] puint_t *ps;
175 char n;
176 } cpuints_t;
178 int sum_puints(puints_t *p);
179 int sum_cpuints(cpuints_t *p);
180 int dot_copy_vectors(vector_t u, vector_t v);
182 typedef struct wire_us *wire_us_t;
183 typedef [wire_marshal(wire_us_t)] struct us us_t;
184 struct us
186 void *x;
188 struct wire_us
190 int x;
192 typedef struct
194 us_t us;
195 } test_us_t;
197 int square_test_us(test_us_t *tus);
199 typedef union encu switch (int t)
201 case ENCU_I: int i;
202 case ENCU_F: float f;
203 } encu_t;
205 typedef [switch_type(int)] union unencu
207 [case (ENCU_I)] int i;
208 [case (ENCU_F)] float f;
209 } unencu_t;
211 typedef enum
213 E1 = 23,
214 E2 = 4,
215 E3 = 0,
216 E4 = 64
217 } e_t;
219 typedef union encue switch (e_t t)
221 case E1: int i1;
222 case E2: float f2;
223 } encue_t;
225 typedef struct
227 e_t f;
228 } se_t;
230 double square_encu(encu_t *eu);
231 double square_unencu(int t, [switch_is(t)] unencu_t *eu);
232 int sum_parr(int *a[3]);
233 int sum_pcarr([size_is(n)] int *a[], int n);
234 int enum_ord(e_t e);
235 double square_encue(encue_t *eue);
236 void check_se2(se_t *s);
238 int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n);
239 int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c);
241 typedef struct
243 char c;
244 int i;
245 short s;
246 double d;
247 } aligns_t;
249 double sum_aligns(aligns_t *a);
251 typedef struct
253 int i;
254 char c;
255 } padded_t;
257 int sum_padded(padded_t *p);
258 int sum_padded2(padded_t ps[2]);
259 int sum_padded_conf([size_is(n)] padded_t *ps, int n);
261 typedef struct
263 int *p1;
264 } bogus_helper_t;
266 typedef struct
268 bogus_helper_t h;
269 int *p2;
270 int *p3;
271 char c;
272 } bogus_t;
274 int sum_bogus(bogus_t *b);
275 void check_null([unique] int *null);
277 typedef struct
279 str_t s;
280 } str_struct_t;
282 typedef struct
284 wstr_t s;
285 } wstr_struct_t;
287 int str_struct_len(str_struct_t *s);
288 int wstr_struct_len(wstr_struct_t *s);
290 typedef struct
292 unsigned int n;
293 [size_is(n)] byte a[];
294 } doub_carr_1_t;
296 typedef struct
298 int n;
299 [size_is(n)] doub_carr_1_t *a[];
300 } doub_carr_t;
302 int sum_doub_carr(doub_carr_t *dc);
303 void make_pyramid_doub_carr(unsigned char n, [out] doub_carr_t **dc);
305 typedef struct
307 short n;
308 [size_is(n)] short data[];
309 } user_bstr_t;
311 typedef [unique] user_bstr_t *wire_bstr_t;
312 typedef [wire_marshal(wire_bstr_t)] short *bstr_t;
313 unsigned hash_bstr(bstr_t s);
315 typedef struct
317 [string, size_is(size)] char *name;
318 unsigned int size;
319 } name_t;
320 void get_name([in,out] name_t *name);
322 int sum_pcarr2(int n, [size_is(, n)] int **pa);
323 int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
325 /* Don't use this except in the get_s123 test. */
326 typedef struct
328 int f1;
329 int f2;
330 int f3;
331 } s123_t;
333 /* Make sure WIDL generates a type format string for a previously unseen
334 type as a return value. */
335 s123_t *get_s123(void);
337 typedef struct
339 unsigned int length;
340 unsigned int size;
341 [size_is(size), length_is(length)] pints_t numbers[];
342 } numbers_struct_t;
344 void get_numbers([in] int length, [in] int size, [out, length_is(length), size_is(size)] pints_t pn[]);
345 void get_numbers_struct([out] numbers_struct_t **ns);
347 str_t get_filename(void);
349 enum renum
351 RE0,
352 RE1,
353 RE2,
354 RE3,
356 const int RE_MIN = RE0;
357 const int RE_MAX = RE3;
358 typedef [range(RE_MIN, RE_MAX)] enum renum renum_t;
359 typedef [range(0, 100)] int rint_t;
360 rint_t echo_ranged_int([range(0, 100)] int n);
361 void get_ranged_enum([out] renum_t *re);
363 void context_handle_test(void);
365 void full_pointer_test([in, ptr] int *a, [in, ptr] int *b);
366 void full_pointer_null_test([in, ptr] int *a, [in, ptr] int *b);
368 void authinfo_test(unsigned int protseq, int secure);
370 void stop(void);