rpcrt4, widl: Make pointer layouts compatible with windows; fix conformant array...
[wine/wine64.git] / dlls / rpcrt4 / tests / server.idl
blob6233a1fd7dc12838a2bea20b3d613ca28efc4e05
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;
31 uuid(00000000-4114-0704-2301-000000000000),
32 #ifndef __midl
33 implicit_handle(handle_t IServer_IfHandle)
34 #endif
36 interface IServer
38 cpp_quote("#if 0")
39 typedef wchar_t WCHAR;
40 cpp_quote("#endif")
42 typedef [string] char *str_t;
43 typedef [string] WCHAR *wstr_t;
45 typedef struct
47 int *pi;
48 int **ppi;
49 int ***pppi;
50 } pints_t;
52 typedef struct
54 char *pc;
55 short *ps;
56 long *pl;
57 float *pf;
58 double *pd;
59 } ptypes_t;
61 typedef struct
63 vector_t *pu;
64 vector_t **pv;
65 } pvectors_t;
67 typedef struct
69 [switch_is(s)] union
71 [case(SUN_I)] int i;
72 [case(SUN_F1, SUN_F2)] float f;
73 [case(SUN_PI)] int *pi;
74 } u;
76 int s;
77 } sun_t;
79 int int_return(void);
80 int square(int x);
81 int sum(int x, int y);
82 void square_out(int x, [out] int *y);
83 void square_ref([in, out] int *x);
84 int str_length([string] const char *s);
85 int cstr_length([string, size_is(n)] const char *s, int n);
86 int dot_self(vector_t *v);
87 double square_half(double x, [out] double *y);
88 float square_half_float(float x, [out] float *y);
89 long square_half_long(long x, [out] long *y);
90 int sum_fixed_array(int a[5]);
91 int pints_sum(pints_t *pints);
92 double ptypes_sum(ptypes_t *ptypes);
93 int dot_pvectors(pvectors_t *pvectors);
95 /* don't use this anywhere except in sp_t */
96 typedef struct
98 int x;
99 } sp_inner_t;
101 typedef struct
103 int x;
104 sp_inner_t *s;
105 } sp_t;
107 int sum_sp(sp_t *sp);
108 double square_sun(sun_t *su);
110 typedef struct test_list
112 int t;
113 [switch_is(t)] union
115 [case(TL_NULL)] int x; /* end of list */
116 [case(TL_LIST)] struct test_list *tail;
117 } u;
118 } test_list_t;
120 int test_list_length(test_list_t *ls);
121 int sum_fixed_int_3d(int m[2][3][4]);
122 int sum_conf_array([size_is(n)] int x[], int n);
123 int sum_unique_conf_array([size_is(n), unique] int x[], int n);
124 int sum_unique_conf_ptr([size_is(n), unique] int *x, int n);
125 int sum_var_array([length_is(n)] int x[20], int n);
126 int dot_two_vectors(vector_t vs[2]);
128 typedef struct
130 int n;
131 [size_is(n)] int ca[];
132 } cs_t;
134 typedef struct
136 int *pn;
137 [size_is(*pn)] int *ca1;
138 [size_is(n * 2)] int *ca2;
139 int n;
140 } cps_t;
142 typedef struct
144 [size_is(c ? a : b)] int *ca;
145 int a;
146 int b;
147 int c;
148 } cpsc_t;
150 int sum_cs(cs_t *cs);
151 int sum_cps(cps_t *cps);
152 int sum_cpsc(cpsc_t *cpsc);
154 typedef [wire_marshal(int)] void *puint_t;
155 int square_puint(puint_t p);
156 int dot_copy_vectors(vector_t u, vector_t v);
158 typedef struct wire_us *wire_us_t;
159 typedef [wire_marshal(wire_us_t)] struct us us_t;
160 struct us
162 void *x;
164 struct wire_us
166 int x;
168 typedef struct
170 us_t us;
171 } test_us_t;
173 int square_test_us(test_us_t *tus);
175 typedef union encu switch (int t)
177 case ENCU_I: int i;
178 case ENCU_F: float f;
179 } encu_t;
181 typedef enum
183 E1 = 23,
184 E2 = 4,
185 E3 = 0,
186 E4 = 64
187 } e_t;
189 typedef union encue switch (e_t t)
191 case E1: int i1;
192 case E2: float f2;
193 } encue_t;
195 double square_encu(encu_t *eu);
196 int sum_parr(int *a[3]);
197 int sum_pcarr([size_is(n)] int *a[], int n);
198 int enum_ord(e_t e);
199 double square_encue(encue_t *eue);
201 int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n);
202 int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c);
204 typedef struct
206 char c;
207 int i;
208 short s;
209 double d;
210 } aligns_t;
212 double sum_aligns(aligns_t *a);
214 typedef struct
216 int i;
217 char c;
218 } padded_t;
220 int sum_padded(padded_t *p);
221 int sum_padded2(padded_t ps[2]);
222 int sum_padded_conf([size_is(n)] padded_t *ps, int n);
224 typedef struct
226 int *p1;
227 } bogus_helper_t;
229 typedef struct
231 bogus_helper_t h;
232 int *p2;
233 int *p3;
234 char c;
235 } bogus_t;
237 int sum_bogus(bogus_t *b);
238 void check_null([unique] int *null);
240 typedef struct
242 str_t s;
243 } str_struct_t;
245 typedef struct
247 wstr_t s;
248 } wstr_struct_t;
250 int str_struct_len(str_struct_t *s);
251 int wstr_struct_len(wstr_struct_t *s);
253 typedef struct
255 unsigned int n;
256 [size_is(n)] byte a[];
257 } doub_carr_1_t;
259 typedef struct
261 int n;
262 [size_is(n)] doub_carr_1_t *a[];
263 } doub_carr_t;
265 int sum_doub_carr(doub_carr_t *dc);
266 void make_pyramid_doub_carr(unsigned char n, [out] doub_carr_t **dc);
268 void stop(void);