/*
 * This is sample code generated by rpcgen.
 * These are only templates and you can use them
 * as a guideline for developing your own functions.
 */

#include "gcd.h"
#include <stdio.h>
#include <stdlib.h> /* getenv, exit */
#include <signal.h>

int *
computegcd_1(argp, rqstp)
        struct param_t *argp;
        struct svc_req *rqstp;
{
        static int result;

        /*
         * Insert server code here:
         *     Fetch the parameters
                   struct param_t params = *argp;
         *     Perform computation 
                   while (params.x != params.y)
                   {
                       if (params.x > params.y)
                           params.x -= params.y;
                       else
                           params.y -= params.x;
                   }
         *     Save the result
                   result = params.x;
         **/

        return (&result);
}