/* Comprehensive RPC system test: Called subroutines - C BIG_SUB_C ============================= 21 Apr 87 Bug out: test sequence was not initialised. 31 Aug 87 C version derived - Nici. 5 Aug 88 BIG_SUB_C made from BIG_PROG_C - Tim. This module passes simple variables by ADDRESS, not by value. It is compatible with stubs produced WITHOUT the /BYVALUE option. */ #include #include #define byte_type rpc_byte #define char_type rpc_char #define short_type rpc_short #define long_type rpc_long #define real_type rpc_real32 typedef rpc_char str_type[81]; typedef rpc_char substr_type[80]; typedef rpc_char array_type[11][8]; typedef rpc_integer seq_type[80]; byte_type my_byte, his_byte; char_type my_char, his_char; short_type my_short, his_short; long_type my_long, his_long; real_type my_real, his_real; str_type my_str, his_str; array_type my_array, his_array; substr_type a_my_substr, a_his_substr; rpc_integer s_my_substr, s_his_substr, l_my_substr, l_his_substr; seq_type a_my_seq, a_his_seq; rpc_integer l_my_seq, l_his_seq; /* Small subroutine for testing mixed directions */ int bigsub1(x,y,z) int *x, *y, *z; { *y = *x + *y; /* Modify this parameter */ *z = *x * 3; /* Return this parameter */ return((*x) * (*x)); } /* end bigsub1 */ /* ______________________________________________________________________________ Dummy with no parameters */ void no_parameters() { /* Does nothing */ } /* ______________________________________________________________________________ Pass parameters in only */ only_in(x_byte, x_char, x_short, x_long, x_real, x_str, a_x_substr, s_x_substr, l_x_substr, x_array, a_x_seq, l_x_seq) byte_type *x_byte; char_type *x_char; short_type *x_short; long_type *x_long; real_type *x_real; str_type x_str; array_type x_array; substr_type a_x_substr; rpc_integer *s_x_substr, *l_x_substr; seq_type a_x_seq; rpc_integer *l_x_seq; { int i,j; my_byte = *x_byte; my_char = *x_char; my_short = *x_short; my_long = *x_long; my_real = *x_real; strcpy(my_str, x_str); s_my_substr = *s_x_substr; l_my_substr = *l_x_substr; for (i=(*s_x_substr); i<(*s_x_substr+*l_x_substr); i++) a_my_substr[i-1]=a_x_substr[i-1]; for (i=0; i<11; i++) for (j=0; j<8; j++) my_array[i][j]=x_array[i][j]; l_my_seq = *l_x_seq; for (i=0; i<*l_x_seq; i++) a_my_seq[i]=a_x_seq[i]; } /* end only_in */ /* ______________________________________________________________________________ Pass parameters out only */ only_out(x_byte, x_char, x_short, x_long, x_real, x_str, a_x_substr, s_x_substr, l_x_substr, x_array, a_x_seq, l_x_seq) byte_type *x_byte; char_type *x_char; short_type *x_short; long_type *x_long; real_type *x_real; str_type x_str; array_type x_array; substr_type a_x_substr; rpc_integer *s_x_substr, *l_x_substr; seq_type a_x_seq; rpc_integer *l_x_seq; { int i,j; *x_byte = my_byte; *x_char = my_char; *x_short = my_short; *x_long = my_long; *x_real = my_real; strcpy(x_str, my_str); *s_x_substr = s_my_substr; *l_x_substr = l_my_substr; for (i=s_my_substr; i