blob: e6b9887ccdabe273b2f7ca2b849990fad1bc833b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/*
* 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);
}
|