
#include <rpcrts.h>

typedef    rpc_byte byte_type;
typedef    rpc_char char_type;
typedef    rpc_short short_type;
typedef    rpc_long long_type;
typedef    rpc_real32 real_type;
typedef    rpc_char str_type[81];
typedef    rpc_char substr_type[81];
typedef    rpc_char array_type[11][8];
typedef    rpc_long seq_type[80];

program_index p_bigsub;

extern in_out();
/*  Parameters: 
    rpc_byte *p1;
    rpc_char *p2;
    rpc_short *p3;
    rpc_long *p4;
    rpc_real32 *p5;
    str_type p6;
    substr_type a_p7;
    rpc_integer *s_p7;
    rpc_integer *l_p7;
    array_type p8;
    seq_type a_p9;
    rpc_integer *l_p9;
    */

extern only_in();
/*  Parameters: 
    rpc_byte *p1;
    rpc_char *p2;
    rpc_short *p3;
    rpc_long *p4;
    rpc_real32 *p5;
    str_type p6;
    substr_type a_p7;
    rpc_integer *s_p7;
    rpc_integer *l_p7;
    array_type p8;
    seq_type a_p9;
    rpc_integer *l_p9;
    */

extern only_out();
/*  Parameters: 
    rpc_byte *p1;
    rpc_char *p2;
    rpc_short *p3;
    rpc_long *p4;
    rpc_real32 *p5;
    str_type p6;
    substr_type a_p7;
    rpc_integer *s_p7;
    rpc_integer *l_p7;
    array_type p8;
    seq_type a_p9;
    rpc_integer *l_p9;
    */

extern rpc_long bigsub1();
/*  Parameters: 
    rpc_long *p1;
    rpc_long *p2;
    rpc_long *p3;
    */

extern no_parameters();
/*  Parameters: none
    */

static rpc_message *rpc_p_buf;

r_in_out()
{
    rpc_byte p1;
    rpc_char p2;
    rpc_short p3;
    rpc_long p4;
    rpc_real32 p5;
    str_type p6;
    substr_type a_p7;
    rpc_integer s_p7;
    rpc_integer l_p7;
    array_type p8;
    seq_type a_p9;
    rpc_integer l_p9;
    register rpc_integer rpc_a;
    register rpc_integer rpc_b;

   upk_byte(rpc_p_buf, p1);
   upk_char(rpc_p_buf, p2);
   upk_short(rpc_p_buf, p3);
   upk_long(rpc_p_buf, p4);
   upk_real32(rpc_p_buf, p5);
   upk_integer(rpc_p_buf, rpc_b);
   for (rpc_a = 0; rpc_a < rpc_b; rpc_a++) {
   upk_char(rpc_p_buf, p6[rpc_a]);
   }
   p6[rpc_b] = '\0';
    if (rpc_p_buf->m_index%2) rpc_p_buf->m_index++;
   upk_integer(rpc_p_buf, s_p7);
   upk_integer(rpc_p_buf, l_p7);
    for (rpc_a = s_p7-1; rpc_a < l_p7 + s_p7-1; rpc_a++) {
      upk_char(rpc_p_buf, a_p7[rpc_a]);
    }
    if (rpc_p_buf->m_index%2) rpc_p_buf->m_index++;
   for (rpc_a = 0; rpc_a<11; rpc_a++) {
      for (rpc_b = 0; rpc_b<8; rpc_b++) {
         upk_char(rpc_p_buf, p8[rpc_a][rpc_b]);
      }
   }
   upk_integer(rpc_p_buf, l_p9);
   for (rpc_a = 0; rpc_a< l_p9; rpc_a++) {
      upk_long(rpc_p_buf, a_p9[rpc_a]);
         }
    c_turn(rpc_p_buf);
    in_out(&p1, &p2, &p3, 
        &p4, &p5, p6, a_p7, &s_p7, &l_p7, 
        p8, a_p9, &l_p9);
   pck_byte(rpc_p_buf, p1);
   pck_char(rpc_p_buf, p2);
   pck_short(rpc_p_buf, p3);
   pck_long(rpc_p_buf, p4);
   pck_real32(rpc_p_buf, p5);
   for (rpc_b = 0; rpc_b <= 80; rpc_b++)
   if (p6[rpc_b] == '\0') break;
   pck_integer(rpc_p_buf, rpc_b);
   for (rpc_a = 0; rpc_a < rpc_b; rpc_a++) {
   pck_char(rpc_p_buf, p6[rpc_a]);
   }
    if (rpc_p_buf->m_index%2) rpc_p_buf->m_index++;
   pck_integer(rpc_p_buf, s_p7);
   pck_integer(rpc_p_buf, l_p7);
    for (rpc_a = s_p7-1; rpc_a < l_p7 + s_p7-1; rpc_a++) {
      pck_char(rpc_p_buf, a_p7[rpc_a]);
    }
    if (rpc_p_buf->m_index%2) rpc_p_buf->m_index++;
   for (rpc_a = 0; rpc_a<11; rpc_a++) {
      for (rpc_b = 0; rpc_b<8; rpc_b++) {
         pck_char(rpc_p_buf, p8[rpc_a][rpc_b]);
      }
   }
   pck_integer(rpc_p_buf, l_p9);
   for (rpc_a = 0; rpc_a< l_p9; rpc_a++) {
      pck_long(rpc_p_buf, a_p9[rpc_a]);
         }
    }

