#include <rpc/xdr.h>
bool_t xdr_bool(XDR *xdrs,
bool_t *bp);
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.
No authorization is required.
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.
| TRUE (1) | Successful |
| FALSE (0) | Unsuccessful |
None.
| 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. |
See Code disclaimer information for information pertaining to code examples.
The following example shows how xdr_bool() is used:
#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));
}
| Top | Remote Procedure Call (RPC) APIs | APIs by category |