XDR
External Data Representation


XDR is a library of routines which allow a user to transfer data between computers which have different data storage conventions.

XDR uses an "external data representation"; each kind of data (bit, byte, short and long integers, reals, double precision reals, character strings, and so on) has a representation defined in this system.

For each computer system, there are library routines to convert data between the computer's native data representation, and the XDR representation.

To transfer data between computers, then, the user would start on computer A with data represented in the format native to that computer and call the appropriate XDR routines to convert each data item's representation into the portable format. Then the data, in XDR format, can be written to a file, or transmitted in other ways, to computer B. On that computer, the appropriate routines are called to convert the data from the XDR format into the computer's native format.

XDR routines are especially useful for remote procedure calls (RPC). In a remote procedure call, two programs, which may be running on different computers, need to pass data. The first program takes its data, which is in a local data format, and passes it through an XDR routine so that it is in XDR format. Then RPC routines transmit the data. The second program receives the data from an RPC routine, and calls an XDR routine to convert the data from XDR format to its local data format.

Usage:

Compilation:
The user program that calls XDR routines must have the following include statement:
          # include <rpc/xdr.h> 
and might also need:
          # include <rpc/types.h> 

Related Data and Programs:

PLTMG_SINGLE is a FORTRAN77 finite element program which can use the XDR library.

Reference:

  1. John Bloomer,
    Power Programming with RPC,
    O'Reilly, 1992,
    ISBN: 0937175773.
  2. David Gunter,
    Client/Server Programming with RPC and DCE,
    Que, 1995,
    ISBN: 0-7897-0182-0.
  3. ../../txt/xdr.txt, notes on XDR.

Examples and Tests:

List of Routines:

You can go up one level to the C source codes.


Last revised on 22 February 2006.