Main Page | Class List | File List | Class Members | File Members | Related Pages

gi_xdr.h File Reference

XDR dncoding and decoding routines for the RPC-based interface protocol. More...

#include "gi_buffer.h"
#include "gi_array.h"

Go to the source code of this file.

Classes

struct  gi_xdr

Typedefs

typedef gi_xdr GiXdr
typedef bool(* gi_xdrproc_t )(GiXdr *xdrs, void *,...)

Enumerations

enum  gi_xdrop_t { GI_XDR_ENCODE, GI_XDR_DECODE, GI_XDR_FREE }

Functions

EXTERN_C_BEGIN LIBGIFT_EXPORT
void 
gi_xdrmem_create (GiXdr *xdrs, void *buf, size_t size, gi_xdrop_t op)
LIBGIFT_EXPORT void gi_xdr_destroy (GiXdr *xdrs)
LIBGIFT_EXPORT bool gi_xdr_free (GiXdr *xdrs, gi_xdrproc_t proc, void *args)
LIBGIFT_EXPORT bool gi_xdr_void (GiXdr *xdrs)
LIBGIFT_EXPORT bool gi_xdr_int32_t (GiXdr *xdrs, int32_t *vref)
LIBGIFT_EXPORT bool gi_xdr_uint32_t (GiXdr *xdrs, uint32_t *vref)
LIBGIFT_EXPORT bool gi_xdr_array (GiXdr *xdrs, GiArray *vref, size_t max, gi_xdrproc_t proc)
LIBGIFT_EXPORT bool gi_xdr_string (GiXdr *xdrs, char **vref, size_t maxlen)
LIBGIFT_EXPORT bool gi_xdr_bytes (GiXdr *xdrs, unsigned char **vref, size_t *lenref, size_t maxlen)
LIBGIFT_EXPORT bool gi_xdr_enum (GiXdr *xdrs, int32_t *vref)
LIBGIFT_EXPORT bool gi_xdr_bool (GiXdr *xdrs, bool *vref)
LIBGIFT_EXPORT bool gi_xdr_off_t (GiXdr *xdrs, off_t *vref)


Detailed Description

XDR dncoding and decoding routines for the RPC-based interface protocol.

For more details about RPC and/or XDR, see the following RFC entries:

http://www.ietf.org/rfc/rfc1831.txt http://www.ietf.org/rfc/rfc1832.txt


Typedef Documentation

typedef bool(* gi_xdrproc_t)(GiXdr *xdrs, void *,...)
 

XDR encode/decode procedure abstraction for the purpose of simulated polymorphism.

typedef struct gi_xdr GiXdr
 

Handle used for both encoding and decoding of XDR memory buffers. This differs considerably from the implementation found in glibc in that we only support one underlying access method.


Enumeration Type Documentation

enum gi_xdrop_t
 

Maintained from the original Sun code for consistency with rpcgen output. Frankly though, I think this approach is pretty stupid.


Function Documentation

LIBGIFT_EXPORT bool gi_xdr_array GiXdr xdrs,
GiArray vref,
size_t  max,
gi_xdrproc_t  proc
 

Implements XDR arrays. The array must be initialized prior to calling gi_xdr_array (see gi_array_init).

LIBGIFT_EXPORT bool gi_xdr_bool GiXdr xdrs,
bool *  vref
 

Implements the XDR "bool" type.

LIBGIFT_EXPORT bool gi_xdr_bytes GiXdr xdrs,
unsigned char **  vref,
size_t *  lenref,
size_t  maxlen
 

Implements the XDR "opaque" type when used with a dynamically-sized data block. For example, this can be used to satisfy opaque foo<400>, but should not be used for opaque foo[400].

LIBGIFT_EXPORT void gi_xdr_destroy GiXdr xdrs  ) 
 

Deinitialize the handle. If an internally managed memory buffer was allocated from ::gd_xdrmem_create, it will be free'd by this call.

LIBGIFT_EXPORT bool gi_xdr_enum GiXdr xdrs,
int32_t *  vref
 

Implements the XDR "enum" type.

LIBGIFT_EXPORT bool gi_xdr_free GiXdr xdrs,
gi_xdrproc_t  proc,
void *  args
 

Free the arguments described by `args' according to `proc'. Return value carried down from `proc'.

LIBGIFT_EXPORT bool gi_xdr_int32_t GiXdr xdrs,
int32_t *  vref
 

Implements the XDR "int" type.

LIBGIFT_EXPORT bool gi_xdr_off_t GiXdr xdrs,
off_t *  vref
 

Custom off_t type written using the XDR "hyper" type.

LIBGIFT_EXPORT bool gi_xdr_string GiXdr xdrs,
char **  vref,
size_t  maxlen
 

Implements the XDR "string" type. For variable-length arrays with no maximum size specified, `maxlen' should equal UINT32_MAX.

LIBGIFT_EXPORT bool gi_xdr_uint32_t GiXdr xdrs,
uint32_t *  vref
 

Implements the XDR "unsigned int" type.

LIBGIFT_EXPORT bool gi_xdr_void GiXdr xdrs  ) 
 

Implements the XDR "void" type. This function is a no-op, and always returns true.

EXTERN_C_BEGIN LIBGIFT_EXPORT void gi_xdrmem_create GiXdr xdrs,
void *  buf,
size_t  size,
gi_xdrop_t  op
 

Initialize the XDR handle and associate a memory buffer to encode to or decode from.

Parameters:
xdrs Storage location for the new handle.
buf Previously allocated memory buffer. If `op' is GI_XDR_ENCODE, this parameter may be specified as NULL, in which case a dynamic buffer will be allocated and managed internally.
size Size of the internal buffer buffer. This parameter is used to prevent overflows when operating on `buf'.
op Operation to perform. Describes whether we are encoding data to or decoding from `buf'.


Generated on Sun Aug 22 07:56:41 2004 by doxygen 1.3.7