xdr_bool()--Translate between Booleans and Their XDR


  Syntax
 #include <rpc/xdr.h>

 bool_t xdr_bool(XDR *xdrs,
                 bool_t *bp);

  Service Program Name: QZNFTRPC

  Default Public Authority: *USE

  Threadsafe: No

The xdr_bool() function is a filter primitive that translates between Booleans (C integers) and their external representations. When encoding data, this filter produces values of either 1 or 0.


Parameters

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

bp  (I/O) 
The address of the Boolean data.

Authorities

No authorization is required.


Notes

Callers of the xdr_bool() function should ensure that bp points to a 4 byte location in memory. The ENUM(*INT) compiler option should be used when compiling code that calls xdr_bool() to ensure that enumerated data types are represented internally as integers. Failure to do so, may cause unexpected values to be encoded to the XDR data stream.


Return Value

TRUE (1) Successful
FALSE (0) Unsuccessful


Error Conditions

None.


Error Messages

Message ID Error Message Text
CPE3418 E Possible APAR condition or hardware failure.
CPF3CF2 E Error(s) occurred during running of &1 API.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


Example

The following example shows how xdr_bool() is used.

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

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

typedef struct node
{
        bool_t connected;
        bool_t visited;
} node ;

bool xdr_node(XDR *xdrs, node *p_node)
{
        if(!xdr_bool(xdrs,&(p_node->connected)))
                return FALSE;
        return xdr_bool(xdrs,&(p_node->visited));
}


API introduced: V4R2

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