Back to index

glibc  2.9
Defines | Functions
xdr_ref.c File Reference
#include <stdio.h>
#include <string.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <libintl.h>

Go to the source code of this file.

Defines

#define LASTUNSIGNED   ((u_int)0-1)

Functions

bool_t xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
bool_t xdr_pointer (XDR *xdrs, char **objpp, u_int obj_size, xdrproc_t xdr_obj)

Define Documentation

#define LASTUNSIGNED   ((u_int)0-1)

Definition at line 54 of file xdr_ref.c.


Function Documentation

bool_t xdr_pointer ( XDR xdrs,
char **  objpp,
u_int  obj_size,
xdrproc_t  xdr_obj 
)

Definition at line 125 of file xdr_ref.c.

{

  bool_t more_data;

  more_data = (*objpp != NULL);
  if (!INTUSE(xdr_bool) (xdrs, &more_data))
    {
      return FALSE;
    }
  if (!more_data)
    {
      *objpp = NULL;
      return TRUE;
    }
  return INTUSE(xdr_reference) (xdrs, objpp, obj_size, xdr_obj);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool_t xdr_reference ( XDR xdrs,
caddr_t pp,
u_int  size,
xdrproc_t  proc 
)

Definition at line 66 of file xdr_ref.c.

{
  caddr_t loc = *pp;
  bool_t stat;

  if (loc == NULL)
    switch (xdrs->x_op)
      {
      case XDR_FREE:
       return TRUE;

      case XDR_DECODE:
       *pp = loc = (caddr_t) calloc (1, size);
       if (loc == NULL)
         {
           (void) __fxprintf (NULL, "%s: %s", __func__, _("out of memory\n"));
           return FALSE;
         }
       break;
      default:
       break;
      }

  stat = (*proc) (xdrs, loc, LASTUNSIGNED);

  if (xdrs->x_op == XDR_FREE)
    {
      mem_free (loc, size);
      *pp = NULL;
    }
  return stat;
}

Here is the call graph for this function:

Here is the caller graph for this function: