Skip to content

Commit

Permalink
renaming idam_plugin_interface instances to plugin_interface. reorder…
Browse files Browse the repository at this point in the history
…ing windows headers where required
  • Loading branch information
stephen-dixon committed Jan 26, 2024
1 parent 0556b96 commit 91529ce
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 96 deletions.
2 changes: 1 addition & 1 deletion source/clientserver/manageSockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# include <strings.h>
# include <unistd.h>
#else
# include <Windows.h>
# include <winsock2.h>
# include <Windows.h>
# define strcasecmp _stricmp
# include <string.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/bytes/bytesPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
#define THISPLUGIN_MAX_INTERFACE_VERSION 1 // Interface versions higher than this will not be understood!
#define THISPLUGIN_DEFAULT_METHOD "help"

LIBRARY_API int bytesPlugin(UDA_PLUGIN_INTERFACE* idam_plugin_interface);
LIBRARY_API int bytesPlugin(UDA_PLUGIN_INTERFACE* plugin_interface);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/help/help_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
#define THISPLUGIN_MAX_INTERFACE_VERSION 1
#define THISPLUGIN_DEFAULT_METHOD "help"

LIBRARY_API int helpPlugin(UDA_PLUGIN_INTERFACE* idam_plugin_interface);
LIBRARY_API int helpPlugin(UDA_PLUGIN_INTERFACE* plugin_interface);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/keyvalue/keyvaluePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
#define THISPLUGIN_MAX_INTERFACE_VERSION 1 // Interface versions higher than this will not be understood!
#define THISPLUGIN_DEFAULT_METHOD "help"

LIBRARY_API int keyValue(UDA_PLUGIN_INTERFACE* idam_plugin_interface);
LIBRARY_API int keyValue(UDA_PLUGIN_INTERFACE* plugin_interface);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/template/templatePlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*---------------------------------------------------------------
* v1 UDA Plugin Template: Standardised plugin design template, just add ...
*
* Input Arguments: UDA_PLUGIN_INTERFACE *idam_plugin_interface
* Input Arguments: UDA_PLUGIN_INTERFACE *plugin_interface
*
* Returns: 0 if the plugin functionality was successful
* otherwise a Error Code is returned
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/template/templatePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
#define THISPLUGIN_MAX_INTERFACE_VERSION 1 // Interface versions higher than this will not be understood!
#define THISPLUGIN_DEFAULT_METHOD "help"

