/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
/*
* rpc_sample.c, Sample client-server code outputter
* for the RPC protocol compiler
*/
#include <stdio.h>
#include <string.h>
#include "rpc_parse.h"
#include "rpc_util.h"
extern void printarglist(proc_list *, char *, char *, char *);
static void write_sample_client(char *, version_list *);
static void write_sample_server(definition *);
static void return_type(proc_list *);
void
{
return;
}
int
{
int count = 0;
return (0);
/* generate sample code for each version */
++count;
}
return (count);
}
static void
{
int i;
decl_list *l;
if (Cflag)
else
i = 0;
if (mtflag) {
else
}
} else {
}
/* print out declarations for arguments */
else
/* cannot have "void" type */
}
}
}
/* generate creation of client handle */
/* generate calls to procedures */
i = 0;
if (mtflag)
else
/* cast to void * */
if (mtflag) {
else
"_arg, &result_%d, clnt);\n", i);
} else
if (mtflag) {
else
"(&result_%d, clnt);\n", i);
} else
} else {
}
if (mtflag) {
}
}
if (mtflag) {
} else {
}
}
}
static void
{
if (!mtflag) {
} else {
}
else
if (!mtflag) {
else
/* cannot have void type */
}
"here\n\t */\n\n");
if (!mtflag)
"\treturn (&result);\n}\n");
else /* cast back to void * */
"&result);\n}\n");
else
}
/* put in sample freeing routine */
if (mtflag) {
if (Cflag)
" xdrproc_t xdr_result,"
" caddr_t result)\n");
else {
" result)\n");
}
"\t(void) xdr_free(xdr_result, result);\n"
"\n\t/*\n\t * Insert additional freeing"
" code here, if needed\n\t */\n"
"\n\n\treturn (TRUE);\n}\n");
}
}
}
static void
{
}
void
add_sample_msg(void)
{
}
void
write_sample_clnt_main(void)
{
list *l;
if (Cflag)
else
"\tchar *argv[];\n{\n");
" argv[0]);\n");
continue;
}
}
}