A.3.3 Fichier C du serveur
/*
* 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 "calc.h"
int *
add_1_svc(operandes *argp, struct svc_req *rqstp)
{
static int result;
/* AJOUT DE CODE : implantation de l'addition */
result=argp->x+argp->y;
/* FIN D'AJOUT DE CODE */
return(&result);
}
int *
sub_1_svc(operandes *argp, struct svc_req *rqstp)
{
static int result;
/* AJOUT DE CODE : implantation de la soustraction */
result=argp->x-argp->y;
/* FIN D'AJOUT DE CODE */
return(&result);
}