
#include <rpcrts.h>

typedef    rpc_byte my_array[10000];

program_index p_timesub;

extern test();
/*  Parameters: 
    my_array a_seq;
    rpc_integer l_seq;
    */

static rpc_message *rpc_p_buf;

r_test()
{
    my_array a_seq;
    rpc_integer l_seq;
    register rpc_integer rpc_a;

   upk_integer(rpc_p_buf, l_seq);
   for (rpc_a = 0; rpc_a< l_seq; rpc_a++) {
          if (rpc_p_buf->m_index > RPC_BUFFER_SIZE - 1) (void)rpc_get(&rpc_p_buf);
      upk_byte(rpc_p_buf, a_seq[rpc_a]);
         }
    c_turn(rpc_p_buf);
    test(a_seq, l_seq);
    }

r_timesub(rpc_a) rpc_message **rpc_a;
{   rpc_short request;

    rpc_p_buf = *rpc_a;
    rpc_p_buf->m_index = CALL_HEADER_LENGTH - 4;
    upk_short(rpc_p_buf, request);
    if (request != 0 && request != 6455)
         rpc_p_buf->m_status = RPC_S_UNSUPPORTED_VERSION;
    else {
     upk_short(rpc_p_buf, request);
     switch (request)
     {   case  1 : r_test();
                  break;
        default : rpc_p_buf->m_status = RPC_S_BAD_PROCEDURE_NUMBER;
        }
     }
    }

attach_timesub()
{   rpc_status      status;

    c_attach_stub(status, r_timesub, 
        "timesub                                 ", p_timesub);
    c_report_error(status);
    }
