xdr_u_char()--Translate between Unsigned Characters and Their XDR


  Syntax
 #include <rpc/xdr.h>

 bool_t xdr_u_char(XDR *xdrs,
                   char *ucp);

  Service Program Name: QZNFTRPC

  Default Public Authority: *USE

  Threadsafe: No

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


Parameters

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

ucp  (I/O) 
A pointer to an unsigned character.

Authorities

No authorization is required.


Return Value



Error Conditions

None.


Error Messages



Example

The following example shows how xdr_u_char() 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 grades
{
        u_char  math; /* Each grade is 'A'..'D' */
        u_char  literature;
         u_char  geography;
        u_char  computers;
} grades ;


bool_t xdr_grades(XDR *xdrs, grades *p_grades)
{
        if(!xdr_u_char(xdrs,&(p_grades->math)))
                return FALSE;
        if(!xdr_u_char(xdrs,&(p_grades->literature)))
                return FALSE;
        if(!xdr_u_char(xdrs,&(p_grades->geography)))
                return FALSE;
        return xdr_u_char(xdrs,&(p_grades->computers));
}


API introduced: V4R2

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