xdr_stdio_prv.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* xdr_stdio_prv.c, XDR implementation on special standard i/o file.
*
* To avoid the file descriptor limitation in stdio, we implement
* a private version of the same routines from xdr_stdio.c using
* modified FILE structure. ( __NSL_FILE )
* This set of routines implements a XDR on a special stdio stream.
* XDR_ENCODE serializes onto the stream, XDR_DECODE de-serializes
* from the stream.
*/
#include "rpc_mt.h"
#include <stdio.h>
#include <inttypes.h>
#include "nsl_stdio_prv.h"
static struct xdr_ops *__nsl_xdrstdio_ops(void);
/*
* Initialize a stdio xdr stream.
* Sets the xdr stream handle xdrs for use on the stream file.
* Operation flag is set to op.
*/
void
{
trace1(TR_xdrstdio_create, 0);
}
/*
* Destroy a stdio xdr stream.
* Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create.
*/
static void
{
/* xx should we close the file ?? */
}
static bool_t
{
return (FALSE);
}
return (TRUE);
}
static bool_t
{
return (FALSE);
}
return (TRUE);
}
static bool_t
register long *lp;
{
int32_t i;
if (!__nsl_xdrstdio_getint32(xdrs, &i))
return (FALSE);
*lp = (long)i;
return (TRUE);
}
static bool_t
long *lp;
{
int32_t i;
#if defined(_LP64)
return (FALSE);
}
#endif
return (__nsl_xdrstdio_putint32(xdrs, &i));
}
static bool_t
{
if ((len != 0) &&
return (FALSE);
}
return (TRUE);
}
static bool_t
{
if ((len != 0) &&
return (FALSE);
}
return (TRUE);
}
static uint_t
{
trace1(TR_xdrstdio_getpos, 0);
return (dummy1);
}
static bool_t
{
return (dummy2);
}
static rpc_inline_t *
{
/*
* Must do some work to implement this: must insure
* enough data in the underlying stdio buffer,
* that the buffer is aligned so that we can indirect through a
* long *, and stuff this pointer in xdrs->x_buf. Doing
* a fread or fwrite to a scratch buffer would defeat
* most of the gains to be had here and require storage
* management on this buffer, so we don't do this.
*/
return (NULL);
}
static bool_t
{
switch (request) {
default:
return (FALSE);
}
}
static struct xdr_ops *
{
/* VARIABLES PROTECTED BY ops_lock: ops */
trace1(TR_xdrstdio_ops, 0);
#if defined(_LP64)
#endif
}
return (&ops);
}