mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 17:38:56 +08:00
Misc. ansifications. Add prototypes.
This commit is contained in:
@@ -49,17 +49,17 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_mem.c,v 1.8 1999/08/28 00:0
|
||||
#include <rpc/xdr.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
static bool_t xdrmem_getlong_aligned();
|
||||
static bool_t xdrmem_putlong_aligned();
|
||||
static bool_t xdrmem_getlong_unaligned();
|
||||
static bool_t xdrmem_putlong_unaligned();
|
||||
static bool_t xdrmem_getbytes();
|
||||
static bool_t xdrmem_putbytes();
|
||||
static u_int xdrmem_getpos(); /* XXX w/64-bit pointers, u_int not enough! */
|
||||
static bool_t xdrmem_setpos();
|
||||
static int32_t *xdrmem_inline_aligned();
|
||||
static int32_t *xdrmem_inline_unaligned();
|
||||
static void xdrmem_destroy();
|
||||
static bool_t xdrmem_getlong_aligned(XDR *xdrs, long *lp);
|
||||
static bool_t xdrmem_putlong_aligned(XDR *xdrs, const long *lp);
|
||||
static bool_t xdrmem_getlong_unaligned(XDR *xdrs, long *lp);
|
||||
static bool_t xdrmem_putlong_unaligned(XDR *xdrs, const long *lp);
|
||||
static bool_t xdrmem_getbytes(XDR *xdrs, caddr_t addr, u_int len);
|
||||
static bool_t xdrmem_putbytes(XDR *xdrs, const char *addr, u_int len);
|
||||
static u_int xdrmem_getpos(XDR *xdrs); /* XXX w/64-bit pointers, u_int not enough! */
|
||||
static bool_t xdrmem_setpos(XDR *xdrs, u_int pos);
|
||||
static int32_t *xdrmem_inline_aligned(XDR *xdrs, u_int len);
|
||||
static int32_t *xdrmem_inline_unaligned(XDR *xdrs, u_int len);
|
||||
static void xdrmem_destroy(XDR *);
|
||||
|
||||
static struct xdr_ops xdrmem_ops_aligned = {
|
||||
xdrmem_getlong_aligned,
|
||||
@@ -103,8 +103,7 @@ xdrmem_create(
|
||||
}
|
||||
|
||||
static void
|
||||
xdrmem_destroy(/*xdrs*/)
|
||||
/*XDR *xdrs;*/
|
||||
xdrmem_destroy(XDR *xdrs)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -125,7 +124,7 @@ xdrmem_getlong_aligned(
|
||||
static bool_t
|
||||
xdrmem_putlong_aligned(
|
||||
XDR *xdrs,
|
||||
long *lp)
|
||||
const long *lp)
|
||||
{
|
||||
|
||||
if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
|
||||
@@ -153,7 +152,7 @@ xdrmem_getlong_unaligned(
|
||||
static bool_t
|
||||
xdrmem_putlong_unaligned(
|
||||
XDR *xdrs,
|
||||
long *lp)
|
||||
const long *lp)
|
||||
{
|
||||
int32_t l;
|
||||
|
||||
@@ -182,7 +181,7 @@ xdrmem_getbytes(
|
||||
static bool_t
|
||||
xdrmem_putbytes(
|
||||
XDR *xdrs,
|
||||
caddr_t addr,
|
||||
const char *addr,
|
||||
u_int len)
|
||||
{
|
||||
|
||||
@@ -220,7 +219,7 @@ xdrmem_setpos(
|
||||
static int32_t *
|
||||
xdrmem_inline_aligned(
|
||||
XDR *xdrs,
|
||||
int len)
|
||||
u_int len)
|
||||
{
|
||||
int32_t *buf = 0;
|
||||
|
||||
@@ -235,7 +234,7 @@ xdrmem_inline_aligned(
|
||||
static int32_t *
|
||||
xdrmem_inline_unaligned(
|
||||
XDR *xdrs,
|
||||
int len)
|
||||
u_int len)
|
||||
{
|
||||
|
||||
return (0);
|
||||
|
||||
@@ -57,20 +57,22 @@ static char *rcsid = "$FreeBSD: src/lib/libc/xdr/xdr_rec.c,v 1.12 2000/01/19 06:
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h> /* for lseek() */
|
||||
|
||||
static u_int fix_buf_size();
|
||||
static bool_t flush_out();
|
||||
static bool_t get_input_bytes();
|
||||
static bool_t set_input_fragment();
|
||||
static bool_t skip_input_bytes();
|
||||
typedef struct rec_strm RECSTREAM;
|
||||
|
||||
static bool_t xdrrec_getlong();
|
||||
static bool_t xdrrec_putlong();
|
||||
static bool_t xdrrec_getbytes();
|
||||
static bool_t xdrrec_putbytes();
|
||||
static u_int xdrrec_getpos();
|
||||
static bool_t xdrrec_setpos();
|
||||
static int32_t *xdrrec_inline();
|
||||
static void xdrrec_destroy();
|
||||
static u_int fix_buf_size(u_int);
|
||||
static bool_t flush_out(RECSTREAM *rstrm, bool_t eor);
|
||||
static bool_t get_input_bytes(RECSTREAM *rstrm, caddr_t addr, int len);
|
||||
static bool_t set_input_fragment(RECSTREAM *rstrm);
|
||||
static bool_t skip_input_bytes(RECSTREAM *rstrm, long cnt);
|
||||
|
||||
static bool_t xdrrec_getlong(XDR *xdrs, long *lp);
|
||||
static bool_t xdrrec_putlong(XDR *xdrs, const long *lp);
|
||||
static bool_t xdrrec_getbytes(XDR *xdrs, caddr_t addr, u_int len);
|
||||
static bool_t xdrrec_putbytes(XDR *xdrs, const char *addr, u_int len);
|
||||
static u_int xdrrec_getpos(XDR *xdrs);
|
||||
static bool_t xdrrec_setpos(XDR *xdrs, u_int pos);
|
||||
static int32_t *xdrrec_inline(XDR *xdrs, u_int len);
|
||||
static void xdrrec_destroy(XDR *xdrs);
|
||||
|
||||
static struct xdr_ops xdrrec_ops = {
|
||||
xdrrec_getlong,
|
||||
@@ -98,7 +100,7 @@ static struct xdr_ops xdrrec_ops = {
|
||||
|
||||
#define LAST_FRAG ((u_int32_t)(1L << 31))
|
||||
|
||||
typedef struct rec_strm {
|
||||
struct rec_strm {
|
||||
caddr_t tcp_handle;
|
||||
caddr_t the_buffer;
|
||||
/*
|
||||
@@ -122,7 +124,7 @@ typedef struct rec_strm {
|
||||
bool_t last_frag;
|
||||
u_int sendsize;
|
||||
u_int recvsize;
|
||||
} RECSTREAM;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
@@ -221,7 +223,7 @@ xdrrec_getlong(
|
||||
static bool_t
|
||||
xdrrec_putlong(
|
||||
XDR *xdrs,
|
||||
long *lp)
|
||||
const long *lp)
|
||||
{
|
||||
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
|
||||
int32_t *dest_lp = ((int32_t *)(rstrm->out_finger));
|
||||
@@ -273,7 +275,7 @@ xdrrec_getbytes(
|
||||
static bool_t
|
||||
xdrrec_putbytes(
|
||||
XDR *xdrs,
|
||||
caddr_t addr,
|
||||
const char *addr,
|
||||
u_int len)
|
||||
{
|
||||
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
|
||||
@@ -363,7 +365,7 @@ xdrrec_setpos(
|
||||
static int32_t *
|
||||
xdrrec_inline(
|
||||
XDR *xdrs,
|
||||
int len)
|
||||
u_int len)
|
||||
{
|
||||
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
|
||||
int32_t * buf = NULL;
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
|
||||
/* ARGSUSED */
|
||||
static bool_t
|
||||
x_putlong(xdrs, longp)
|
||||
XDR *xdrs;
|
||||
long *longp;
|
||||
x_putlong(
|
||||
XDR *xdrs,
|
||||
const long *longp)
|
||||
{
|
||||
xdrs->x_handy += BYTES_PER_XDR_UNIT;
|
||||
return (TRUE);
|
||||
@@ -52,36 +52,36 @@ x_putlong(xdrs, longp)
|
||||
|
||||
/* ARGSUSED */
|
||||
static bool_t
|
||||
x_putbytes(xdrs, bp, len)
|
||||
XDR *xdrs;
|
||||
char *bp;
|
||||
int len;
|
||||
x_putbytes(
|
||||
XDR *xdrs,
|
||||
const char *bp,
|
||||
u_int len)
|
||||
{
|
||||
xdrs->x_handy += len;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
static u_int
|
||||
x_getpostn(xdrs)
|
||||
XDR *xdrs;
|
||||
x_getpostn(
|
||||
XDR *xdrs)
|
||||
{
|
||||
return (xdrs->x_handy);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static bool_t
|
||||
x_setpostn(xdrs, pos)
|
||||
XDR *xdrs;
|
||||
u_int pos;
|
||||
x_setpostn(
|
||||
XDR *xdrs,
|
||||
u_int pos)
|
||||
{
|
||||
/* This is not allowed */
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
static int32_t *
|
||||
x_inline(xdrs, len)
|
||||
XDR *xdrs;
|
||||
long len;
|
||||
x_inline(
|
||||
XDR *xdrs,
|
||||
u_int len)
|
||||
{
|
||||
if (len == 0) {
|
||||
return (NULL);
|
||||
@@ -108,15 +108,15 @@ x_inline(xdrs, len)
|
||||
}
|
||||
|
||||
static int
|
||||
harmless()
|
||||
harmless(void)
|
||||
{
|
||||
/* Always return FALSE/NULL, as the case may be */
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
x_destroy(xdrs)
|
||||
XDR *xdrs;
|
||||
x_destroy(
|
||||
XDR *xdrs)
|
||||
{
|
||||
xdrs->x_handy = 0;
|
||||
xdrs->x_base = 0;
|
||||
@@ -128,9 +128,9 @@ x_destroy(xdrs)
|
||||
}
|
||||
|
||||
unsigned long
|
||||
xdr_sizeof(func, data)
|
||||
xdrproc_t func;
|
||||
void *data;
|
||||
xdr_sizeof(
|
||||
xdrproc_t func,
|
||||
void *data)
|
||||
{
|
||||
XDR x;
|
||||
struct xdr_ops ops;
|
||||
|
||||
Reference in New Issue
Block a user