r_only_in()
{
    rpc_byte p1;
    rpc_char p2;
    rpc_short p3;
    rpc_long p4;
    rpc_real32 p5;
    str_type p6;
    substr_type a_p7;
    rpc_integer s_p7;
    rpc_integer l_p7;
    array_type p8;
    seq_type a_p9;
    rpc_integer l_p9;
    register rpc_integer rpc_a;
    register rpc_integer rpc_b;

   upk_byte(rpc_p_buf, p1);
   upk_char(rpc_p_buf, p2);
   upk_short(rpc_p_buf, p3);
   upk_long(rpc_p_buf, p4);
   upk_real32(rpc_p_buf, p5);
   upk_integer(rpc_p_buf, rpc_b);
   for (rpc_a = 0; rpc_a < rpc_b; rpc_a++) {
   upk_char(rpc_p_buf, p6[rpc_a]);
   }
   p6[rpc_b] = '\0';
    if (rpc_p_buf->m_index%2) rpc_p_buf->m_index++;
   upk_integer(rpc_p_buf, s_p7);
   upk_integer(rpc_p_buf, l_p7);
    for (rpc_a = s_p7-1; rpc_a < l_p7 + s_p7-1; rpc_a++) {
      upk_char(rpc_p_buf, a_p7[rpc_a]);
    }
    if (rpc_p_buf->m_index%2) rpc_p_buf->m_index++;
   for (rpc_a = 0; rpc_a<11; rpc_a++) {
      for (rpc_b = 0; rpc_b<8; rpc_b++) {
         upk_char(rpc_p_buf, p8[rpc_a][rpc_b]);
      }
   }
   upk_integer(rpc_p_buf, l_p9);
   for (rpc_a = 0; rpc_a< l_p9; rpc_a++) {
      upk_long(rpc_p_buf, a_p9[rpc_a]);
         }
    c_turn(rpc_p_buf);
    only_in(&p1, &p2, &p3, 
        &p4, &p5, p6, a_p7, &s_p7, &l_p7, 
        p8, a_p9, &l_p9);
    }

r_only_out()
{
    rpc_byte p1;
    rpc_char p2;
    rpc_short p3;
    rpc_long p4;
    rpc_real32 p5;
    str_type p6;
    substr_type a_p7;
    rpc_integer s_p7;
    rpc_integer l_p7;
    array_type p8;
    seq_type a_p9;
    rpc_integer l_p9;
    register rpc_integer rpc_a;
    register rpc_integer rpc_b;

    c_turn(rpc_p_buf);
    only_out(&p1, &p2, &p3, 
        &p4, &p5, p6, a_p7, &s_p7, &l_p7, 
        p8, a_p9, &l_p9);
   pck_byte(rpc_p_buf, p1);
   pck_char(rpc_p_buf, p2);
   pck_short(rpc_p_buf, p3);
   pck_long(rpc_p_buf, p4);
   pck_real32(rpc_p_buf, p5);
   for (rpc_b = 0; rpc_b <= 80; rpc_b++)
   if (p6[rpc_b] == '\0') break;
   pck_integer(rpc_p_buf, rpc_b);
   for (rpc_a = 0; rpc_a < rpc_b; rpc_a++) {
   pck_char(rpc_p_buf, p6[rpc_a]);
   }
    if (rpc_p_buf->m_index%2) rpc_p_buf->m_index++;
   pck_integer(rpc_p_buf, s_p7);
   pck_integer(rpc_p_buf, l_p7);
    for (rpc_a = s_p7-1; rpc_a < l_p7 + s_p7-1; rpc_a++) {
      pck_char(rpc_p_buf, a_p7[rpc_a]);
    }
    if (rpc_p_buf->m_index%2) rpc_p_buf->m_index++;
   for (rpc_a = 0; rpc_a<11; rpc_a++) {
      for (rpc_b = 0; rpc_b<8; rpc_b++) {
         pck_char(rpc_p_buf, p8[rpc_a][rpc_b]);
      }
   }
   pck_integer(rpc_p_buf, l_p9);
   for (rpc_a = 0; rpc_a< l_p9; rpc_a++) {
      pck_long(rpc_p_buf, a_p9[rpc_a]);
         }
    }

r_bigsub1()
{
    rpc_long p1;
    rpc_long p2;
    rpc_long p3;

   upk_long(rpc_p_buf, p1);
   upk_long(rpc_p_buf, p2);
    c_turn(rpc_p_buf);
    pck_long(rpc_p_buf, bigsub1(&p1, &p2, &p3));
   pck_long(rpc_p_buf, p2);
   pck_long(rpc_p_buf, p3);
    }

r_no_parameters()
{

    c_turn(rpc_p_buf);
    no_parameters();
    }

r_bigsub(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 != 1426)
         rpc_p_buf->m_status = RPC_S_UNSUPPORTED_VERSION;
    else {
     upk_short(rpc_p_buf, request);
     switch (request)
     {   case  1 : r_in_out();
                  break;
        case  2 : r_only_in();
                  break;
        case  3 : r_only_out();
                  break;
        case  4 : r_bigsub1();
                  break;
        case  5 : r_no_parameters();
                  break;
        default : rpc_p_buf->m_status = RPC_S_BAD_PROCEDURE_NUMBER;
        }
     }
    }

attach_bigsub()
{   rpc_status      status;

    c_attach_stub(status, r_bigsub, 
        "bigsub                                  ", p_bigsub);
    c_report_error(status);
    }
