Back to index

glibc  2.9
Defines | Functions
xdr_intXX_t.c File Reference
#include <rpc/types.h>
#include <rpc/xdr.h>

Go to the source code of this file.

Defines

#define xdr_quad_t   Xdr_quad_t
#define xdr_u_quad_t   Xdr_u_quad_t

Functions

bool_t xdr_int64_t (XDR *xdrs, int64_t *ip)
 strong_alias (xdr_int64_t, xdr_quad_t)
 strong_alias (xdr_int64_t, xdr_u_quad_t)
bool_t xdr_uint32_t (XDR *xdrs, uint32_t *ulp)
bool_t xdr_int16_t (XDR *xdrs, int16_t *ip)
bool_t xdr_uint16_t (XDR *xdrs, uint16_t *uip)
bool_t xdr_int8_t (XDR *xdrs, int8_t *ip)
bool_t xdr_uint8_t (XDR *xdrs, uint8_t *uip)

Define Documentation

#define xdr_quad_t   Xdr_quad_t

Definition at line 23 of file xdr_intXX_t.c.

#define xdr_u_quad_t   Xdr_u_quad_t

Definition at line 24 of file xdr_intXX_t.c.


Function Documentation

Definition at line 54 of file xdr_intXX_t.c.

{
  uint32_t t1;
  uint32_t t2;

  switch (xdrs->x_op)
    {
    case XDR_ENCODE:
      t1 = (uint32_t) ((*uip) >> 32);
      t2 = (uint32_t) (*uip);
      return (XDR_PUTINT32 (xdrs, (int32_t *) &t1) &&
             XDR_PUTINT32(xdrs, (int32_t *) &t2));
    case XDR_DECODE:
      if (!XDR_GETINT32(xdrs, (int32_t *) &t1) ||
         !XDR_GETINT32(xdrs, (int32_t *) &t2))
        return FALSE;
      *uip = ((uint64_t) t1) << 32;
      *uip |= t2;
      return TRUE;
    case XDR_FREE:
      return TRUE;
    default:
      return FALSE;
    }
}

Definition at line 83 of file xdr_intXX_t.c.

{
  switch (xdrs->x_op)
    {
    case XDR_ENCODE:
      return XDR_PUTINT32 (xdrs, lp);
    case XDR_DECODE:
      return XDR_GETINT32 (xdrs, lp);
    case XDR_FREE:
      return TRUE;
    default:
      return FALSE;
    }
}
bool_t xdr_int16_t ( XDR xdrs,
int16_t ip 
)

Definition at line 121 of file xdr_intXX_t.c.

{
  int32_t t;

  switch (xdrs->x_op)
    {
    case XDR_ENCODE:
      t = (int32_t) *ip;
      return XDR_PUTINT32 (xdrs, &t);
    case XDR_DECODE:
      if (!XDR_GETINT32 (xdrs, &t))
       return FALSE;
      *ip = (int16_t) t;
      return TRUE;
    case XDR_FREE:
      return TRUE;
    default:
      return FALSE;
    }
}
bool_t xdr_int64_t ( XDR xdrs,
int64_t ip 
)

Definition at line 32 of file xdr_intXX_t.c.

{
  int32_t t1, t2;

  switch (xdrs->x_op)
    {
    case XDR_ENCODE:
      t1 = (int32_t) ((*ip) >> 32);
      t2 = (int32_t) (*ip);
      return (XDR_PUTINT32(xdrs, &t1) && XDR_PUTINT32(xdrs, &t2));
    case XDR_DECODE:
      if (!XDR_GETINT32(xdrs, &t1) || !XDR_GETINT32(xdrs, &t2))
        return FALSE;
      *ip = ((int64_t) t1) << 32;
      *ip |= (uint32_t) t2; /* Avoid sign extension.  */
      return TRUE;
    case XDR_FREE:
      return TRUE;
    default:
      return FALSE;
    }
}
bool_t xdr_int8_t ( XDR xdrs,
int8_t ip 
)

Definition at line 167 of file xdr_intXX_t.c.

{
  int32_t t;

  switch (xdrs->x_op)
    {
    case XDR_ENCODE:
      t = (int32_t) *ip;
      return XDR_PUTINT32 (xdrs, &t);
    case XDR_DECODE:
      if (!XDR_GETINT32 (xdrs, &t))
       return FALSE;
      *ip = (int8_t) t;
      return TRUE;
    case XDR_FREE:
      return TRUE;
    default:
      return FALSE;
    }
}
bool_t xdr_uint16_t ( XDR xdrs,
uint16_t uip 
)

Definition at line 144 of file xdr_intXX_t.c.

{
  uint32_t ut;

  switch (xdrs->x_op)
    {
    case XDR_ENCODE:
      ut = (uint32_t) *uip;
      return XDR_PUTINT32 (xdrs, (int32_t *) &ut);
    case XDR_DECODE:
      if (!XDR_GETINT32 (xdrs, (int32_t *) &ut))
       return FALSE;
      *uip = (uint16_t) ut;
      return TRUE;
    case XDR_FREE:
      return TRUE;
    default:
      return FALSE;
    }
}
bool_t xdr_uint32_t ( XDR xdrs,
uint32_t ulp 
)

Definition at line 104 of file xdr_intXX_t.c.

{
  switch (xdrs->x_op)
    {
    case XDR_ENCODE:
      return XDR_PUTINT32 (xdrs, (int32_t *) ulp);
    case XDR_DECODE:
      return XDR_GETINT32 (xdrs, (int32_t *) ulp);
    case XDR_FREE:
      return TRUE;
    default:
      return FALSE;
    }
}

Here is the caller graph for this function:

bool_t xdr_uint8_t ( XDR xdrs,
uint8_t uip 
)

Definition at line 190 of file xdr_intXX_t.c.

{
  uint32_t ut;

  switch (xdrs->x_op)
    {
    case XDR_ENCODE:
      ut = (uint32_t) *uip;
      return XDR_PUTINT32 (xdrs, (int32_t *) &ut);
    case XDR_DECODE:
      if (!XDR_GETINT32 (xdrs, (int32_t *) &ut))
       return FALSE;
      *uip = (uint8_t) ut;
      return TRUE;
    case XDR_FREE:
      return TRUE;
    default:
      return FALSE;
    }
}