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
31 uuid(00000000-4114-0704-2301-000000000000),
33 implicit_handle
(handle_t IServer_IfHandle
)
39 typedef wchar_t WCHAR
;
42 typedef [string] char *str_t
;
43 typedef [string] WCHAR
*wstr_t
;
72 [case(SUN_F1
, SUN_F2
)] float f
;
73 [case(SUN_PI
)] int *pi
;
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 str_t_length
(str_t s
);
86 int cstr_length
([string, size_is(n
)] const char *s
, int n
);
87 int dot_self
(vector_t
*v
);
88 double square_half
(double x
, [out] double *y
);
89 float square_half_float
(float x
, [out] float *y
);
90 long square_half_long
(long x
, [out] long *y
);
91 int sum_fixed_array
(int a
[5]);
92 int pints_sum
(pints_t
*pints
);
93 double ptypes_sum
(ptypes_t
*ptypes
);
94 int dot_pvectors
(pvectors_t
*pvectors
);
96 /* don't use this anywhere except in sp_t */
108 int sum_sp
(sp_t
*sp
);
109 double square_sun
(sun_t
*su
);
111 typedef struct test_list
116 [case(TL_NULL
)] char x
; /* end of list */
117 [case(TL_LIST
)] struct test_list
*tail
;
121 int test_list_length
(test_list_t
*ls
);
122 int sum_fixed_int_3d
(int m
[2][3][4]);
123 int sum_conf_array
([size_is(n
)] int x
[], int n
);
124 int sum_unique_conf_array
([size_is(n
), unique] int x
[], int n
);
125 int sum_unique_conf_ptr
([size_is(n
), unique] int *x
, int n
);
126 int sum_var_array
([length_is(n
)] int x
[20], int n
);
127 int dot_two_vectors
(vector_t vs
[2]);
132 [size_is(n
)] int ca
[];
138 [size_is(*pn
)] int *ca1
;
139 [size_is(n
* 2)] int *ca2
;
145 [size_is(c ? a
: b
)] int *ca
;
151 int sum_cs
(cs_t
*cs
);
152 int sum_cps
(cps_t
*cps
);
153 int sum_cpsc
(cpsc_t
*cpsc
);
155 typedef [wire_marshal(int)] void *puint_t
;
156 int square_puint
(puint_t p
);
160 [size_is(n
)] puint_t
*ps
;
164 /* Same thing as puints_t, but make it complex (needs padding). */
167 [size_is(n
)] puint_t
*ps
;
171 int sum_puints
(puints_t
*p
);
172 int sum_cpuints
(cpuints_t
*p
);
173 int dot_copy_vectors
(vector_t u
, vector_t v
);
175 typedef struct wire_us
*wire_us_t
;
176 typedef [wire_marshal(wire_us_t
)] struct us us_t
;
190 int square_test_us
(test_us_t
*tus
);
192 typedef union encu
switch (int t
)
195 case ENCU_F
: float f
;
198 typedef [switch_type(int)] union unencu
200 [case (ENCU_I
)] int i
;
201 [case (ENCU_F
)] float f
;
212 typedef union encue
switch (e_t t
)
223 double square_encu
(encu_t
*eu
);
224 double square_unencu
(int t
, [switch_is(t
)] unencu_t
*eu
);
225 int sum_parr
(int *a
[3]);
226 int sum_pcarr
([size_is(n
)] int *a
[], int n
);
228 double square_encue
(encue_t
*eue
);
229 void check_se2
(se_t
*s
);
231 int sum_toplev_conf_2n
([size_is(n
* 2)] int *x
, int n
);
232 int sum_toplev_conf_cond
([size_is(c ? a
: b
)] int *x
, int a
, int b
, int c
);
242 double sum_aligns
(aligns_t
*a
);
250 int sum_padded
(padded_t
*p
);
251 int sum_padded2
(padded_t ps
[2]);
252 int sum_padded_conf
([size_is(n
)] padded_t
*ps
, int n
);
267 int sum_bogus
(bogus_t
*b
);
268 void check_null
([unique] int *null
);
280 int str_struct_len
(str_struct_t
*s
);
281 int wstr_struct_len
(wstr_struct_t
*s
);
286 [size_is(n
)] byte a
[];
292 [size_is(n
)] doub_carr_1_t
*a
[];
295 int sum_doub_carr
(doub_carr_t
*dc
);
296 void make_pyramid_doub_carr
(unsigned char n
, [out] doub_carr_t
**dc
);
301 [size_is(n
)] short data
[];
304 typedef [unique] user_bstr_t
*wire_bstr_t
;
305 typedef [wire_marshal(wire_bstr_t
)] short *bstr_t
;
306 unsigned hash_bstr
(bstr_t s
);
310 [string, size_is(size
)] char *name
;
313 void get_name
([in,out] name_t
*name
);
315 int sum_pcarr2
(int n
, [size_is(, n
)] int **pa
);
316 int sum_L1_norms
(int n
, [size_is(n
)] vector_t
*vs
);
318 /* Don't use this except in the get_s123 test. */
326 /* Make sure WIDL generates a type format string for a previously unseen
327 type as a return value. */
328 s123_t
*get_s123
(void);
334 [size_is(size
), length_is(length
)] pints_t numbers
[];
337 void get_5numbers
([in] int count
, [out, length_is(count
)] pints_t pn
[5]);
338 void get_numbers
([in] int length
, [in] int size
, [out, length_is(length
), size_is(size
)] pints_t pn
[]);
339 void get_numbers_struct
([out] numbers_struct_t
**ns
);
341 str_t get_filename
(void);
342 void context_handle_test
(void);