diff options
Diffstat (limited to 'sunrpc/rpc/xdr.h')
-rw-r--r-- | sunrpc/rpc/xdr.h | 86 |
1 files changed, 49 insertions, 37 deletions
diff --git a/sunrpc/rpc/xdr.h b/sunrpc/rpc/xdr.h index a4e66c9fc2..fe72abb7d8 100644 --- a/sunrpc/rpc/xdr.h +++ b/sunrpc/rpc/xdr.h @@ -117,23 +117,23 @@ struct XDR enum xdr_op x_op; /* operation; fast additional param */ struct xdr_ops { - bool_t (*x_getlong) __PMT ((XDR * __xdrs, long *__lp)); + bool_t (*x_getlong) __PMT ((XDR *__xdrs, long *__lp)); /* get a long from underlying stream */ - bool_t (*x_putlong) __PMT ((XDR * __xdrs, __const long *__lp)); + bool_t (*x_putlong) __PMT ((XDR *__xdrs, __const long *__lp)); /* put a long to " */ - bool_t (*x_getbytes) __PMT ((XDR * __xdrs, caddr_t __addr, + bool_t (*x_getbytes) __PMT ((XDR *__xdrs, caddr_t __addr, u_int __len)); /* get some bytes from " */ - bool_t (*x_putbytes) __PMT ((XDR * __xdrs, __const char *__addr, + bool_t (*x_putbytes) __PMT ((XDR *__xdrs, __const char *__addr, u_int __len)); /* put some bytes to " */ - u_int (*x_getpostn) __PMT ((__const XDR * __xdrs)); + u_int (*x_getpostn) __PMT ((__const XDR *__xdrs)); /* returns bytes off from beginning */ - bool_t (*x_setpostn) __PMT ((XDR * __xdrs, u_int pos)); + bool_t (*x_setpostn) __PMT ((XDR *__xdrs, u_int pos)); /* lets you reposition the stream */ - long *(*x_inline) __PMT ((XDR * __xdrs, int len)); + long *(*x_inline) __PMT ((XDR *__xdrs, int len)); /* buf quick ptr to buffered data */ - void (*x_destroy) __PMT ((XDR * __xdrs)); + void (*x_destroy) __PMT ((XDR *__xdrs)); /* free privates of this xdr_stream */ } *x_ops; @@ -163,6 +163,16 @@ typedef bool_t (*xdrproc_t) __PMT ((XDR *, void *,...)); * u_int len; * u_int pos; */ +#define XDR_GETINT32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, (long *)int32p) +#define xdr_getint32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, (long *)int32p) + +#define XDR_PUTINT32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, (long *)int32p) +#define xdr_putint32(xdrs, int32p) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, (long *)int32p) + #define XDR_GETLONG(xdrs, longp) \ (*(xdrs)->x_ops->x_getlong)(xdrs, longp) #define xdr_getlong(xdrs, longp) \ @@ -259,35 +269,37 @@ struct xdr_discrim * also, the XDR structure is always updated by some of these calls. */ extern bool_t xdr_void __P ((void)); -extern bool_t xdr_int __P ((XDR * __xdrs, int *__ip)); -extern bool_t xdr_u_int __P ((XDR * __xdrs, u_int * __up)); -extern bool_t xdr_long __P ((XDR * __xdrs, long *__lp)); -extern bool_t xdr_u_long __P ((XDR * __xdrs, u_long * __ulp)); -extern bool_t xdr_short __P ((XDR * __xdrs, short *__sp)); -extern bool_t xdr_u_short __P ((XDR * __xdrs, u_short * __usp)); -extern bool_t xdr_bool __P ((XDR * __xdrs, bool_t * __bp)); -extern bool_t xdr_enum __P ((XDR * __xdrs, enum_t * __ep)); -extern bool_t xdr_array __P ((XDR * _xdrs, caddr_t * __addrp, u_int * __sizep, +extern bool_t xdr_int __P ((XDR *__xdrs, int *__ip)); +extern bool_t xdr_u_int __P ((XDR *__xdrs, u_int *__up)); +extern bool_t xdr_int32_t __P ((XDR *__xdrs, int32_t *__ip)); +extern bool_t xdr_uint32_t __P ((XDR *__xdrs, uint32_t *__up)); +extern bool_t xdr_long __P ((XDR *__xdrs, long *__lp)); +extern bool_t xdr_u_long __P ((XDR *__xdrs, u_long *__ulp)); +extern bool_t xdr_short __P ((XDR *__xdrs, short *__sp)); +extern bool_t xdr_u_short __P ((XDR *__xdrs, u_short *__usp)); +extern bool_t xdr_bool __P ((XDR *__xdrs, bool_t *__bp)); +extern bool_t xdr_enum __P ((XDR *__xdrs, enum_t *__ep)); +extern bool_t xdr_array __P ((XDR * _xdrs, caddr_t *__addrp, u_int *__sizep, u_int __maxsize, u_int __elsize, xdrproc_t __elproc)); -extern bool_t xdr_bytes __P ((XDR * __xdrs, char **__cpp, u_int * __sizep, +extern bool_t xdr_bytes __P ((XDR *__xdrs, char **__cpp, u_int *__sizep, u_int __maxsize)); -extern bool_t xdr_opaque __P ((XDR * __xdrs, caddr_t __cp, u_int __cnt)); -extern bool_t xdr_string __P ((XDR * __xdrs, char **__cpp, u_int __maxsize)); -extern bool_t xdr_union __P ((XDR * __xdrs, enum_t * __dscmp, char *__unp, - __const struct xdr_discrim * __choices, +extern bool_t xdr_opaque __P ((XDR *__xdrs, caddr_t __cp, u_int __cnt)); +extern bool_t xdr_string __P ((XDR *__xdrs, char **__cpp, u_int __maxsize)); +extern bool_t xdr_union __P ((XDR *__xdrs, enum_t *__dscmp, char *__unp, + __const struct xdr_discrim *__choices, xdrproc_t dfault)); -extern bool_t xdr_char __P ((XDR * __xdrs, char *__cp)); -extern bool_t xdr_u_char __P ((XDR * __xdrs, u_char * __cp)); -extern bool_t xdr_vector __P ((XDR * __xdrs, char *__basep, u_int __nelem, +extern bool_t xdr_char __P ((XDR *__xdrs, char *__cp)); +extern bool_t xdr_u_char __P ((XDR *__xdrs, u_char *__cp)); +extern bool_t xdr_vector __P ((XDR *__xdrs, char *__basep, u_int __nelem, u_int __elemsize, xdrproc_t __xdr_elem)); -extern bool_t xdr_float __P ((XDR * __xdrs, float *__fp)); -extern bool_t xdr_double __P ((XDR * __xdrs, double *__dp)); -extern bool_t xdr_reference __P ((XDR * __xdrs, caddr_t * __xpp, u_int __size, +extern bool_t xdr_float __P ((XDR *__xdrs, float *__fp)); +extern bool_t xdr_double __P ((XDR *__xdrs, double *__dp)); +extern bool_t xdr_reference __P ((XDR *__xdrs, caddr_t *__xpp, u_int __size, xdrproc_t __proc)); -extern bool_t xdr_pointer __P ((XDR * __xdrs, char **__objpp, +extern bool_t xdr_pointer __P ((XDR *__xdrs, char **__objpp, u_int __obj_size, xdrproc_t __xdr_obj)); -extern bool_t xdr_wrapstring __P ((XDR * __xdrs, char **__cpp)); +extern bool_t xdr_wrapstring __P ((XDR *__xdrs, char **__cpp)); extern u_long xdr_sizeof __P ((xdrproc_t, void *)); /* @@ -301,7 +313,7 @@ struct netobj char *n_bytes; }; typedef struct netobj netobj; -extern bool_t xdr_netobj __P ((XDR * __xdrs, struct netobj * __np)); +extern bool_t xdr_netobj __P ((XDR *__xdrs, struct netobj *__np)); /* * These are the public routines for the various implementations of @@ -309,27 +321,27 @@ extern bool_t xdr_netobj __P ((XDR * __xdrs, struct netobj * __np)); */ /* XDR using memory buffers */ -extern void xdrmem_create __P ((XDR * __xdrs, __const caddr_t __addr, +extern void xdrmem_create __P ((XDR *__xdrs, __const caddr_t __addr, u_int __size, enum xdr_op __xop)); /* XDR using stdio library */ -extern void xdrstdio_create __P ((XDR * __xdrs, FILE * __file, +extern void xdrstdio_create __P ((XDR *__xdrs, FILE *__file, enum xdr_op __xop)); /* XDR pseudo records for tcp */ -extern void xdrrec_create __P ((XDR * __xdrs, u_int __sendsize, +extern void xdrrec_create __P ((XDR *__xdrs, u_int __sendsize, u_int __recvsize, caddr_t __tcp_handle, int (*__readit) (char *, char *, int), int (*__writeit) (char *, char *, int))); /* make end of xdr record */ -extern bool_t xdrrec_endofrecord __P ((XDR * __xdrs, bool_t __sendnow)); +extern bool_t xdrrec_endofrecord __P ((XDR *__xdrs, bool_t __sendnow)); /* move to beginning of next record */ -extern bool_t xdrrec_skiprecord __P ((XDR * __xdrs)); +extern bool_t xdrrec_skiprecord __P ((XDR *__xdrs)); /* true if no more input */ -extern bool_t xdrrec_eof __P ((XDR * __xdrs)); +extern bool_t xdrrec_eof __P ((XDR *__xdrs)); /* free memory buffers for xdr */ extern void xdr_free __P ((xdrproc_t __proc, char *__objp)); |