Annotation of 43BSDReno/lib/librpc/toys/sortit.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * sortit.c
        !             3:  * Client side application which sorts argc, argv.
        !             4:  */
        !             5: #include <stdio.h>
        !             6: #include <rpc/rpc.h>
        !             7: #include "sort_prot.h"
        !             8: 
        !             9: main(argc, argv)
        !            10:        int argc;
        !            11:        char **argv;
        !            12: {
        !            13:        char *machinename;
        !            14:        struct sortstrings args, res;
        !            15:        int i;
        !            16: 
        !            17:        if (argc < 2) {
        !            18:                fprintf(stderr, "usage: %s machinename [s1 ...]\n", argv[0]);
        !            19:                exit(1);
        !            20:        }
        !            21:        machinename = argv[1];
        !            22:        args.ns = argc;
        !            23:        args.s = argv;
        !            24:        res.s = (char **)NULL;
        !            25: 
        !            26:        callrpc(machinename, SORTPROG, SORTVERS, SORT,
        !            27:            xdr_sortstrings, &args, xdr_sortstrings, &res);
        !            28: 
        !            29:        for (i = 0; i < res.ns; i++) {
        !            30:                printf("%s\n", res.s[i]);
        !            31:        }
        !            32: 
        !            33:        /* should free res here */
        !            34:        exit(0);
        !            35: }
        !            36: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.