LIBRARY_API int templatePlugin(UDA_PLUGIN_INTERFACE* idam_plugin_interface);
LIBRARY_API int templatePlugin(UDA_PLUGIN_INTERFACE* plugin_interface);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/testplugin/testplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
extern "C" {
#endif

int testPlugin(UDA_PLUGIN_INTERFACE* idam_plugin_interface);
int testPlugin(UDA_PLUGIN_INTERFACE* plugin_interface);

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions source/plugins/testplugin/teststructs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "struct.h"
#include <include/logging.h>

void init_structure_definitions(UDA_PLUGIN_INTERFACE* idam_plugin_interface)
void init_structure_definitions(UDA_PLUGIN_INTERFACE* plugin_interface)
{
USERDEFINEDTYPE* old;

Expand Down Expand Up @@ -104,7 +104,7 @@ void init_structure_definitions(UDA_PLUGIN_INTERFACE* idam_plugin_interface)
field.alignment = udaGetalignmentof(field.type);
udaAddCompoundField(&usertype, field); // Single Structure element

USERDEFINEDTYPELIST* userdefinedtypelist = idam_plugin_interface->userdefinedtypelist;
USERDEFINEDTYPELIST* userdefinedtypelist = plugin_interface->userdefinedtypelist;
udaAddUserDefinedType(userdefinedtypelist, usertype);

UDA_LOG(UDA_LOG_DEBUG, "Type TEST9 defined\n");
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/testplugin/teststructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ typedef struct Test9A {
TEST9 v6; // Sub Structure with String types
} TEST9A;

void init_structure_definitions(UDA_PLUGIN_INTERFACE* idam_plugin_interface);
void init_structure_definitions(UDA_PLUGIN_INTERFACE* plugin_interface);

#endif // UDA_PLUGIN_TESTPLUGIN_TESTSTRUCTS_H
2 changes: 1 addition & 1 deletion source/plugins/uda/uda_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
#define THISPLUGIN_MAX_INTERFACE_VERSION 1 // Interface versions higher than this will not be understood!
#define THISPLUGIN_DEFAULT_METHOD "help"

int UDAPlugin(UDA_PLUGIN_INTERFACE* idam_plugin_interface);
int UDAPlugin(UDA_PLUGIN_INTERFACE* plugin_interface);

#ifdef __cplusplus
}
Expand Down
8 changes: 4 additions & 4 deletions source/plugins/udaPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,9 @@ bool findValue(const NAMEVALUELIST* namevaluelist, const char* name)

int callPlugin(const PLUGINLIST* pluginlist, const char* signal, const UDA_PLUGIN_INTERFACE* old_plugin_interface)
{
UDA_PLUGIN_INTERFACE idam_plugin_interface = *old_plugin_interface;
UDA_PLUGIN_INTERFACE plugin_interface = *old_plugin_interface;
REQUEST_DATA request = *old_plugin_interface->request_data;
idam_plugin_interface.request_data = &request;
plugin_interface.request_data = &request;

request.source[0] = '\0';
strcpy(request.signal, signal);
Expand All @@ -636,7 +636,7 @@ int callPlugin(const PLUGINLIST* pluginlist, const char* signal, const UDA_PLUGI
int id = findPluginIdByRequest(request.request, pluginlist);
PLUGIN_DATA* plugin = &(pluginlist->plugin[id]);
if (id >= 0 && plugin->idamPlugin != nullptr) {
err = plugin->idamPlugin(&idam_plugin_interface); // Call the data reader
err = plugin->idamPlugin(&plugin_interface); // Call the data reader
} else {
RAISE_PLUGIN_ERROR("Data Access is not available for this data request!");
}
Expand All @@ -647,7 +647,7 @@ int callPlugin(const PLUGINLIST* pluginlist, const char* signal, const UDA_PLUGI
initAction(&action);
action.actionType = UDA_SUBSET_TYPE;
action.subset = request.datasubset;
err = serverSubsetData(idam_plugin_interface.data_block, action, idam_plugin_interface.logmalloclist);
err = serverSubsetData(plugin_interface.data_block, action, plugin_interface.logmalloclist);
}

return err;
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/viewport/viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern "C" {
#define MAXSIGNALNAME 256
#define FREEHANDLEBLOCK 4

int viewport(UDA_PLUGIN_INTERFACE* idam_plugin_interface);
int viewport(UDA_PLUGIN_INTERFACE* plugin_interface);

#ifdef __cplusplus
}
Expand Down
48 changes: 24 additions & 24 deletions source/server/serverGetData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,32 +1112,32 @@ int read_data(REQUEST_DATA* request, CLIENT_BLOCK client_block, DATA_BLOCK* data
// Test for known File formats and Server protocols

{
UDA_PLUGIN_INTERFACE idam_plugin_interface;
UDA_PLUGIN_INTERFACE plugin_interface;

UDA_LOG(UDA_LOG_DEBUG, "creating the plugin interface structure\n");

// Initialise the Data Block

udaInitDataBlock(data_block);

idam_plugin_interface.interfaceVersion = 1;
idam_plugin_interface.pluginVersion = 0;
idam_plugin_interface.sqlConnectionType = 0;
idam_plugin_interface.data_block = data_block;
idam_plugin_interface.client_block = &client_block;
idam_plugin_interface.request_data = request;
idam_plugin_interface.data_source = data_source;
idam_plugin_interface.signal_desc = signal_desc;
idam_plugin_interface.environment = environment;
idam_plugin_interface.sqlConnection = nullptr;
idam_plugin_interface.verbose = 0;
idam_plugin_interface.housekeeping = 0;
idam_plugin_interface.changePlugin = 0;
idam_plugin_interface.pluginList = pluginlist;
idam_plugin_interface.userdefinedtypelist = userdefinedtypelist;
idam_plugin_interface.logmalloclist = logmalloclist;
idam_plugin_interface.error_stack.nerrors = 0;
idam_plugin_interface.error_stack.idamerror = nullptr;
plugin_interface.interfaceVersion = 1;
plugin_interface.pluginVersion = 0;
plugin_interface.sqlConnectionType = 0;
plugin_interface.data_block = data_block;
plugin_interface.client_block = &client_block;
plugin_interface.request_data = request;
plugin_interface.data_source = data_source;
plugin_interface.signal_desc = signal_desc;
plugin_interface.environment = environment;
plugin_interface.sqlConnection = nullptr;
plugin_interface.verbose = 0;
plugin_interface.housekeeping = 0;
plugin_interface.changePlugin = 0;
plugin_interface.pluginList = pluginlist;
plugin_interface.userdefinedtypelist = userdefinedtypelist;
plugin_interface.logmalloclist = logmalloclist;
plugin_interface.error_stack.nerrors = 0;
plugin_interface.error_stack.idamerror = nullptr;

int plugin_id;

Expand Down Expand Up @@ -1180,12 +1180,12 @@ int read_data(REQUEST_DATA* request, CLIENT_BLOCK client_block, DATA_BLOCK* data
#endif

// Call the plugin
int err = pluginlist->plugin[id].idamPlugin(&idam_plugin_interface);
for (unsigned int i = 0; i < idam_plugin_interface.error_stack.nerrors; ++i) {
auto error = &idam_plugin_interface.error_stack.idamerror[i];
int err = pluginlist->plugin[id].idamPlugin(&plugin_interface);
for (unsigned int i = 0; i < plugin_interface.error_stack.nerrors; ++i) {
auto error = &plugin_interface.error_stack.idamerror[i];
udaAddError(error->type, error->location, error->code, error->msg);
}
udaFreeErrorStack(&idam_plugin_interface.error_stack);
udaFreeErrorStack(&plugin_interface.error_stack);

#ifndef FATCLIENT
// Reset Redirected Output
Expand Down Expand Up @@ -1216,7 +1216,7 @@ int read_data(REQUEST_DATA* request, CLIENT_BLOCK client_block, DATA_BLOCK* data
}
}

if (!idam_plugin_interface.changePlugin) {
if (!plugin_interface.changePlugin) {
// job done!

data_block->source_status = data_source->status;
Expand Down
78 changes: 39 additions & 39 deletions source/server/serverPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ void allocPluginList(int count, PLUGINLIST* plugin_list)
void resetPlugins(const PLUGINLIST* plugin_list)
{
REQUEST_DATA request_block;
UDA_PLUGIN_INTERFACE idam_plugin_interface;
UDA_PLUGIN_INTERFACE plugin_interface;
udaInitRequestData(&request_block);
strcpy(request_block.function, "reset");

idam_plugin_interface.interfaceVersion = 1;
idam_plugin_interface.housekeeping = 1; // Force a full reset
idam_plugin_interface.request_data = &request_block;
plugin_interface.interfaceVersion = 1;
plugin_interface.housekeeping = 1; // Force a full reset
plugin_interface.request_data = &request_block;
for (int i = 0; i < plugin_list->count; i++) {
if (plugin_list->plugin[i].pluginHandle != nullptr) {
plugin_list->plugin[i].idamPlugin(&idam_plugin_interface); // Call the housekeeping method
plugin_list->plugin[i].idamPlugin(&plugin_interface); // Call the housekeeping method
}
}
}
Expand Down Expand Up @@ -407,7 +407,7 @@ int udaProvenancePlugin(CLIENT_BLOCK* client_block, REQUEST_DATA* original_reque

int err, rc, reset;
DATA_BLOCK data_block;
UDA_PLUGIN_INTERFACE idam_plugin_interface;
UDA_PLUGIN_INTERFACE plugin_interface;

// Initialise the Data Block

Expand All @@ -427,21 +427,21 @@ int udaProvenancePlugin(CLIENT_BLOCK* client_block, REQUEST_DATA* original_reque
LOGMALLOCLIST logmalloclist;
udaInitLogMallocList(&logmalloclist);

idam_plugin_interface.interfaceVersion = 1;
idam_plugin_interface.pluginVersion = 0;
idam_plugin_interface.data_block = &data_block;
idam_plugin_interface.client_block = client_block;
idam_plugin_interface.request_data = &request;
idam_plugin_interface.data_source = data_source;
idam_plugin_interface.signal_desc = signal_desc;
idam_plugin_interface.environment = environment;
idam_plugin_interface.housekeeping = 0;
idam_plugin_interface.changePlugin = 0;
idam_plugin_interface.pluginList = plugin_list;
idam_plugin_interface.userdefinedtypelist = &userdefinedtypelist;
idam_plugin_interface.logmalloclist = &logmalloclist;
idam_plugin_interface.error_stack.nerrors = 0;
idam_plugin_interface.error_stack.idamerror = nullptr;
plugin_interface.interfaceVersion = 1;
plugin_interface.pluginVersion = 0;
plugin_interface.data_block = &data_block;
plugin_interface.client_block = client_block;
plugin_interface.request_data = &request;
plugin_interface.data_source = data_source;
plugin_interface.signal_desc = signal_desc;
plugin_interface.environment = environment;
plugin_interface.housekeeping = 0;
plugin_interface.changePlugin = 0;
plugin_interface.pluginList = plugin_list;
plugin_interface.userdefinedtypelist = &userdefinedtypelist;
plugin_interface.logmalloclist = &logmalloclist;
plugin_interface.error_stack.nerrors = 0;
plugin_interface.error_stack.idamerror = nullptr;

// Redirect Output to temporary file if no file handles passed

Expand All @@ -454,7 +454,7 @@ int udaProvenancePlugin(CLIENT_BLOCK* client_block, REQUEST_DATA* original_reque

UDA_LOG(UDA_LOG_DEBUG, "entering the provenance plugin\n");

err = plugin_list->plugin[plugin_id].idamPlugin(&idam_plugin_interface);
err = plugin_list->plugin[plugin_id].idamPlugin(&plugin_interface);

UDA_LOG(UDA_LOG_DEBUG, "returned from the provenance plugin\n");

Expand Down Expand Up @@ -561,7 +561,7 @@ int udaServerMetaDataPlugin(const PLUGINLIST* plugin_list, int plugin_id, REQUES
const ENVIRONMENT* environment)
{
int err, reset, rc;
UDA_PLUGIN_INTERFACE idam_plugin_interface;
UDA_PLUGIN_INTERFACE plugin_interface;

// Check the Interface Compliance

Expand All @@ -579,21 +579,21 @@ int udaServerMetaDataPlugin(const PLUGINLIST* plugin_list, int plugin_id, REQUES
LOGMALLOCLIST logmalloclist;
udaInitLogMallocList(&logmalloclist);

idam_plugin_interface.interfaceVersion = 1;
idam_plugin_interface.pluginVersion = 0;
idam_plugin_interface.data_block = &data_block;
idam_plugin_interface.client_block = nullptr;
idam_plugin_interface.request_data = request_block;
idam_plugin_interface.data_source = data_source;
idam_plugin_interface.signal_desc = signal_desc;
idam_plugin_interface.environment = environment;
idam_plugin_interface.housekeeping = 0;
idam_plugin_interface.changePlugin = 0;
idam_plugin_interface.pluginList = plugin_list;
idam_plugin_interface.userdefinedtypelist = &userdefinedtypelist;
idam_plugin_interface.logmalloclist = &logmalloclist;
idam_plugin_interface.error_stack.nerrors = 0;
idam_plugin_interface.error_stack.idamerror = nullptr;
plugin_interface.interfaceVersion = 1;
plugin_interface.pluginVersion = 0;
plugin_interface.data_block = &data_block;
plugin_interface.client_block = nullptr;
plugin_interface.request_data = request_block;
plugin_interface.data_source = data_source;
plugin_interface.signal_desc = signal_desc;
plugin_interface.environment = environment;
plugin_interface.housekeeping = 0;
plugin_interface.changePlugin = 0;
plugin_interface.pluginList = plugin_list;
plugin_interface.userdefinedtypelist = &userdefinedtypelist;
plugin_interface.logmalloclist = &logmalloclist;
plugin_interface.error_stack.nerrors = 0;
plugin_interface.error_stack.idamerror = nullptr;

// Redirect Output to temporary file if no file handles passed

Expand All @@ -604,7 +604,7 @@ int udaServerMetaDataPlugin(const PLUGINLIST* plugin_list, int plugin_id, REQUES

// Call the plugin (Error handling is managed within)

err = plugin_list->plugin[plugin_id].idamPlugin(&idam_plugin_interface);
err = plugin_list->plugin[plugin_id].idamPlugin(&plugin_interface);

// Reset Redirected Output

Expand Down
Loading

0 comments on commit 91529ce

Please sign in to comment.