xdr_vector()--Translate between Arrays and Their XDR
Syntax
#include <rpc/xdr.h> bool_t xdr_vector(XDR *xdrs, char *arrp, const u_int size, const u_int elsize, const xdrproc_t elproc);
Service Program Name: QZNFTRPC
Default Public Authority: *USE
Threadsafe: No
The xdr_vector() function is a filter primitive that translates between fixed-length arrays and their corresponding external representations.
Parameters
- xdrs (Input)
- A pointer to the eXternal Data Representation (XDR) stream handle.
- arrp (I/O)
- The pointer to the array.
- size (Input)
- The element count of the array.
- elsize (Input)
- The byte size of each of the array elements.
- elproc (Input)
- Translates between the C form of the array elements and their external representations. This parameter is an XDR filter.
Authorities
No authorization is required.
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_vector() 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> #define MAX_VERTECIES 10 #define MAX_EDGES ((MAX_VERTECIES*(MAX_VERTECIES-1))/2) typedef struct graph { bool_t adjacent[MAX_VERTICIES,MAX_VERTICIES]; } graph ; bool_t xdr_graph(XDR *xdrs, graph *p_graph) { int i; for(i=0;i<MAX_VERTECIES;i++) if(!xdr_vector(xdrs, p_graph->adjacent[i] AX_VERTECIES,sizeof(bool_t),xdr_bool)) return FALSE; return TRUE; }
API introduced: V4R2
[ Back to top | Remote Procedure Call (RPC) APIs | APIs by category ]