The RPC language (RPCL) is similar to C. This section describes the syntax of the RPC language, showing a few examples along the way. It also shows how RPC and XDR type definitions get compiled into C type definitions in the output header file.
An RPC language file consists of a series of definitions.
definition-list: definition; definition; definition-list
It recognizes six types of definitions.
definition: enum-definition const-definition typedef-definition struct-definition union-definition program-definition
Definitions are not the same as declarations. No space is allocated by a definition - only the type definition of a single or series of data elements. This means that variables still must be declared.
The RPC language is identical to the XDR language, except for the added definitions described in Table B-2.
Table B-2 RPC Language Definitions
Term |
Definition |
---|---|
program program-ident {version-list} = value |
|
version; version; version-list |
|
version version-ident {procedure-list} = value |
|
procedure; procedure; procedure-list |
|
type-ident procedure-ident (type-ident) = value |
The following keywords are added and cannot be used as identifiers: program version.
Neither version name nor a version number can occur more than once within the scope of a program definition.
Neither a procedure name nor a procedure number can occur more than once within the scope of a version definition.
Program identifiers are in the same name space as constant and type identifiers.
Only unsigned constants can be assigned to programs, versions, and procedures.