The RPC language (RPCL) is similar to C. This section describes the syntax of the RPC language, and includes examples. It also shows how RPC and XDR type definitions are 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
The file 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 behavior means that variables still must be declared.
The RPC language is identical to the XDR language, except for the added definitions described in the following table.
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 |
In the RPC language:
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 namespace as constant and type identifiers.
Only unsigned constants can be assigned to programs, versions, and procedures.