/* * 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 "addiere.h" void addiere_test_1(char *host) { CLIENT *clnt; int *result_1; add_struct addiere_1_arg; #ifndef DEBUG clnt = clnt_create (host, ADDIERE_TEST, ONE, "udp"); if (clnt == NULL) { clnt_pcreateerror (host); exit (1); } #endif /* DEBUG */ /* my code START */ addiere_1_arg.p1 = 5; addiere_1_arg.p2 = 6; /* my code END */ result_1 = addiere_1(&addiere_1_arg, clnt); if (result_1 == (int *) NULL) { clnt_perror (clnt, "call failed"); } /* my code START */ else { printf("addiere(5,6) liefert %d\n", *result_1); } /* my code END */ #ifndef DEBUG clnt_destroy (clnt); #endif /* DEBUG */ } int main (int argc, char *argv[]) { char *host; if (argc < 2) { printf ("usage: %s server_host\n", argv[0]); exit (1); } host = argv[1]; addiere_test_1 (host); exit (0); }