1 /* @(#)rsort.c 2.1 88/08/11 4.0 RPCSRC */
4 * Client side application which sorts argc, argv.
15 struct sortstrings args, res;
19 fprintf(stderr, "usage: %s machinename [s1 ...]\n", argv[0]);
22 machinename = argv[1];
23 args.ss.ss_len = argc - 2; /* substract off progname, machinename */
24 args.ss.ss_val = &argv[2];
27 if ((i = callrpc(machinename, SORTPROG, SORTVERS, SORT,
28 xdr_sortstrings, &args, xdr_sortstrings, &res)))
30 fprintf(stderr, "%s: call to sort service failed. ", argv[0]);
32 fprintf(stderr, "\n");
36 for (i = 0; i < res.ss.ss_len; i++) {
37 printf("%s\n", res.ss.ss_val[i]);
40 /* should free res here */