next up previous contents
Next: Property definitions Up: Interface declarations in the Previous: Interface declaration by example

RPC function declaration

RPC function declarations should be enclosed in the body of the interface declaration. A function can use any of the types declared previously in the IDL file. An array argument can use an argument of the same function in its size expressions. Thus, we can have the following,

interface hello {
        void printmsg(char [size=strlen(msg)+1, 1024] msg);
} 0x12345;

A function argument can be of one of the three directions,

in
The argument is only to be sent to the server. This is the default (when no direction is specified for an argument).
out
The argument is used only to receive result from server, it must be a pointer or an array.
inout
The argument is used for both sending and receiving data, it must be a pointer or an array.

The return type of an RPC function can also be of any type. However, you must note that for a functions that return a pointer, powerRPC allocates the memory to which the pointer points, and it is the programmer responsibility to free that memory using the library function pw_free_reference().



Copyright (C) Netbula LLC, 1996