00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef XDRHACK_H
00017 #define XDRHACK_H
00018
00031 #if defined (__CYGWIN32__)
00032 extern "C" {
00033 #include <rpc/types.h>
00034
00035 enum xdr_op {
00036 XDR_ENCODE=0,
00037 XDR_DECODE=1,
00038 XDR_FREE=2
00039 };
00040
00041 typedef struct __rpc_xdr {
00042 enum xdr_op x_op;
00043 const struct xdr_ops {
00044
00045
00046 bool_t (*x_getlong)(struct __rpc_xdr *, long *);
00047
00048
00049 bool_t (*x_putlong)(struct __rpc_xdr *, const long *);
00050
00051
00052 bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int);
00053
00054
00055 bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int);
00056
00057
00058 u_int (*x_getpostn)(struct __rpc_xdr *);
00059
00060
00061 bool_t (*x_setpostn)(struct __rpc_xdr *, u_int);
00062
00063
00064 int32_t *(*x_inline)(struct __rpc_xdr *, u_int);
00065
00066
00067 void (*x_destroy)(struct __rpc_xdr *);
00068 bool_t (*x_control)(struct __rpc_xdr *, int, void *);
00069 } *x_ops;
00070
00071 caddr_t x_public;
00072 caddr_t x_private;
00073 caddr_t x_base;
00074 int x_handy;
00075 } XDR;
00076
00077 #define XDR_DESTROY(xdrs) \
00078 if ((xdrs)->x_ops->x_destroy) \
00079 (*(xdrs)->x_ops->x_destroy)(xdrs)
00080
00081 #define xdr_destroy(xdrs) \
00082 if ((xdrs)->x_ops->x_destroy) \
00083 (*(xdrs)->x_ops->x_destroy)(xdrs)
00084
00085 typedef bool_t (*xdrproc_t)();
00086
00087 extern bool_t xdr_opaque (XDR *, caddr_t, u_int);
00088 extern bool_t xdr_string (XDR *, char **, u_int);
00089 extern bool_t xdr_vector (XDR *, char *, u_int, u_int, xdrproc_t);
00090 extern void xdrmem_create (XDR *, char *, u_int, enum xdr_op);
00091 extern void xdrstdio_create (XDR *, FILE *, enum xdr_op);
00092 extern bool_t xdr_int (XDR *, int *);
00093 extern bool_t xdr_float (XDR *, float *);
00094 extern bool_t xdr_double (XDR *, double *);
00095 extern bool_t xdr_char (XDR *, char *);
00096 }
00097
00098 #else
00099 # include <rpc/rpc.h>
00100 #endif
00101
00102 #endif