// mc3_svc_proc.c - Implementation of remote procedures

#include <stdio.h>
#include <rpc/rpc.h>
#include <pthread.h>
#include "mc.h"

static volatile int total = 0; /* We will keep here the sum of the */
                               /* results of all the operations.   */

static int v;

int *add_1(mypair *p) {
  v = p->arg1+p->arg2;
  total += v;
  printf("Total = %d\n", total);
  return &v;
}

int *subtract_1(mypair *p) {
  v = p->arg1-p->arg2;
  total += v;
  printf("Total = %d\n", total);
  return &v;
}
