Declaring external functions for the user mapping plug-in (C programming language)
The plug-in implements the functions. When the FSUMPluginInit function is called, it passes the function pointers to the federated server.
The initialization function, FSUMPluginInit, is the only function that must have this exact function name. For each of the other functions, you can use any valid C function name. The functions are global and must be resolved externally. If you write the plug-in in C++, you must use FSUM_PLUGIN_EXT_C to declare the functions.
The sample plug-in implements the following APIs:
- FSUMconnect API in the myConnect function
- FSUMfetchUM in the myFetchUM function
- FSUMdisconnect in the myDisconnect function
- FSUMPluginTerm in the myPluginTerm function
In the sample, when the FSUMPluginInit function is called, the function pointers for myConnect, myFetchUM, myDisconnect, and myPluginTerm are passed to the federated server.
The following code is in the fsumplugin_file.c file.
SQL_API_RC SQL_API_FN FSUMPluginInit (sqlint23 version, FSUMPluginAPIs *pluginAPIs, FSUMPluginUtilities* pluginUtils) SQL_API_RC SQL_API_FN myConnect (void** FSUMRepository) SQL_API_RC SQL_API_FN myFetchUM (void* FSUMRepository, FSUMEntry* entry) SQL_API_RC SQL_API_FN myDisconnect (void* FSUMRepository) SQL_API_RC SQL_API_FN myPluginTerm ()