File:  [CSRG BSD Unix] / 43BSDReno / lib / librpc / toys / sort_service.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/*
 * sort_service.c
 * Implements the server side of the sort_service.
 */

#include <rpc/rpc.h>
#include "sort_prot.h"

static int
comparestrings(sp1, sp2) 
	char **sp1, **sp2;
{

	return (strcmp(*sp1, *sp2));
}

static struct sortstrings *
sort(ssp)
	struct sortstrings *ssp;
{

	qsort(ssp->s, ssp->ns, sizeof (char *), comparestrings);
	return(ssp);
}

main()
{

	/* register the serive */
	registerrpc(SORTPROG, SORTVERS, SORT,
	    sort, xdr_sortstrings, xdr_sortstrings);

	/* run the service forever */
	svc_run();  /* never returns */
	exit(1);
}


unix.superglobalmegacorp.com

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