|
|
An RPC/XDR struct is declared almost exactly like its C counterpart:
struct-definition:
struct struct-ident {
declaration-list
}
declaration-list:
declaration ;
declaration ; declaration-list
As an example, this is an RPC/XDR structure
for a two-dimensional
coordinate, and the C structure that it gets compiled into in the
output header file.
struct coord {
int x;
int y;
};
The output is identical to the input, except for the added
typedef at the end of the output:
struct coord {
int x;
int y;
};
typedef struct coord coord;
This allows one to use coord instead of
struct coord when declaring items.