Library-Wide Initialization and Shutdown

This section describes how to write functions to perform library intitalization and shutdown.

One library (.dll or .so file) for Sybase CEP Server may contain more than one UDF, more than one in-process adapter, or more than one server plugin. In some cases, you may want to have initialize() and shutdown() functions that apply to the entire library in addition to those that apply for a particular in-process adapter or plugin. These functions are called once when that the library is loaded or unloaded by Sybase CEP Server.

To implement this, write two functions with the following signatures:

These functions are purely optional. In your library, you can include either function, both functions, or neither function.

The function prototypes and the C8LibraryResult enumerations which defines the return codes such as C8_LIBRARY_INIT_ERROR are in the c8server.h file. This file is located in the "include" subdirectory of the Sybase CEP C/C++ SDK directory. If you installed to the default directory on Microsoft Windows, this will be:

C:\Program Files\SybaseC8\Server\sdk\c\include

If you installed to the default directory on a UNIX-like operating system, this will be:

/home/user/sybasec8/server/sdk/c/include