xdr_u_short()--Translate between an Unsigned Short and Its XDR


  Syntax
 #include <rpc/xdr.h>

 bool_t xdr_u_short(XDR *xdrs,
                    u_short *usp);

  Service Program Name: QZNFTRPC

  Default Public Authority: *USE

  Threadsafe: No

The xdr_u_short() function is a filter primitive that translates between C-language unsigned short integers and their external representations.


Parameters

xdrs  (Input) 
A pointer to the External Data Representation (XDR) stream handle.

usp  (I/O) 
The address of the unsigned short integer.

Authorities

No authorization is required.


Return Value



Error Conditions

None.


Error Messages



Example

The following example shows how xdr_u_short() is used.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#include <stdio.h>
#include <xdr.h>

typedef struct vector
{
        u_short x,y,z;
} vector ;

bool_t xdr_vector(XDR *xdrs, vector *p_vector)
{
        if(!xdr_u_short(xdrs,&(p_vector->x)))
                return FALSE;
        if(!xdr_u_short(xdrs,&(p_vector->y)))
                return FALSE;
        return xdr_u_short(xdrs,&(p_vector->z));
}


API introduced: V4R2

[ Back to top | Remote Procedure Call (RPC) APIs | APIs by category ]