2007-04-26 03:18:29 +02:00
|
|
|
/*
|
|
|
|
* A simple interface to test the RPC server.
|
|
|
|
*
|
|
|
|
* Copyright (C) Google 2007 (Dan Hipschman)
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2007-05-19 01:53:27 +02:00
|
|
|
#include "server_defines.h"
|
|
|
|
|
2007-04-26 03:18:29 +02:00
|
|
|
typedef struct tag_vector
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int z;
|
|
|
|
} vector_t;
|
|
|
|
|
2009-11-07 15:55:13 +01:00
|
|
|
typedef int fnprintf(const char *format, ...);
|
|
|
|
|
2007-04-26 03:18:29 +02:00
|
|
|
[
|
|
|
|
uuid(00000000-4114-0704-2301-000000000000),
|
2007-10-05 22:50:54 +02:00
|
|
|
#ifndef __midl
|
2007-04-26 03:18:29 +02:00
|
|
|
implicit_handle(handle_t IServer_IfHandle)
|
2007-10-05 22:50:54 +02:00
|
|
|
#endif
|
2007-04-26 03:18:29 +02:00
|
|
|
]
|
|
|
|
interface IServer
|
|
|
|
{
|
2007-09-26 20:32:47 +02:00
|
|
|
cpp_quote("#if 0")
|
|
|
|
typedef wchar_t WCHAR;
|
|
|
|
cpp_quote("#endif")
|
|
|
|
|
|
|
|
typedef [string] char *str_t;
|
|
|
|
typedef [string] WCHAR *wstr_t;
|
|
|
|
|
2007-05-10 05:50:49 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int *pi;
|
|
|
|
int **ppi;
|
|
|
|
int ***pppi;
|
|
|
|
} pints_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *pc;
|
|
|
|
short *ps;
|
|
|
|
long *pl;
|
|
|
|
float *pf;
|
|
|
|
double *pd;
|
|
|
|
} ptypes_t;
|
|
|
|
|
2007-05-12 02:27:40 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
vector_t *pu;
|
|
|
|
vector_t **pv;
|
|
|
|
} pvectors_t;
|
|
|
|
|
2007-05-19 01:53:27 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
[switch_is(s)] union
|
|
|
|
{
|
|
|
|
[case(SUN_I)] int i;
|
|
|
|
[case(SUN_F1, SUN_F2)] float f;
|
2007-05-25 02:48:39 +02:00
|
|
|
[case(SUN_PI)] int *pi;
|
2007-05-19 01:53:27 +02:00
|
|
|
} u;
|
|
|
|
|
|
|
|
int s;
|
|
|
|
} sun_t;
|
|
|
|
|
2007-04-26 03:18:29 +02:00
|
|
|
int int_return(void);
|
|
|
|
int square(int x);
|
|
|
|
int sum(int x, int y);
|
|
|
|
void square_out(int x, [out] int *y);
|
|
|
|
void square_ref([in, out] int *x);
|
|
|
|
int str_length([string] const char *s);
|
2008-02-22 00:46:51 +01:00
|
|
|
int str_t_length(str_t s);
|
2007-09-05 00:46:30 +02:00
|
|
|
int cstr_length([string, size_is(n)] const char *s, int n);
|
2007-04-26 03:18:29 +02:00
|
|
|
int dot_self(vector_t *v);
|
|
|
|
double square_half(double x, [out] double *y);
|
|
|
|
float square_half_float(float x, [out] float *y);
|
|
|
|
long square_half_long(long x, [out] long *y);
|
2007-04-26 03:22:10 +02:00
|
|
|
int sum_fixed_array(int a[5]);
|
2007-05-10 05:50:49 +02:00
|
|
|
int pints_sum(pints_t *pints);
|
|
|
|
double ptypes_sum(ptypes_t *ptypes);
|
2007-05-12 02:27:40 +02:00
|
|
|
int dot_pvectors(pvectors_t *pvectors);
|
2007-05-16 02:48:20 +02:00
|
|
|
|
|
|
|
/* don't use this anywhere except in sp_t */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
} sp_inner_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
sp_inner_t *s;
|
|
|
|
} sp_t;
|
|
|
|
|
|
|
|
int sum_sp(sp_t *sp);
|
2007-05-31 03:00:45 +02:00
|
|
|
double square_sun(sun_t *su);
|
2007-05-25 02:50:02 +02:00
|
|
|
|
|
|
|
typedef struct test_list
|
|
|
|
{
|
|
|
|
int t;
|
|
|
|
[switch_is(t)] union
|
|
|
|
{
|
2007-12-19 15:53:30 +01:00
|
|
|
[case(TL_NULL)] char x; /* end of list */
|
2007-05-25 02:50:02 +02:00
|
|
|
[case(TL_LIST)] struct test_list *tail;
|
|
|
|
} u;
|
|
|
|
} test_list_t;
|
|
|
|
|
2010-03-19 15:50:15 +01:00
|
|
|
typedef [ref] int *refpint_t;
|
|
|
|
|
2007-05-25 02:50:02 +02:00
|
|
|
int test_list_length(test_list_t *ls);
|
2007-06-06 03:50:31 +02:00
|
|
|
int sum_fixed_int_3d(int m[2][3][4]);
|
|
|
|
int sum_conf_array([size_is(n)] int x[], int n);
|
2009-01-11 15:00:18 +01:00
|
|
|
int sum_conf_ptr_by_conf_ptr(int n1, [size_is(n1)] int *n2_then_x1, [size_is(*n2_then_x1)] int *x2);
|
2007-09-26 20:32:08 +02:00
|
|
|
int sum_unique_conf_array([size_is(n), unique] int x[], int n);
|
|
|
|
int sum_unique_conf_ptr([size_is(n), unique] int *x, int n);
|
2007-06-06 03:50:31 +02:00
|
|
|
int sum_var_array([length_is(n)] int x[20], int n);
|
|
|
|
int dot_two_vectors(vector_t vs[2]);
|
2010-03-23 14:33:13 +01:00
|
|
|
void get_number_array([out, length_is(*n)] int x[20], [out] int *n);
|
2007-06-06 03:52:24 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int n;
|
|
|
|
[size_is(n)] int ca[];
|
|
|
|
} cs_t;
|
|
|
|
|
2007-06-12 03:51:41 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int *pn;
|
|
|
|
[size_is(*pn)] int *ca1;
|
|
|
|
[size_is(n * 2)] int *ca2;
|
|
|
|
int n;
|
|
|
|
} cps_t;
|
|
|
|
|
2007-09-04 18:33:23 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
[size_is(c ? a : b)] int *ca;
|
|
|
|
int a;
|
|
|
|
int b;
|
|
|
|
int c;
|
|
|
|
} cpsc_t;
|
|
|
|
|
2007-06-06 03:52:24 +02:00
|
|
|
int sum_cs(cs_t *cs);
|
2007-06-12 03:51:41 +02:00
|
|
|
int sum_cps(cps_t *cps);
|
2007-09-04 18:33:23 +02:00
|
|
|
int sum_cpsc(cpsc_t *cpsc);
|
2010-03-19 15:50:15 +01:00
|
|
|
int sum_complex_array(int n, refpint_t pi[n]);
|
2007-06-06 03:52:24 +02:00
|
|
|
|
2007-06-14 01:13:04 +02:00
|
|
|
typedef [wire_marshal(int)] void *puint_t;
|
|
|
|
int square_puint(puint_t p);
|
2007-10-18 03:06:26 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
[size_is(n)] puint_t *ps;
|
|
|
|
int n;
|
|
|
|
} puints_t;
|
|
|
|
|
|
|
|
/* Same thing as puints_t, but make it complex (needs padding). */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
[size_is(n)] puint_t *ps;
|
|
|
|
char n;
|
|
|
|
} cpuints_t;
|
|
|
|
|
|
|
|
int sum_puints(puints_t *p);
|
|
|
|
int sum_cpuints(cpuints_t *p);
|
2007-06-14 01:14:08 +02:00
|
|
|
int dot_copy_vectors(vector_t u, vector_t v);
|
2007-06-14 01:15:41 +02:00
|
|
|
|
|
|
|
typedef struct wire_us *wire_us_t;
|
|
|
|
typedef [wire_marshal(wire_us_t)] struct us us_t;
|
|
|
|
struct us
|
|
|
|
{
|
|
|
|
void *x;
|
|
|
|
};
|
|
|
|
struct wire_us
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
};
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
us_t us;
|
|
|
|
} test_us_t;
|
|
|
|
|
|
|
|
int square_test_us(test_us_t *tus);
|
2007-06-19 03:36:14 +02:00
|
|
|
|
|
|
|
typedef union encu switch (int t)
|
|
|
|
{
|
|
|
|
case ENCU_I: int i;
|
|
|
|
case ENCU_F: float f;
|
|
|
|
} encu_t;
|
|
|
|
|
2008-07-01 12:25:44 +02:00
|
|
|
typedef [switch_type(int)] union unencu
|
|
|
|
{
|
|
|
|
[case (ENCU_I)] int i;
|
|
|
|
[case (ENCU_F)] float f;
|
|
|
|
} unencu_t;
|
|
|
|
|
2007-06-26 03:24:11 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
E1 = 23,
|
|
|
|
E2 = 4,
|
|
|
|
E3 = 0,
|
|
|
|
E4 = 64
|
|
|
|
} e_t;
|
|
|
|
|
2007-06-26 03:27:24 +02:00
|
|
|
typedef union encue switch (e_t t)
|
|
|
|
{
|
|
|
|
case E1: int i1;
|
|
|
|
case E2: float f2;
|
|
|
|
} encue_t;
|
|
|
|
|
2008-03-21 00:06:14 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
e_t f;
|
|
|
|
} se_t;
|
|
|
|
|
2007-06-19 03:36:14 +02:00
|
|
|
double square_encu(encu_t *eu);
|
2008-07-01 12:25:44 +02:00
|
|
|
double square_unencu(int t, [switch_is(t)] unencu_t *eu);
|
2007-06-21 01:50:44 +02:00
|
|
|
int sum_parr(int *a[3]);
|
|
|
|
int sum_pcarr([size_is(n)] int *a[], int n);
|
2007-06-26 03:24:11 +02:00
|
|
|
int enum_ord(e_t e);
|
2007-06-26 03:27:24 +02:00
|
|
|
double square_encue(encue_t *eue);
|
2008-03-21 00:06:14 +01:00
|
|
|
void check_se2(se_t *s);
|
2007-09-04 18:33:23 +02:00
|
|
|
|
|
|
|
int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n);
|
|
|
|
int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c);
|
|
|
|
|
2007-09-04 20:04:37 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char c;
|
|
|
|
int i;
|
|
|
|
short s;
|
|
|
|
double d;
|
|
|
|
} aligns_t;
|
|
|
|
|
|
|
|
double sum_aligns(aligns_t *a);
|
|
|
|
|
2007-09-14 03:04:32 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char c;
|
|
|
|
} padded_t;
|
|
|
|
|
|
|
|
int sum_padded(padded_t *p);
|
2007-09-19 00:29:59 +02:00
|
|
|
int sum_padded2(padded_t ps[2]);
|
2007-09-20 02:05:38 +02:00
|
|
|
int sum_padded_conf([size_is(n)] padded_t *ps, int n);
|
2007-09-14 03:04:32 +02:00
|
|
|
|
2007-09-19 00:28:49 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int *p1;
|
|
|
|
} bogus_helper_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
bogus_helper_t h;
|
|
|
|
int *p2;
|
|
|
|
int *p3;
|
|
|
|
char c;
|
|
|
|
} bogus_t;
|
|
|
|
|
|
|
|
int sum_bogus(bogus_t *b);
|
2007-09-20 02:04:49 +02:00
|
|
|
void check_null([unique] int *null);
|
2007-09-19 00:28:49 +02:00
|
|
|
|
2007-09-26 20:32:47 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
str_t s;
|
|
|
|
} str_struct_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
wstr_t s;
|
|
|
|
} wstr_struct_t;
|
|
|
|
|
|
|
|
int str_struct_len(str_struct_t *s);
|
|
|
|
int wstr_struct_len(wstr_struct_t *s);
|
|
|
|
|
2007-10-11 00:29:54 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned int n;
|
|
|
|
[size_is(n)] byte a[];
|
|
|
|
} doub_carr_1_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int n;
|
|
|
|
[size_is(n)] doub_carr_1_t *a[];
|
|
|
|
} doub_carr_t;
|
|
|
|
|
|
|
|
int sum_doub_carr(doub_carr_t *dc);
|
|
|
|
void make_pyramid_doub_carr(unsigned char n, [out] doub_carr_t **dc);
|
|
|
|
|
2007-10-20 00:30:12 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
short n;
|
|
|
|
[size_is(n)] short data[];
|
2008-10-14 00:36:17 +02:00
|
|
|
} user_bstr_t;
|
2007-10-20 00:30:12 +02:00
|
|
|
|
2008-10-14 00:36:17 +02:00
|
|
|
typedef [unique] user_bstr_t *wire_bstr_t;
|
2007-10-20 00:30:12 +02:00
|
|
|
typedef [wire_marshal(wire_bstr_t)] short *bstr_t;
|
|
|
|
unsigned hash_bstr(bstr_t s);
|
|
|
|
|
2007-11-01 23:04:43 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
[string, size_is(size)] char *name;
|
|
|
|
unsigned int size;
|
|
|
|
} name_t;
|
|
|
|
void get_name([in,out] name_t *name);
|
|
|
|
|
2007-11-02 23:24:08 +01:00
|
|
|
int sum_pcarr2(int n, [size_is(, n)] int **pa);
|
2007-11-06 02:23:26 +01:00
|
|
|
int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
|
2007-11-02 23:24:08 +01:00
|
|
|
|
2008-02-22 00:46:51 +01:00
|
|
|
/* Don't use this except in the get_s123 test. */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int f1;
|
|
|
|
int f2;
|
|
|
|
int f3;
|
|
|
|
} s123_t;
|
|
|
|
|
|
|
|
/* Make sure WIDL generates a type format string for a previously unseen
|
|
|
|
type as a return value. */
|
|
|
|
s123_t *get_s123(void);
|
|
|
|
|
2008-06-23 10:25:25 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned int length;
|
|
|
|
unsigned int size;
|
|
|
|
[size_is(size), length_is(length)] pints_t numbers[];
|
|
|
|
} numbers_struct_t;
|
|
|
|
|
2007-12-24 18:01:20 +01:00
|
|
|
void get_numbers([in] int length, [in] int size, [out, length_is(length), size_is(size)] pints_t pn[]);
|
2008-06-23 10:25:25 +02:00
|
|
|
void get_numbers_struct([out] numbers_struct_t **ns);
|
|
|
|
|
2007-12-10 15:24:11 +01:00
|
|
|
str_t get_filename(void);
|
2009-11-07 15:54:28 +01:00
|
|
|
|
|
|
|
enum renum
|
|
|
|
{
|
|
|
|
RE0,
|
|
|
|
RE1,
|
|
|
|
RE2,
|
|
|
|
RE3,
|
|
|
|
};
|
|
|
|
const int RE_MIN = RE0;
|
|
|
|
const int RE_MAX = RE3;
|
|
|
|
typedef [range(RE_MIN, RE_MAX)] enum renum renum_t;
|
|
|
|
typedef [range(0, 100)] int rint_t;
|
|
|
|
rint_t echo_ranged_int([range(0, 100)] int n);
|
|
|
|
void get_ranged_enum([out] renum_t *re);
|
|
|
|
|
2007-12-25 20:08:07 +01:00
|
|
|
void context_handle_test(void);
|
2009-11-18 01:25:53 +01:00
|
|
|
|
|
|
|
void full_pointer_test([in, ptr] int *a, [in, ptr] int *b);
|
|
|
|
void full_pointer_null_test([in, ptr] int *a, [in, ptr] int *b);
|
|
|
|
|
2009-12-14 11:54:36 +01:00
|
|
|
void authinfo_test(unsigned int protseq, int secure);
|
|
|
|
|
2007-04-26 03:18:29 +02:00
|
|
|
void stop(void);
|
|
|
|
}
|