The names of the C functions used to call SIDL methods are a concatenation of the package name, the class or interface name and the method name(s) with the period characters changed to underscores. If the method is specified as being overloaded (i.e., has a name extension) , the full method name is the concatenation of the short name and the extension. For non-static methods, the object or interface pointer is passed as the first parameter before any of the formal parameters. This parameter operates like an in parameter.
For methods that throw exceptions, there is an extra out argument of type SIDL.BaseException that holds the thrown exception in cases when an exception is thrown. When an exception is thrown, the caller should ignore the value of out parameters and the function's return value.
Here are the C bindings for the critical addRef and deleteRef methods from SIDL.BaseInterface. I mention these methods in particular because C clients must manage object reference counts themselves.
users_guide/c/code/refmethods.h
You can call these same methods from the SIDL.BaseClass bindings. In fact, every C binding for an interface or class will have entries for addRef and deleteRef.
users_guide/c/code/classmethods.h
The following SIDL method taken from the BABEL regression tests demonstrates how exceptions are handled.
users_guide/cxx/code/ExceptionTest_Fib_getFib.sidl
Here is the C binding for this method:
users_guide/c/code/getFib.h
Here is an example of how to perform exception handling in C using a package of macros defined in SIDL_Exception.h.
users_guide/c/code/getFib.c
Examples of calls to SIDL overloaded methods are based on the overload_sample.sidl file shown in Section 3.4.4. Recall that the file describes three versions of the getValue method. The first takes no arguments, the second takes an integer argument, and the third takes a boolean. Each is called in the code snippet below:
users_guide/c/code/overload_sample_test.c