181 lines
3.6 KiB
Plaintext
181 lines
3.6 KiB
Plaintext
/*
|
|
* 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
|
|
*/
|
|
|
|
#include "server_defines.h"
|
|
|
|
typedef struct tag_vector
|
|
{
|
|
int x;
|
|
int y;
|
|
int z;
|
|
} vector_t;
|
|
|
|
[
|
|
uuid(00000000-4114-0704-2301-000000000000),
|
|
implicit_handle(handle_t IServer_IfHandle)
|
|
]
|
|
interface IServer
|
|
{
|
|
typedef struct
|
|
{
|
|
int *pi;
|
|
int **ppi;
|
|
int ***pppi;
|
|
} pints_t;
|
|
|
|
typedef struct
|
|
{
|
|
char *pc;
|
|
short *ps;
|
|
long *pl;
|
|
float *pf;
|
|
double *pd;
|
|
} ptypes_t;
|
|
|
|
typedef struct
|
|
{
|
|
vector_t *pu;
|
|
vector_t **pv;
|
|
} pvectors_t;
|
|
|
|
typedef struct
|
|
{
|
|
[switch_is(s)] union
|
|
{
|
|
[case(SUN_I)] int i;
|
|
[case(SUN_F1, SUN_F2)] float f;
|
|
[case(SUN_PI)] int *pi;
|
|
} u;
|
|
|
|
int s;
|
|
} sun_t;
|
|
|
|
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);
|
|
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);
|
|
int sum_fixed_array(int a[5]);
|
|
int pints_sum(pints_t *pints);
|
|
double ptypes_sum(ptypes_t *ptypes);
|
|
int dot_pvectors(pvectors_t *pvectors);
|
|
|
|
/* 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);
|
|
double square_sun(sun_t *su);
|
|
|
|
typedef struct test_list
|
|
{
|
|
int t;
|
|
[switch_is(t)] union
|
|
{
|
|
[case(TL_NULL)] int x; /* end of list */
|
|
[case(TL_LIST)] struct test_list *tail;
|
|
} u;
|
|
} test_list_t;
|
|
|
|
int test_list_length(test_list_t *ls);
|
|
int sum_fixed_int_3d(int m[2][3][4]);
|
|
int sum_conf_array([size_is(n)] int x[], int n);
|
|
int sum_var_array([length_is(n)] int x[20], int n);
|
|
int dot_two_vectors(vector_t vs[2]);
|
|
|
|
typedef struct
|
|
{
|
|
int n;
|
|
[size_is(n)] int ca[];
|
|
} cs_t;
|
|
|
|
typedef struct
|
|
{
|
|
int *pn;
|
|
[size_is(*pn)] int *ca1;
|
|
[size_is(n * 2)] int *ca2;
|
|
int n;
|
|
} cps_t;
|
|
|
|
int sum_cs(cs_t *cs);
|
|
int sum_cps(cps_t *cps);
|
|
|
|
typedef [wire_marshal(int)] void *puint_t;
|
|
int square_puint(puint_t p);
|
|
int dot_copy_vectors(vector_t u, vector_t v);
|
|
|
|
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);
|
|
|
|
typedef union encu switch (int t)
|
|
{
|
|
case ENCU_I: int i;
|
|
case ENCU_F: float f;
|
|
} encu_t;
|
|
|
|
typedef enum
|
|
{
|
|
E1 = 23,
|
|
E2 = 4,
|
|
E3 = 0,
|
|
E4 = 64
|
|
} e_t;
|
|
|
|
typedef union encue switch (e_t t)
|
|
{
|
|
case E1: int i1;
|
|
case E2: float f2;
|
|
} encue_t;
|
|
|
|
double square_encu(encu_t *eu);
|
|
int sum_parr(int *a[3]);
|
|
int sum_pcarr([size_is(n)] int *a[], int n);
|
|
int enum_ord(e_t e);
|
|
double square_encue(encue_t *eue);
|
|
void stop(void);
|
|
}
|