DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Programming with Remote Procedure Calls (RPC)

Special cases

There are a few exceptions to the rules described above.

Booleans

C has no built-in boolean type. However, the RPC library uses a boolean type called bool_t that is either TRUE or FALSE. Things declared as type bool in RPC/XDR language are compiled into bool_t in the output header file.

For example:

   bool married;
is converted to:
   bool_t married;

Strings

C has no built-in string type, but instead uses the null-terminated char * convention. In RPC/XDR language, strings are declared using the string keyword, and compiled into type char * in the output header file. The maximum size contained in the angle brackets specifies the maximum number of characters allowed in the strings (not counting the NULL character). The maximum size may be left off, indicating a string of arbitrary length.

For example:

   string name<32>;
   string longname<>;
are converted to:
   char *name;	
   char *longname;

Opaque data

describes untyped data, that is, just sequences of arbitrary bytes. It may be declared either as a fixed or variable length array.

For example:

   opaque diskblock[512];
   

opaque filedata<1024>;

are converted as:
   char diskblock[512];
   

struct { u_int filedata_len; char *filedata_val; } filedata;

Voids

In a void declaration, the variable is not named. The declaration is just void and nothing else. Void declarations can only occur in two places: union definitions and program definitions (as the argument or result of a remote procedure).


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004