From 165b6f839305d6cbc5eea40af46b30427cc49038 Mon Sep 17 00:00:00 2001 From: Jonathan Hollocombe Date: Tue, 30 Jan 2024 11:42:04 +0000 Subject: [PATCH] Rationalising the API --- .clang-tidy | 3 +- source/CMakeLists.txt | 25 +- source/authentication/udaClientSSL.cpp | 8 +- source/authentication/udaClientSSL.h | 6 +- source/authentication/udaServerSSL.cpp | 6 +- source/authentication/udaServerSSL.h | 22 +- source/bin/uda_cli.cpp | 2 +- source/c_api/accAPI.cpp | 17 +- source/c_api/clientAPI.cpp | 3 +- source/c_api/clientMDS.cpp | 5 +- source/c_api/udaGetAPI.cpp | 5 +- source/c_api/udaPutAPI.cpp | 2 +- source/cache/cache.cpp | 4 +- source/cache/cache.h | 15 +- source/cache/fileCache.cpp | 4 +- source/cache/fileCache.h | 15 +- source/cache/memcache.cpp | 10 +- source/cache/memcache.hpp | 4 +- source/client/clientXDRStream.cpp | 4 +- source/client/clientXDRStream.h | 2 - source/client/closedown.cpp | 9 +- source/client/closedown.h | 13 +- source/client/connection.cpp | 10 +- source/client/connection.h | 11 +- source/client/generateErrors.cpp | 8 +- source/client/generateErrors.h | 22 +- source/client/getEnvironment.cpp | 6 +- source/client/getEnvironment.h | 23 +- source/client/makeClientRequestBlock.cpp | 12 +- source/client/makeClientRequestBlock.h | 13 +- source/client/startup.cpp | 6 +- source/client/startup.h | 11 +- source/client/udaClient.cpp | 37 +- source/client/udaClient.h | 3 +- source/client/udaClientHostList.cpp | 6 +- source/client/udaClientHostList.h | 3 +- source/client/updateSelectParms.h | 1 - source/client2/client.cpp | 26 +- source/client2/client.hpp | 3 +- source/client2/client_environment.cpp | 2 +- source/client2/client_xdr_stream.cpp | 4 +- source/client2/client_xdr_stream.hpp | 2 +- source/client2/closedown.cpp | 2 +- source/client2/closedown.hpp | 4 +- source/client2/connection.cpp | 8 +- source/client2/connection.hpp | 4 +- source/client2/error_codes.h | 13 - source/client2/generate_errors.cpp | 7 +- source/client2/generate_errors.hpp | 2 +- source/client2/handle.cpp | 3 +- source/client2/host_list.cpp | 6 +- source/client2/host_list.hpp | 4 +- source/client2/make_request_block.cpp | 8 +- source/client2/make_request_block.hpp | 2 +- source/client2/thread_client.cpp | 3 +- source/client2/updateSelectParms.h | 1 - source/clientserver/allocData.cpp | 4 +- source/clientserver/allocData.h | 19 +- source/clientserver/allocXMLData.h | 21 +- source/clientserver/compressDim.cpp | 2 +- source/clientserver/compressDim.h | 13 +- source/clientserver/errorLog.cpp | 6 +- source/clientserver/expand_path.cpp | 4 +- source/clientserver/expand_path.h | 23 +- source/clientserver/initStructs.cpp | 2 +- source/clientserver/initStructs.h | 40 +- source/clientserver/initXMLStructs.h | 57 ++- source/clientserver/makeRequestBlock.cpp | 3 +- source/clientserver/manageSockets.h | 21 +- source/clientserver/memstream.h | 11 +- source/clientserver/mkstemp.h | 12 +- source/clientserver/nameValueSubstitution.cpp | 8 +- source/clientserver/nameValueSubstitution.h | 3 +- source/clientserver/parseOperation.h | 11 +- source/clientserver/parseXML.cpp | 10 +- source/clientserver/parseXML.h | 27 +- source/clientserver/printStructs.cpp | 6 +- source/clientserver/printStructs.h | 31 +- source/clientserver/protocol.cpp | 6 +- source/clientserver/protocol.h | 4 +- source/clientserver/protocol2.cpp | 4 +- source/clientserver/protocolXML.cpp | 5 +- source/clientserver/protocolXML.h | 3 +- source/clientserver/protocolXML2.cpp | 12 +- source/clientserver/protocolXML2.h | 17 +- source/clientserver/protocolXML2Put.cpp | 7 +- source/clientserver/protocolXML2Put.h | 21 +- source/clientserver/readXDRFile.cpp | 4 +- source/clientserver/readXDRFile.h | 1 - source/clientserver/socketStructs.h | 1 - source/clientserver/stringUtils.h | 64 ++- source/clientserver/udaDefines.cpp | 32 -- source/{include => clientserver}/udaDefines.h | 19 - source/{include => clientserver}/udaErrors.h | 0 source/clientserver/udaStructs.cpp | 4 +- source/clientserver/udaStructs.h | 10 - source/clientserver/udaTypes.cpp | 2 +- source/clientserver/xdrHData.h | 44 +- source/clientserver/xdrlib.cpp | 7 +- source/clientserver/xdrlib.h | 1 - source/clientserver/xmlStructs.h | 10 - source/include/accAPI.h | 225 ---------- source/include/accessors.h | 254 ------------ source/include/client.h | 100 ----- source/include/clientAPI.h | 20 - source/include/clientMDS.h | 16 - source/include/export.h | 14 - source/include/uda.h | 20 + source/include/uda/client.h | 317 ++++++++++++++ source/include/uda/export.h | 14 + source/include/{ => uda}/legacy.h | 2 +- source/include/{udaPlugin.h => uda/plugins.h} | 34 +- source/include/uda/portability.h | 30 ++ source/include/{struct.h => uda/structured.h} | 387 ++++++++++++------ source/include/uda/types.h | 118 ++++++ source/include/{ => uda}/uda_plugin_base.hpp | 10 +- source/include/udaGetAPI.h | 27 -- source/include/udaPutAPI.h | 25 -- source/include/udaTypes.h | 64 --- source/logging/accessLog.cpp | 4 +- source/logging/accessLog.h | 9 +- source/logging/logging.h | 13 +- source/plugins/bytes/bytesPlugin.cpp | 8 +- source/plugins/bytes/bytesPlugin.h | 5 +- source/plugins/bytes/md5Sum.h | 4 +- .../plugins/bytes/readBytesNonOptimally.cpp | 75 ++-- source/plugins/bytes/readBytesNonOptimally.h | 2 +- source/plugins/hdf5/hdf5plugin.cpp | 2 +- source/plugins/hdf5/hdf5plugin.h | 8 +- source/plugins/hdf5/readHDF58.cpp | 8 +- source/plugins/hdf5/readHDF58.h | 9 +- source/plugins/help/help_plugin.cpp | 5 +- source/plugins/help/help_plugin.h | 5 +- source/plugins/keyvalue/keyvaluePlugin.cpp | 7 +- source/plugins/keyvalue/keyvaluePlugin.h | 5 +- source/plugins/managePluginFiles.cpp | 4 +- source/plugins/managePluginFiles.h | 27 +- source/plugins/pluginStructs.h | 21 - source/plugins/template/templatePlugin.cpp | 4 +- source/plugins/template/templatePlugin.h | 5 +- source/plugins/testplugin/testplugin.cpp | 10 +- source/plugins/testplugin/testplugin.h | 3 +- source/plugins/testplugin/teststructs.cpp | 3 +- source/plugins/uda/uda_plugin.cpp | 12 +- source/plugins/uda/uda_plugin.h | 3 +- source/plugins/udaPlugin.cpp | 15 +- source/plugins/udaPluginFiles.h | 3 +- source/plugins/uda_plugin_base.cpp | 3 +- source/plugins/viewport/viewport.cpp | 7 +- source/plugins/viewport/viewport.h | 3 +- source/security/authenticationUtils.cpp | 2 +- source/security/authenticationUtils.h | 13 +- source/security/clientAuthentication.cpp | 12 +- source/security/clientAuthentication.h | 13 +- source/security/security.cpp | 6 +- source/security/security.h | 11 +- source/security/serverAuthentication.cpp | 14 +- source/security/serverAuthentication.h | 13 +- source/security/x509Utils.cpp | 4 +- source/security/x509Utils.h | 26 +- source/serialisation/capnp_serialisation.cpp | 2 +- source/server/applyXML.cpp | 6 +- source/server/applyXML.h | 3 +- source/server/closeServerSockets.cpp | 4 +- source/server/closeServerSockets.h | 3 +- source/server/createXDRStream.cpp | 2 +- source/server/createXDRStream.h | 2 - source/server/fatServer.cpp | 21 +- source/server/getPluginAddress.cpp | 2 +- source/server/getServerEnvironment.cpp | 2 +- source/server/getServerEnvironment.h | 1 - source/server/initPluginList.cpp | 11 +- source/server/makeServerRequestBlock.cpp | 2 +- source/server/serverGetData.cpp | 12 +- source/server/serverGetData.h | 6 +- source/server/serverLegacyPlugin.cpp | 8 +- source/server/serverLegacyPlugin.h | 1 - source/server/serverPlugin.cpp | 17 +- source/server/serverPlugin.h | 5 +- source/server/serverProcessing.cpp | 4 +- source/server/serverProcessing.h | 1 - source/server/serverStartup.cpp | 4 +- source/server/serverStartup.h | 2 - source/server/serverSubsetData.cpp | 15 +- source/server/serverSubsetData.h | 4 +- source/server/sleepServer.cpp | 10 +- source/server/sleepServer.h | 3 +- source/server/udaLegacyServer.cpp | 19 +- source/server/udaLegacyServer.h | 7 +- source/server/udaServer.cpp | 23 +- source/server/udaServer.h | 5 +- source/server/writer.cpp | 4 +- source/server/writer.h | 2 - source/server2/apply_XML.cpp | 6 +- source/server2/apply_XML.hpp | 4 +- source/server2/get_data.cpp | 7 +- source/server2/get_plugin_address.cpp | 2 +- source/server2/get_plugin_address.hpp | 4 +- source/server2/make_server_request_block.cpp | 2 +- source/server2/make_server_request_block.hpp | 3 - source/server2/plugins.cpp | 4 +- source/server2/plugins.hpp | 4 +- source/server2/server.cpp | 5 +- source/server2/server.hpp | 2 +- source/server2/server_environment.cpp | 2 +- source/server2/server_environment.hpp | 2 +- source/server2/server_plugin.cpp | 15 +- source/server2/server_plugin.h | 20 +- source/server2/server_processing.cpp | 4 +- source/server2/server_processing.h | 1 - source/server2/server_subset_data.cpp | 14 +- source/server2/server_subset_data.h | 5 +- source/server2/xdr_protocol.cpp | 9 +- source/server2/xdr_protocol.hpp | 4 +- source/structures/accessors.cpp | 10 +- source/{include => structures}/genStructs.h | 37 +- source/structures/parseIncludeFile.cpp | 10 +- source/structures/parseIncludeFile.h | 12 +- source/structures/struct.cpp | 16 +- source/structures/xdrUserDefinedData.cpp | 14 +- source/structures/xdrUserDefinedData.h | 11 +- source/uda.h | 24 -- source/wrappers/c++/array.cpp | 1 - source/wrappers/c++/array.hpp | 2 +- source/wrappers/c++/client.cpp | 6 +- source/wrappers/c++/client.hpp | 2 +- source/wrappers/c++/data.hpp | 2 +- source/wrappers/c++/dim.hpp | 2 +- source/wrappers/c++/result.cpp | 6 +- source/wrappers/c++/result.hpp | 2 +- source/wrappers/c++/scalar.hpp | 2 +- source/wrappers/c++/signal.cpp | 3 +- source/wrappers/c++/signal.hpp | 2 +- source/wrappers/c++/string.hpp | 2 +- source/wrappers/c++/structdata.hpp | 2 +- source/wrappers/c++/treenode.cpp | 19 +- source/wrappers/c++/treenode.hpp | 6 +- source/wrappers/c++/utilities.h | 21 +- source/wrappers/c++/vector.hpp | 2 +- source/wrappers/fortran/accAPI_F.c | 6 +- source/wrappers/idl/idamStructs.c | 4 +- source/wrappers/idl/idam_dlm.c | 20 +- source/wrappers/java/idam_jni.h | 118 +++--- test/plugins/test2_testplugin.cpp | 3 +- 244 files changed, 1594 insertions(+), 2260 deletions(-) delete mode 100644 source/client2/error_codes.h rename source/{include => clientserver}/udaDefines.h (94%) rename source/{include => clientserver}/udaErrors.h (100%) delete mode 100644 source/include/accAPI.h delete mode 100644 source/include/accessors.h delete mode 100644 source/include/client.h delete mode 100644 source/include/clientAPI.h delete mode 100644 source/include/clientMDS.h delete mode 100644 source/include/export.h create mode 100644 source/include/uda.h create mode 100644 source/include/uda/client.h create mode 100644 source/include/uda/export.h rename source/include/{ => uda}/legacy.h (97%) rename source/include/{udaPlugin.h => uda/plugins.h} (95%) create mode 100644 source/include/uda/portability.h rename source/include/{struct.h => uda/structured.h} (75%) create mode 100644 source/include/uda/types.h rename source/include/{ => uda}/uda_plugin_base.hpp (96%) delete mode 100644 source/include/udaGetAPI.h delete mode 100644 source/include/udaPutAPI.h delete mode 100644 source/include/udaTypes.h delete mode 100644 source/plugins/pluginStructs.h rename source/{include => structures}/genStructs.h (92%) delete mode 100644 source/uda.h diff --git a/.clang-tidy b/.clang-tidy index 664df431..2271a2b5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -7,7 +7,8 @@ CheckOptions: - { key: readability-identifier-naming.StructCase, value: CamelCase } - { key: readability-identifier-naming.FunctionCase, value: lower_case } - { key: readability-identifier-naming.VariableCase, value: lower_case } - - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } + - { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase } + - { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE } WarningsAsErrors: '-*' HeaderFilterRegex: '*.h' FormatStyle: llvm \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index b2fb0088..7fd9c64d 100755 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -72,23 +72,16 @@ configure_file( ) set( HEADERS - include/accAPI.h - include/accessors.h - include/client.h - include/clientAPI.h - include/clientMDS.h - include/export.h - include/genStructs.h - include/legacy.h - include/struct.h - include/udaDefines.h - include/udaErrors.h - include/udaGetAPI.h - include/udaPlugin.h - include/udaPutAPI.h - include/udaTypes.h + include/uda/client.h + include/uda/export.h + include/uda/legacy.h + include/uda/plugins.h + include/uda/structured.h + include/uda/types.h + include/uda/uda_plugin_base.hpp + include/uda/portability.h ) -install( FILES uda.h ${CMAKE_BINARY_DIR}/source/version.h DESTINATION include/uda ) +install( FILES include/uda.h ${CMAKE_BINARY_DIR}/source/version.h DESTINATION include/uda ) install( FILES ${HEADERS} DESTINATION include/uda ) set( ENV_PATH ) diff --git a/source/authentication/udaClientSSL.cpp b/source/authentication/udaClientSSL.cpp index 387b43b9..c84aa123 100644 --- a/source/authentication/udaClientSSL.cpp +++ b/source/authentication/udaClientSSL.cpp @@ -7,10 +7,10 @@ # include # include -# include -# include -# include -# include +# include "client/udaClientHostList.h" +# include "client/updateSelectParms.h" +# include "clientserver/errorLog.h" +# include "logging/logging.h" static bool g_sslDisabled = true; // Default state is not SSL authentication static int g_sslProtocol = 0; // The default server host name has the SSL protocol name prefix or diff --git a/source/authentication/udaClientSSL.h b/source/authentication/udaClientSSL.h index 7483f46a..71ee245d 100644 --- a/source/authentication/udaClientSSL.h +++ b/source/authentication/udaClientSSL.h @@ -23,10 +23,8 @@ # define VERIFY_DEPTH 4 # define X509STRINGSIZE 256 -# include - -# include -# include +# include "client/udaClientHostList.h" +# include "clientserver/socketStructs.h" bool getUdaClientSSLDisabled(); SSL* getUdaClientSSL(); diff --git a/source/authentication/udaServerSSL.cpp b/source/authentication/udaServerSSL.cpp index ace473de..267f0e1e 100644 --- a/source/authentication/udaServerSSL.cpp +++ b/source/authentication/udaServerSSL.cpp @@ -11,9 +11,9 @@ # include # include -# include -# include -# include +# include "clientserver/errorLog.h" +# include "logging/logging.h" +# include "server/writer.h" # define VERIFY_DEPTH 4 # define X509STRINGSIZE 256 diff --git a/source/authentication/udaServerSSL.h b/source/authentication/udaServerSSL.h index 781b4bda..1ad5070f 100644 --- a/source/authentication/udaServerSSL.h +++ b/source/authentication/udaServerSSL.h @@ -11,22 +11,12 @@ // Server host addressed beginng with SSL:// are assumed to be using SSL authentication. The SSL:// prefix is removed to // make the connection. -# include - -# ifdef __cplusplus -extern "C" { -# endif - -LIBRARY_API int startUdaServerSSL(); -LIBRARY_API void closeUdaServerSSL(); -LIBRARY_API int readUdaServerSSL(void* iohandle, char* buf, int count); -LIBRARY_API int writeUdaServerSSL(void* iohandle, const char* buf, int count); -LIBRARY_API void putUdaServerSSLSocket(int socket); -LIBRARY_API bool getUdaServerSSLDisabled(); - -# ifdef __cplusplus -} -# endif +int startUdaServerSSL(); +void closeUdaServerSSL(); +int readUdaServerSSL(void* iohandle, char* buf, int count); +int writeUdaServerSSL(void* iohandle, const char* buf, int count); +void putUdaServerSSLSocket(int socket); +bool getUdaServerSSLDisabled(); #endif // SSLAUTHENTICATION diff --git a/source/bin/uda_cli.cpp b/source/bin/uda_cli.cpp index 21b181e5..45a0fd50 100644 --- a/source/bin/uda_cli.cpp +++ b/source/bin/uda_cli.cpp @@ -1,4 +1,4 @@ -#include "udaTypes.h" +#include #include #include diff --git a/source/c_api/accAPI.cpp b/source/c_api/accAPI.cpp index 3ce3c07f..3e94ea0c 100644 --- a/source/c_api/accAPI.cpp +++ b/source/c_api/accAPI.cpp @@ -1,7 +1,7 @@ -#include "accAPI.h" +#include +#include #include -#include #ifdef __GNUC__ # include @@ -13,7 +13,6 @@ # define strlwr _strlwr #endif -#include "accessors.h" #include "clientserver/allocData.h" #include "clientserver/memstream.h" #include "clientserver/protocol.h" @@ -21,12 +20,10 @@ #include "clientserver/xdrlib.h" #include "clientserver/initStructs.h" #include "logging/logging.h" -#include "struct.h" -#include "version.h" - #include "client/generateErrors.h" #include "client/getEnvironment.h" #include "client/udaClient.h" +#include "version.h" #ifdef __APPLE__ # include @@ -3545,12 +3542,8 @@ void getIdamClientSerialisedDataBlock(int handle, void** object, size_t* objectS int setIdamDataTree(int handle) { - if (getIdamDataOpaqueType(handle) != UDA_OPAQUE_TYPE_STRUCTURES) { - return 0; // Return FALSE - } - if (getIdamData(handle) == nullptr) { - return 0; - } + if (getIdamDataOpaqueType(handle) != UDA_OPAQUE_TYPE_STRUCTURES) return 0; // Return FALSE + if (getIdamData(handle) == nullptr) return 0; udaSetFullNTree((NTREE*)getIdamData(handle)); void* opaque_block = getIdamDataOpaqueBlock(handle); diff --git a/source/c_api/clientAPI.cpp b/source/c_api/clientAPI.cpp index b52a112b..74c66414 100644 --- a/source/c_api/clientAPI.cpp +++ b/source/c_api/clientAPI.cpp @@ -1,4 +1,4 @@ -#include "clientAPI.h" +#include #ifdef __GNUC__ # include @@ -11,7 +11,6 @@ #include "clientserver/initStructs.h" #include "logging/logging.h" -#include "client.h" #include "client/makeClientRequestBlock.h" #include "client/startup.h" diff --git a/source/c_api/clientMDS.cpp b/source/c_api/clientMDS.cpp index 4c5acb2b..50b415ba 100644 --- a/source/c_api/clientMDS.cpp +++ b/source/c_api/clientMDS.cpp @@ -1,10 +1,7 @@ -#include "clientMDS.h" +#include -#include "clientserver/protocol.h" #include "clientserver/initStructs.h" #include "logging/logging.h" - -#include "client.h" #include "client/startup.h" /** diff --git a/source/c_api/udaGetAPI.cpp b/source/c_api/udaGetAPI.cpp index 4383332e..8ec804dd 100644 --- a/source/c_api/udaGetAPI.cpp +++ b/source/c_api/udaGetAPI.cpp @@ -8,7 +8,7 @@ * *--------------------------------------------------------------*/ -#include "udaGetAPI.h" +#include #ifndef _WIN32 # include @@ -19,9 +19,6 @@ #include "clientserver/initStructs.h" #include "logging/logging.h" -#include "accAPI.h" -#include "client.h" -#include "client/getEnvironment.h" #include "client/makeClientRequestBlock.h" #include "client/startup.h" diff --git a/source/c_api/udaPutAPI.cpp b/source/c_api/udaPutAPI.cpp index d658e041..a512c3e5 100644 --- a/source/c_api/udaPutAPI.cpp +++ b/source/c_api/udaPutAPI.cpp @@ -7,7 +7,7 @@ * Returns: *--------------------------------------------------------------*/ -#include "udaPutAPI.h" +#include #include "clientserver/allocData.h" #include "clientserver/errorLog.h" diff --git a/source/cache/cache.cpp b/source/cache/cache.cpp index 8a71ebf1..3cdcad8f 100644 --- a/source/cache/cache.cpp +++ b/source/cache/cache.cpp @@ -1,8 +1,8 @@ #include "cache.h" #include "clientserver/initStructs.h" -#include -#include +#include "clientserver/protocol.h" +#include "clientserver/xdrlib.h" void writeCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, const DATA_BLOCK* data_block, int protocolVersion, LOGSTRUCTLIST* log_struct_list, diff --git a/source/cache/cache.h b/source/cache/cache.h index 5a6bee8c..99b42113 100644 --- a/source/cache/cache.h +++ b/source/cache/cache.h @@ -1,25 +1,16 @@ #ifndef UDA_CACHE_CACHE_H #define UDA_CACHE_CACHE_H -#include "export.h" -#include "genStructs.h" +#include "structures/genStructs.h" #include "clientserver/udaStructs.h" #include -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API void writeCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, +void writeCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, const DATA_BLOCK* data_block, int protocolVersion, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source); -LIBRARY_API DATA_BLOCK* readCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, +DATA_BLOCK* readCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source); -#ifdef __cplusplus -} -#endif - #endif // UDA_CACHE_CACHE_H \ No newline at end of file diff --git a/source/cache/fileCache.cpp b/source/cache/fileCache.cpp index c49d5588..13b216c2 100644 --- a/source/cache/fileCache.cpp +++ b/source/cache/fileCache.cpp @@ -52,8 +52,8 @@ int udaFileCacheWrite(const DATA_BLOCK* data_block, const REQUEST_BLOCK* request # include # include -# include -# include +# include "clientserver/errorLog.h" +# include "clientserver/stringUtils.h" # include constexpr int CACHE_MAXCOUNT = 100; // Max Attempts at obtaining a database table lock diff --git a/source/cache/fileCache.h b/source/cache/fileCache.h index c1feb50a..b091a8d8 100644 --- a/source/cache/fileCache.h +++ b/source/cache/fileCache.h @@ -1,25 +1,16 @@ #ifndef UDA_CACHE_FILECACHE_H #define UDA_CACHE_FILECACHE_H -#include "export.h" -#include "genStructs.h" +#include "structures/genStructs.h" #include "clientserver/udaStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API DATA_BLOCK* udaFileCacheRead(const REQUEST_DATA* request, LOGMALLOCLIST* logmalloclist, +DATA_BLOCK* udaFileCacheRead(const REQUEST_DATA* request, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source); -LIBRARY_API int udaFileCacheWrite(const DATA_BLOCK* data_block, const REQUEST_BLOCK* request_block, +int udaFileCacheWrite(const DATA_BLOCK* data_block, const REQUEST_BLOCK* request_block, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source); -#ifdef __cplusplus -} -#endif - #endif // UDA_CACHE_FILECACHE_H diff --git a/source/cache/memcache.cpp b/source/cache/memcache.cpp index 4f3613e0..a8741521 100644 --- a/source/cache/memcache.cpp +++ b/source/cache/memcache.cpp @@ -52,11 +52,11 @@ DATA_BLOCK* uda::cache::cache_read(uda::cache::UdaCache* cache, const REQUEST_DA // needed for GCC 12.0 - do not delete # include -# include -# include -# include -# include -# include +# include "clientserver/errorLog.h" +# include "clientserver/initStructs.h" +# include "clientserver/memstream.h" +# include "clientserver/xdrlib.h" +# include "logging/logging.h" # define UDA_CACHE_HOST "localhost" // Override these with environment variables with the same name # define UDA_CACHE_PORT 11211 diff --git a/source/cache/memcache.hpp b/source/cache/memcache.hpp index cf1352d8..ba01cf07 100755 --- a/source/cache/memcache.hpp +++ b/source/cache/memcache.hpp @@ -2,8 +2,8 @@ #define UDA_CACHE_MEMCACHE_H #include "clientserver/udaStructs.h" -#include "genStructs.h" -#include "export.h" +#include "structures/genStructs.h" +#include "include/uda/export.h" namespace uda { namespace cache { diff --git a/source/client/clientXDRStream.cpp b/source/client/clientXDRStream.cpp index 861619eb..0d49f7b0 100644 --- a/source/client/clientXDRStream.cpp +++ b/source/client/clientXDRStream.cpp @@ -3,8 +3,8 @@ #include #include -#include "udaDefines.h" -#include +#include "clientserver/udaDefines.h" +#include "logging/logging.h" #include "connection.h" diff --git a/source/client/clientXDRStream.h b/source/client/clientXDRStream.h index 379a0aad..35f47ed0 100644 --- a/source/client/clientXDRStream.h +++ b/source/client/clientXDRStream.h @@ -4,8 +4,6 @@ #include #include -#include "export.h" - std::pair clientCreateXDRStream(); #endif // UDA_CLIENT_CLIENTXDRSTREAM_H diff --git a/source/client/closedown.cpp b/source/client/closedown.cpp index 9cc595b8..d2d0c0c8 100644 --- a/source/client/closedown.cpp +++ b/source/client/closedown.cpp @@ -9,13 +9,12 @@ *--------------------------------------------------------------*/ #include "closedown.h" -#include "client.h" -#include -#include +#include "client/udaClientHostList.h" +#include "logging/logging.h" #ifdef FATCLIENT -# include -# include +# include "server/closeServerSockets.h" +# include "server/udaServer.h" #else # include "connection.h" # include "getEnvironment.h" diff --git a/source/client/closedown.h b/source/client/closedown.h index f307bf42..4dae5314 100644 --- a/source/client/closedown.h +++ b/source/client/closedown.h @@ -1,27 +1,18 @@ #ifndef UDA_CLIENT_CLOSEDOWN_H #define UDA_CLIENT_CLOSEDOWN_H -#include "export.h" -#include +#include "clientserver/socketStructs.h" #ifdef FATCLIENT # define closedown closedownFat #endif -#ifdef __cplusplus -extern "C" { -#endif - enum class ClosedownType { CLOSE_SOCKETS = 0, CLOSE_ALL = 1, }; -LIBRARY_API int closedown(ClosedownType type, SOCKETLIST* socket_list, XDR* client_input, XDR* client_output, +int closedown(ClosedownType type, SOCKETLIST* socket_list, XDR* client_input, XDR* client_output, bool* reopen_logs); -#ifdef __cplusplus -} -#endif - #endif // UDA_CLIENT_CLOSEDOWN_H diff --git a/source/client/connection.cpp b/source/client/connection.cpp index 70b22d16..2a5fb031 100644 --- a/source/client/connection.cpp +++ b/source/client/connection.cpp @@ -40,14 +40,14 @@ # endif #endif -#include "client.h" -#include -#include -#include -#include +#include "client/udaClientHostList.h" +#include "clientserver/errorLog.h" +#include "clientserver/manageSockets.h" +#include "logging/logging.h" #include "getEnvironment.h" #include "updateSelectParms.h" +#include "uda/client.h" #if defined(SSLAUTHENTICATION) && !defined(FATCLIENT) # include diff --git a/source/client/connection.h b/source/client/connection.h index 676e25b1..ade48063 100644 --- a/source/client/connection.h +++ b/source/client/connection.h @@ -3,16 +3,11 @@ #ifndef UDA_CLIENT_CONNECTION_H # define UDA_CLIENT_CONNECTION_H -# include "export.h" # include "clientserver/udaStructs.h" -# include +# include "clientserver/socketStructs.h" # include "closedown.h" -# ifdef __cplusplus -extern "C" { -# endif - int connectionOpen(); int reconnect(ENVIRONMENT* environment, XDR** client_input, XDR** client_output, time_t* tv_server_start, int* user_timeout); @@ -22,8 +17,4 @@ void closeConnection(ClosedownType type); int clientWriteout(void* iohandle, char* buf, int count); int clientReadin(void* iohandle, char* buf, int count); -# ifdef __cplusplus -} -# endif - #endif // UDA_CLIENT_CONNECTION_H diff --git a/source/client/generateErrors.cpp b/source/client/generateErrors.cpp index bf42fdf7..61f64855 100644 --- a/source/client/generateErrors.cpp +++ b/source/client/generateErrors.cpp @@ -15,11 +15,9 @@ #include #include -#include "udaTypes.h" -#include -#include - -#include "accAPI.h" +#include "uda/client.h" +#include "clientserver/allocData.h" +#include "clientserver/errorLog.h" #ifndef NO_GSL_LIB # include diff --git a/source/client/generateErrors.h b/source/client/generateErrors.h index d87572ad..2f5f5b35 100644 --- a/source/client/generateErrors.h +++ b/source/client/generateErrors.h @@ -1,22 +1,12 @@ #ifndef UDA_CLIENT_GENERATEERRORS_H #define UDA_CLIENT_GENERATEERRORS_H -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int idamErrorModel(int model, int param_n, float* params, int data_n, float* data, int* asymmetry, +int idamErrorModel(int model, int param_n, float* params, int data_n, float* data, int* asymmetry, float* errhi, float* errlo); -LIBRARY_API int idamSyntheticModel(int model, int param_n, float* params, int data_n, float* data); -LIBRARY_API int generateIdamSyntheticData(int handle); -LIBRARY_API int generateIdamSyntheticDimData(int handle, int ndim); -LIBRARY_API int generateIdamDataError(int handle); -LIBRARY_API int generateIdamDimDataError(int handle, int ndim); - -#ifdef __cplusplus -} -#endif +int idamSyntheticModel(int model, int param_n, float* params, int data_n, float* data); +int generateIdamSyntheticData(int handle); +int generateIdamSyntheticDimData(int handle, int ndim); +int generateIdamDataError(int handle); +int generateIdamDimDataError(int handle, int ndim); #endif // UDA_CLIENT_GENERATEERRORS_H \ No newline at end of file diff --git a/source/client/getEnvironment.cpp b/source/client/getEnvironment.cpp index 5267555e..b9c49f5b 100644 --- a/source/client/getEnvironment.cpp +++ b/source/client/getEnvironment.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include "logging/logging.h" bool env_host = true; // User can change these before startup so flag to the getEnvironment function bool env_port = true; @@ -55,12 +55,12 @@ bool udaGetEnvPort() return env_port; } -LIBRARY_API void udaSetEnvHost(bool value) +void udaSetEnvHost(bool value) { env_host = value; } -LIBRARY_API void udaSetEnvPort(bool value) +void udaSetEnvPort(bool value) { env_port = value; } diff --git a/source/client/getEnvironment.h b/source/client/getEnvironment.h index 718dc381..34facc3b 100644 --- a/source/client/getEnvironment.h +++ b/source/client/getEnvironment.h @@ -1,7 +1,6 @@ #ifndef UDA_CLIENT_GETENVIRONMENT_H #define UDA_CLIENT_GETENVIRONMENT_H -#include "export.h" #include "clientserver/udaStructs.h" #ifdef FATCLIENT @@ -10,21 +9,13 @@ # define putIdamClientEnvironment putIdamClientEnvironmentFat #endif -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API void printIdamClientEnvironment(const ENVIRONMENT* environment); -LIBRARY_API ENVIRONMENT* getIdamClientEnvironment(); -LIBRARY_API void putIdamClientEnvironment(const ENVIRONMENT* environment); +void printIdamClientEnvironment(const ENVIRONMENT* environment); +ENVIRONMENT* getIdamClientEnvironment(); +void putIdamClientEnvironment(const ENVIRONMENT* environment); -LIBRARY_API bool udaGetEnvHost(); -LIBRARY_API bool udaGetEnvPort(); -LIBRARY_API void udaSetEnvHost(bool env_host); -LIBRARY_API void udaSetEnvPort(bool env_port); - -#ifdef __cplusplus -} -#endif +bool udaGetEnvHost(); +bool udaGetEnvPort(); +void udaSetEnvHost(bool env_host); +void udaSetEnvPort(bool env_port); #endif // UDA_CLIENT_GETENVIRONMENT_H \ No newline at end of file diff --git a/source/client/makeClientRequestBlock.cpp b/source/client/makeClientRequestBlock.cpp index f46bec99..b5a912dd 100644 --- a/source/client/makeClientRequestBlock.cpp +++ b/source/client/makeClientRequestBlock.cpp @@ -23,13 +23,13 @@ Interprets the API arguments and assembles a Request data structure. #include #include "clientserver/initStructs.h" -#include "udaErrors.h" -#include -#include -#include -#include +#include "clientserver/udaErrors.h" +#include "clientserver/errorLog.h" +#include "clientserver/expand_path.h" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/stringUtils.h" #include -#include +#include "logging/logging.h" int makeRequestData(const char* data_object, const char* data_source, REQUEST_DATA* request) { diff --git a/source/client/makeClientRequestBlock.h b/source/client/makeClientRequestBlock.h index 9c50afcb..8d09aa4f 100644 --- a/source/client/makeClientRequestBlock.h +++ b/source/client/makeClientRequestBlock.h @@ -1,19 +1,10 @@ #ifndef UDA_CLIENT_MAKECLIENTREQUESTBLOCK_H #define UDA_CLIENT_MAKECLIENTREQUESTBLOCK_H -#include "export.h" #include "clientserver/udaStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int makeClientRequestBlock(const char** signals, const char** sources, int count, +int makeClientRequestBlock(const char** signals, const char** sources, int count, REQUEST_BLOCK* request_block); -LIBRARY_API void freeClientRequestBlock(REQUEST_BLOCK* request_block); - -#ifdef __cplusplus -} -#endif +void freeClientRequestBlock(REQUEST_BLOCK* request_block); #endif // UDA_CLIENT_MAKECLIENTREQUESTBLOCK_H diff --git a/source/client/startup.cpp b/source/client/startup.cpp index 5ae01540..25076f4f 100644 --- a/source/client/startup.cpp +++ b/source/client/startup.cpp @@ -17,9 +17,9 @@ #include -#include "udaErrors.h" -#include -#include +#include "clientserver/udaErrors.h" +#include "clientserver/errorLog.h" +#include "logging/logging.h" #include "getEnvironment.h" #include "udaClient.h" diff --git a/source/client/startup.h b/source/client/startup.h index b3f0c5c8..2b3593b6 100644 --- a/source/client/startup.h +++ b/source/client/startup.h @@ -5,17 +5,8 @@ # define idamStartup idamStartupFat #endif -#include "export.h" #include "udaClient.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int udaStartup(int reset, CLIENT_FLAGS* client_flags, bool* reopen_logs); - -#ifdef __cplusplus -} -#endif +int udaStartup(int reset, CLIENT_FLAGS* client_flags, bool* reopen_logs); #endif // UDA_CLIENT_STARTUP_H diff --git a/source/client/udaClient.cpp b/source/client/udaClient.cpp index 7e4058cb..39ed12fa 100644 --- a/source/client/udaClient.cpp +++ b/source/client/udaClient.cpp @@ -5,32 +5,31 @@ #include #include +#include "uda/client.h" +#include "uda/structured.h" #include "clientserver/initStructs.h" -#include "struct.h" -#include "udaErrors.h" -#include "udaTypes.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "accAPI.h" +#include "clientserver/udaErrors.h" +#include "cache/fileCache.h" +#include "client/connection.h" +#include "client/getEnvironment.h" +#include "clientserver/errorLog.h" +#include "clientserver/printStructs.h" +#include "clientserver/protocol.h" +#include "clientserver/userid.h" +#include "logging/logging.h" + #include "closedown.h" #ifdef FATCLIENT -# include -# include +# include "clientserver/compressDim.h" +# include "server/udaServer.h" #else # include "clientXDRStream.h" -# include -# include +# include "cache/fileCache.h" +# include "cache/memcache.hpp" # include -# include +# include "clientserver/xdrlib.h" + # ifdef SSLAUTHENTICATION # include # endif diff --git a/source/client/udaClient.h b/source/client/udaClient.h index c85fb15e..ce01ead6 100644 --- a/source/client/udaClient.h +++ b/source/client/udaClient.h @@ -3,8 +3,7 @@ #ifndef UDA_CLIENT_UDACLIENT_H # define UDA_CLIENT_UDACLIENT_H -# include "client.h" -# include "genStructs.h" +# include "structures/genStructs.h" # include "clientserver/udaStructs.h" typedef struct ClientFlags { diff --git a/source/client/udaClientHostList.cpp b/source/client/udaClientHostList.cpp index 93cd6eaa..c54de513 100644 --- a/source/client/udaClientHostList.cpp +++ b/source/client/udaClientHostList.cpp @@ -15,9 +15,9 @@ # include #endif -#include -#include -#include +#include "client/udaClientHostList.h" +#include "clientserver/stringUtils.h" +#include "logging/logging.h" static std::vector g_host_list = {}; diff --git a/source/client/udaClientHostList.h b/source/client/udaClientHostList.h index 09d677b7..5b0401a7 100644 --- a/source/client/udaClientHostList.h +++ b/source/client/udaClientHostList.h @@ -3,8 +3,7 @@ #ifndef UDA_CLIENT_HOSTLIST_H # define UDA_CLIENT_HOSTLIST_H -# include "export.h" -# include +# include "clientserver/socketStructs.h" # include void udaClientFreeHostList(); diff --git a/source/client/updateSelectParms.h b/source/client/updateSelectParms.h index bc4dd322..02f7bfea 100644 --- a/source/client/updateSelectParms.h +++ b/source/client/updateSelectParms.h @@ -3,7 +3,6 @@ #ifndef UDA_CLIENT_UPDATESELECTPARMS_H # define UDA_CLIENT_UPDATESELECTPARMS_H -# include "export.h" # include # ifndef _WIN32 diff --git a/source/client2/client.cpp b/source/client2/client.cpp index 09cabf59..01522a45 100644 --- a/source/client2/client.cpp +++ b/source/client2/client.cpp @@ -1,25 +1,23 @@ #include "client.hpp" -#include "accAPI.h" #include "client_environment.hpp" #include "client_xdr_stream.hpp" -#include "error_codes.h" #include "exceptions.hpp" #include "make_request_block.hpp" #include "clientserver/initStructs.h" -#include "udaDefines.h" -#include "udaErrors.h" -#include "udaTypes.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "clientserver/udaDefines.h" +#include "clientserver/udaErrors.h" +#include "uda/client.h" +#include "cache/fileCache.h" +#include "clientserver/allocData.h" +#include "clientserver/errorLog.h" +#include "clientserver/printStructs.h" +#include "clientserver/protocol.h" +#include "clientserver/stringUtils.h" +#include "clientserver/userid.h" +#include "clientserver/xdrlib.h" +#include "logging/logging.h" namespace { diff --git a/source/client2/client.hpp b/source/client2/client.hpp index eaf0e842..6ccfa9eb 100644 --- a/source/client2/client.hpp +++ b/source/client2/client.hpp @@ -10,11 +10,10 @@ #include #include "clientserver/udaStructs.h" -#include +#include "cache/memcache.hpp" #include "connection.hpp" #include "host_list.hpp" -#include "accAPI.h" constexpr auto DefaultHost = "localhost"; constexpr auto DefaultPort = 56565; diff --git a/source/client2/client_environment.cpp b/source/client2/client_environment.cpp index 538f2c94..64036190 100644 --- a/source/client2/client_environment.cpp +++ b/source/client2/client_environment.cpp @@ -1,7 +1,7 @@ #include "client_environment.hpp" #include #include -#include +#include "logging/logging.h" Environment uda::client::load_environment(bool* env_host, bool* env_port) { diff --git a/source/client2/client_xdr_stream.cpp b/source/client2/client_xdr_stream.cpp index 674957f3..c267b015 100644 --- a/source/client2/client_xdr_stream.cpp +++ b/source/client2/client_xdr_stream.cpp @@ -3,8 +3,8 @@ #include #include -#include "udaDefines.h" -#include +#include "clientserver/udaDefines.h" +#include "logging/logging.h" #include "connection.hpp" diff --git a/source/client2/client_xdr_stream.hpp b/source/client2/client_xdr_stream.hpp index c393d9d7..0dc8028d 100755 --- a/source/client2/client_xdr_stream.hpp +++ b/source/client2/client_xdr_stream.hpp @@ -6,7 +6,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #include "connection.hpp" namespace uda { diff --git a/source/client2/closedown.cpp b/source/client2/closedown.cpp index 13ef17f0..50513a60 100644 --- a/source/client2/closedown.cpp +++ b/source/client2/closedown.cpp @@ -1,6 +1,6 @@ #include "closedown.hpp" -#include +#include "logging/logging.h" #include "connection.hpp" diff --git a/source/client2/closedown.hpp b/source/client2/closedown.hpp index c52bd89e..48c25229 100755 --- a/source/client2/closedown.hpp +++ b/source/client2/closedown.hpp @@ -3,8 +3,8 @@ #ifndef UDA_CLIENT_CLOSEDOWN_H #define UDA_CLIENT_CLOSEDOWN_H -#include -#include "export.h" +#include "clientserver/socketStructs.h" +#include "include/uda/export.h" namespace uda { namespace client { diff --git a/source/client2/connection.cpp b/source/client2/connection.cpp index da44982c..d8afaf50 100644 --- a/source/client2/connection.cpp +++ b/source/client2/connection.cpp @@ -40,12 +40,12 @@ # endif #endif -#include -#include -#include +#include "clientserver/errorLog.h" +#include "clientserver/manageSockets.h" +#include "logging/logging.h" -#include "error_codes.h" #include "host_list.hpp" +#include "uda/client.h" #if defined(SSLAUTHENTICATION) # include diff --git a/source/client2/connection.hpp b/source/client2/connection.hpp index 98b12baa..557f89fe 100755 --- a/source/client2/connection.hpp +++ b/source/client2/connection.hpp @@ -5,9 +5,9 @@ #include -#include +#include "clientserver/socketStructs.h" #include "clientserver/udaStructs.h" -#include "export.h" +#include "include/uda/export.h" #include "closedown.hpp" diff --git a/source/client2/error_codes.h b/source/client2/error_codes.h deleted file mode 100644 index e94187f1..00000000 --- a/source/client2/error_codes.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef UDA_SOURCE_CLIENT2_ERROR_CODES_H -#define UDA_SOURCE_CLIENT2_ERROR_CODES_H - -#define NO_SOCKET_CONNECTION (-10000) -#define PROBLEM_OPENING_LOGS (-11000) -#define FILE_FORMAT_NOT_SUPPORTED (-12000) -#define ERROR_ALLOCATING_DATA_BOCK_HEAP (-13000) -#define SERVER_BLOCK_ERROR (-14000) -#define SERVER_SIDE_ERROR (-14001) -#define DATA_BLOCK_RECEIPT_ERROR (-15000) -#define ERROR_CONDITION_UNKNOWN (-16000) - -#endif // UDA_SOURCE_CLIENT2_ERROR_CODES_H diff --git a/source/client2/generate_errors.cpp b/source/client2/generate_errors.cpp index dbf59b8b..9039b9ab 100644 --- a/source/client2/generate_errors.cpp +++ b/source/client2/generate_errors.cpp @@ -3,11 +3,10 @@ #include #include -#include "udaTypes.h" -#include -#include +#include +#include "clientserver/allocData.h" +#include "clientserver/errorLog.h" -#include "accAPI.h" #include "thread_client.hpp" #ifndef NO_GSL_LIB diff --git a/source/client2/generate_errors.hpp b/source/client2/generate_errors.hpp index 7ad914ea..d76b7906 100755 --- a/source/client2/generate_errors.hpp +++ b/source/client2/generate_errors.hpp @@ -3,7 +3,7 @@ #ifndef UDA_CLIENT_GENERATEERRORS_H #define UDA_CLIENT_GENERATEERRORS_H -#include "export.h" +#include "include/uda/export.h" namespace uda { namespace client { diff --git a/source/client2/handle.cpp b/source/client2/handle.cpp index 24254f7c..2349fef7 100644 --- a/source/client2/handle.cpp +++ b/source/client2/handle.cpp @@ -1,9 +1,8 @@ #include "handle.hpp" #include "clientserver/initStructs.h" -#include "struct.h" #include "clientserver/udaStructs.h" -#include "udaTypes.h" +#include "uda/structured.h" #include "thread_client.hpp" diff --git a/source/client2/host_list.cpp b/source/client2/host_list.cpp index 6dfafc49..c02e59c2 100644 --- a/source/client2/host_list.cpp +++ b/source/client2/host_list.cpp @@ -12,9 +12,9 @@ # include #endif -#include -#include -#include +#include "client/udaClientHostList.h" +#include "clientserver/stringUtils.h" +#include "logging/logging.h" const HostData* uda::client::HostList::find_by_alias(std::string_view alias) const { diff --git a/source/client2/host_list.hpp b/source/client2/host_list.hpp index c00b76e2..af8631ae 100755 --- a/source/client2/host_list.hpp +++ b/source/client2/host_list.hpp @@ -5,8 +5,8 @@ #include #include -#include "export.h" -#include +#include "include/uda/export.h" +#include "clientserver/socketStructs.h" namespace uda { namespace client { diff --git a/source/client2/make_request_block.cpp b/source/client2/make_request_block.cpp index 1727de05..f14f2f54 100644 --- a/source/client2/make_request_block.cpp +++ b/source/client2/make_request_block.cpp @@ -5,10 +5,10 @@ #include #include "clientserver/initStructs.h" -#include "udaErrors.h" -#include -#include -#include +#include "clientserver/udaErrors.h" +#include "clientserver/errorLog.h" +#include "clientserver/expand_path.h" +#include "logging/logging.h" namespace { diff --git a/source/client2/make_request_block.hpp b/source/client2/make_request_block.hpp index bba31a7d..d0273d2c 100755 --- a/source/client2/make_request_block.hpp +++ b/source/client2/make_request_block.hpp @@ -4,7 +4,7 @@ #define UDA_CLIENT_MAKECLIENTREQUESTBLOCK_H #include "clientserver/udaStructs.h" -#include "export.h" +#include "include/uda/export.h" namespace uda { namespace client { diff --git a/source/client2/thread_client.cpp b/source/client2/thread_client.cpp index 9eec7fa5..22d4ca99 100644 --- a/source/client2/thread_client.cpp +++ b/source/client2/thread_client.cpp @@ -1,6 +1,7 @@ #include "thread_client.hpp" + #include "generate_errors.hpp" -#include "udaTypes.h" +#include "uda/client.h" std::once_flag uda::client::ThreadClient::init_flag_ = {}; uda::client::Client* uda::client::ThreadClient::instance_ = nullptr; diff --git a/source/client2/updateSelectParms.h b/source/client2/updateSelectParms.h index bc4dd322..02f7bfea 100644 --- a/source/client2/updateSelectParms.h +++ b/source/client2/updateSelectParms.h @@ -3,7 +3,6 @@ #ifndef UDA_CLIENT_UPDATESELECTPARMS_H # define UDA_CLIENT_UPDATESELECTPARMS_H -# include "export.h" # include # ifndef _WIN32 diff --git a/source/clientserver/allocData.cpp b/source/clientserver/allocData.cpp index 3f8efa80..b12448e4 100644 --- a/source/clientserver/allocData.cpp +++ b/source/clientserver/allocData.cpp @@ -10,8 +10,8 @@ #include "allocData.h" -#include "udaTypes.h" -#include +#include +#include "logging/logging.h" #include "initStructs.h" #include "udaErrors.h" diff --git a/source/clientserver/allocData.h b/source/clientserver/allocData.h index 583ea37d..331e7bf8 100644 --- a/source/clientserver/allocData.h +++ b/source/clientserver/allocData.h @@ -1,23 +1,14 @@ #ifndef UDA_CLIENTSERVER_ALLOCDATA_H #define UDA_CLIENTSERVER_ALLOCDATA_H -#include "export.h" #include "udaStructs.h" #include -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int allocArray(int data_type, size_t ndata, char** ap); -LIBRARY_API int allocData(DATA_BLOCK* data_block); -LIBRARY_API int allocDim(DATA_BLOCK* data_block); -LIBRARY_API int allocPutData(PUTDATA_BLOCK* putData); -LIBRARY_API void addIdamPutDataBlockList(PUTDATA_BLOCK* putDataBlock, PUTDATA_BLOCK_LIST* putDataBlockList); - -#ifdef __cplusplus -} -#endif +int allocArray(int data_type, size_t ndata, char** ap); +int allocData(DATA_BLOCK* data_block); +int allocDim(DATA_BLOCK* data_block); +int allocPutData(PUTDATA_BLOCK* putData); +void addIdamPutDataBlockList(PUTDATA_BLOCK* putDataBlock, PUTDATA_BLOCK_LIST* putDataBlockList); #endif // UDA_CLIENTSERVER_ALLOCDATA_H diff --git a/source/clientserver/allocXMLData.h b/source/clientserver/allocXMLData.h index 5ce867cb..725b7984 100644 --- a/source/clientserver/allocXMLData.h +++ b/source/clientserver/allocXMLData.h @@ -3,24 +3,15 @@ #ifdef HIERARCHICAL_DATA -# include "export.h" # include "idamclientserver.h" # include "idamclientserverxml.h" -# ifdef __cplusplus -extern "C" { -# endif - -LIBRARY_API int alloc_efit(EFIT* efit); -LIBRARY_API int alloc_pfcircuit(PFCIRCUIT* str); -LIBRARY_API int alloc_pfcoils(PFCOILS* str); -LIBRARY_API int alloc_pfpassive(PFPASSIVE* str); -LIBRARY_API int alloc_fluxloop(FLUXLOOP* str); -LIBRARY_API int alloc_limiter(LIMITER* str); - -# ifdef __cplusplus -} -# endif +int alloc_efit(EFIT* efit); +int alloc_pfcircuit(PFCIRCUIT* str); +int alloc_pfcoils(PFCOILS* str); +int alloc_pfpassive(PFPASSIVE* str); +int alloc_fluxloop(FLUXLOOP* str); +int alloc_limiter(LIMITER* str); #endif diff --git a/source/clientserver/compressDim.cpp b/source/clientserver/compressDim.cpp index 39a4310d..67a269e8 100644 --- a/source/clientserver/compressDim.cpp +++ b/source/clientserver/compressDim.cpp @@ -4,7 +4,7 @@ #include #include -#include "udaTypes.h" +#include #include "udaErrors.h" diff --git a/source/clientserver/compressDim.h b/source/clientserver/compressDim.h index 73f645c0..f5fcfcbd 100644 --- a/source/clientserver/compressDim.h +++ b/source/clientserver/compressDim.h @@ -1,14 +1,9 @@ #ifndef UDA_CLIENTSERVER_COMPRESSDIM_H #define UDA_CLIENTSERVER_COMPRESSDIM_H -#include "export.h" #include "udaStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int compressDim(DIMS* ddim); +int compressDim(DIMS* ddim); /*--------------------------------------------------------------- * UDA Dimensional Data Uncompressor @@ -25,10 +20,6 @@ LIBRARY_API int compressDim(DIMS* ddim); * must also have corrections applied. * *--------------------------------------------------------------*/ -LIBRARY_API int uncompressDim(DIMS* ddim); - -#ifdef __cplusplus -} -#endif +int uncompressDim(DIMS* ddim); #endif // UDA_CLIENTSERVER_COMPRESSDIM_H diff --git a/source/clientserver/errorLog.cpp b/source/clientserver/errorLog.cpp index e1b8d019..6d752867 100644 --- a/source/clientserver/errorLog.cpp +++ b/source/clientserver/errorLog.cpp @@ -3,9 +3,9 @@ #include #include -#include "client.h" -#include -#include +#include "uda/client.h" +#include "clientserver/stringUtils.h" +#include "logging/logging.h" static std::vector udaerrorstack; diff --git a/source/clientserver/expand_path.cpp b/source/clientserver/expand_path.cpp index 813acc4a..3e3fde10 100644 --- a/source/clientserver/expand_path.cpp +++ b/source/clientserver/expand_path.cpp @@ -27,12 +27,12 @@ #include #include "udaErrors.h" -#include +#include "logging/logging.h" #include "errorLog.h" #include "stringUtils.h" #ifdef SERVERBUILD -# include +# include "server/serverStartup.h" #endif // Identify the current working Host #ifdef NOEXPANDPATH diff --git a/source/clientserver/expand_path.h b/source/clientserver/expand_path.h index 0fca601d..33537c13 100644 --- a/source/clientserver/expand_path.h +++ b/source/clientserver/expand_path.h @@ -1,26 +1,21 @@ #ifndef UDA_CLIENTSERVER_EXPAND_PATH_H #define UDA_CLIENTSERVER_EXPAND_PATH_H -#include "export.h" #include "udaStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - /*! The workstation (client host) name is obtained using the operating system command 'hostname'. @param host The name of the client host workstation. The string is pre-allocated with length STRING_LENGTH @returns A pointer to the host string (Identical to the argument). */ -LIBRARY_API char* hostid(char* host); +char* hostid(char* host); /*! Test a path is legitimate @param path The file path to be tested. @returns A pointer to the path argument. If a problem occurs, the path string is empty. */ -LIBRARY_API char* pathid(char* path); +char* pathid(char* path); /*! Fully expand file directory paths to remove relative path or environment variable components. @@ -42,7 +37,7 @@ LIBRARY_API char* pathid(char* path); @param path The file path to be resolved and expanded. @returns An integer Error Code: If non zero, a problem occured. */ -LIBRARY_API int expandFilePath(char* path, const ENVIRONMENT* environment); +int expandFilePath(char* path, const ENVIRONMENT* environment); #ifndef NOEXPANDPATH @@ -54,7 +49,7 @@ LIBRARY_API int expandFilePath(char* path, const ENVIRONMENT* environment); @param tokenList A Pointer to an array of token strings @param tokenCount The number of tokens in the list. */ -LIBRARY_API void freeTokenList(char*** tokenListArray, int* tokenCount); +void freeTokenList(char*** tokenListArray, int* tokenCount); /*! Generate a lists of path elements tokens. @@ -63,7 +58,7 @@ LIBRARY_API void freeTokenList(char*** tokenListArray, int* tokenCount); @param tokenList A pointer to an array of token strings. This must be freed using freeTokenList when no longer needed. returns A count of the tokens parsed from input. */ -LIBRARY_API int tokenList(const char* delims, char* input, char*** tokenListArray); +int tokenList(const char* delims, char* input, char*** tokenListArray); /*! Substitute/Replace file path name elements for server side name resolution. @@ -93,14 +88,10 @@ If there are more wildcards in the substitute string than in the target string, @param path The path to be tested for targeted name element replacement. @returns An integer Error Code: If non zero, a problem occured. */ -LIBRARY_API int pathReplacement(char* path, const ENVIRONMENT* environment); +int pathReplacement(char* path, const ENVIRONMENT* environment); -LIBRARY_API int linkReplacement(char* path); +int linkReplacement(char* path); #endif // NOEXPANDPATH -#ifdef __cplusplus -} -#endif - #endif // UDA_CLIENTSERVER_EXPAND_PATH_H diff --git a/source/clientserver/initStructs.cpp b/source/clientserver/initStructs.cpp index 018e12e2..65a2a1d0 100644 --- a/source/clientserver/initStructs.cpp +++ b/source/clientserver/initStructs.cpp @@ -11,7 +11,7 @@ # include #endif -#include "udaTypes.h" +#include #include void initNameValueList(NAMEVALUELIST* nameValueList) diff --git a/source/clientserver/initStructs.h b/source/clientserver/initStructs.h index 5e08bc2d..1d2ef562 100644 --- a/source/clientserver/initStructs.h +++ b/source/clientserver/initStructs.h @@ -1,32 +1,22 @@ #ifndef UDA_CLIENTSERVER_INITSTRUCTS_H #define UDA_CLIENTSERVER_INITSTRUCTS_H -#include "export.h" - #include "udaStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API void initNameValueList(NAMEVALUELIST* nameValueList); -LIBRARY_API void initRequestData(REQUEST_DATA* str); -LIBRARY_API void initRequestBlock(REQUEST_BLOCK* str); -LIBRARY_API void initClientBlock(CLIENT_BLOCK* str, int version, const char* clientname); -LIBRARY_API void initServerBlock(SERVER_BLOCK* str, int version); -LIBRARY_API void initDataBlock(DATA_BLOCK* str); -LIBRARY_API void initDataBlockList(DATA_BLOCK_LIST* str); -LIBRARY_API void initDimBlock(DIMS* str); -LIBRARY_API void initDataSystem(DATA_SYSTEM* str); -LIBRARY_API void initSystemConfig(SYSTEM_CONFIG* str); -LIBRARY_API void initDataSource(DATA_SOURCE* str); -LIBRARY_API void initSignal(SIGNAL* str); -LIBRARY_API void initSignalDesc(SIGNAL_DESC* str); -LIBRARY_API void initIdamPutDataBlock(PUTDATA_BLOCK* str); -LIBRARY_API void initPutDataBlockList(PUTDATA_BLOCK_LIST* putDataBlockList); - -#ifdef __cplusplus -} -#endif +void initNameValueList(NAMEVALUELIST* nameValueList); +void initRequestData(REQUEST_DATA* str); +void initRequestBlock(REQUEST_BLOCK* str); +void initClientBlock(CLIENT_BLOCK* str, int version, const char* clientname); +void initServerBlock(SERVER_BLOCK* str, int version); +void initDataBlock(DATA_BLOCK* str); +void initDataBlockList(DATA_BLOCK_LIST* str); +void initDimBlock(DIMS* str); +void initDataSystem(DATA_SYSTEM* str); +void initSystemConfig(SYSTEM_CONFIG* str); +void initDataSource(DATA_SOURCE* str); +void initSignal(SIGNAL* str); +void initSignalDesc(SIGNAL_DESC* str); +void initIdamPutDataBlock(PUTDATA_BLOCK* str); +void initPutDataBlockList(PUTDATA_BLOCK_LIST* putDataBlockList); #endif // UDA_CLIENTSERVER_INITSTRUCTS_H diff --git a/source/clientserver/initXMLStructs.h b/source/clientserver/initXMLStructs.h index e3183eb6..0445c49a 100644 --- a/source/clientserver/initXMLStructs.h +++ b/source/clientserver/initXMLStructs.h @@ -1,43 +1,34 @@ #ifndef UDA_CLIENTSERVER_INITXMLSTRUCTS_H #define UDA_CLIENTSERVER_INITXMLSTRUCTS_H -#include "export.h" #include "xmlStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API void initEfit(EFIT* str); -LIBRARY_API void initInstance(INSTANCE* str); -LIBRARY_API void initFluxLoop(FLUXLOOP* str); -LIBRARY_API void initPfPassive(PFPASSIVE* str); -LIBRARY_API void initPfCoils(PFCOILS* str); -LIBRARY_API void initMagProbe(MAGPROBE* str); -LIBRARY_API void initPfSupplies(PFSUPPLIES* str); -LIBRARY_API void initPfCircuits(PFCIRCUIT* str); -LIBRARY_API void initPlasmaCurrent(PLASMACURRENT* str); -LIBRARY_API void initDiaMagnetic(DIAMAGNETIC* str); -LIBRARY_API void initToroidalField(TOROIDALFIELD* str); -LIBRARY_API void initLimiter(LIMITER* str); +void initEfit(EFIT* str); +void initInstance(INSTANCE* str); +void initFluxLoop(FLUXLOOP* str); +void initPfPassive(PFPASSIVE* str); +void initPfCoils(PFCOILS* str); +void initMagProbe(MAGPROBE* str); +void initPfSupplies(PFSUPPLIES* str); +void initPfCircuits(PFCIRCUIT* str); +void initPlasmaCurrent(PLASMACURRENT* str); +void initDiaMagnetic(DIAMAGNETIC* str); +void initToroidalField(TOROIDALFIELD* str); +void initLimiter(LIMITER* str); // Print Utilities -LIBRARY_API void printInstance(INSTANCE str); -LIBRARY_API void printMagProbe(MAGPROBE str); -LIBRARY_API void printPfSupplies(PFSUPPLIES str); -LIBRARY_API void printPfCircuits(PFCIRCUIT str); -LIBRARY_API void printFluxLoop(FLUXLOOP str); -LIBRARY_API void printPfCoils(PFCOILS str); -LIBRARY_API void printPfPassive(PFPASSIVE str); -LIBRARY_API void printPlasmaCurrent(PLASMACURRENT str); -LIBRARY_API void printDiaMagnetic(DIAMAGNETIC str); -LIBRARY_API void printToroidalField(TOROIDALFIELD str); -LIBRARY_API void printLimiter(LIMITER str); -LIBRARY_API void printEFIT(EFIT str); - -#ifdef __cplusplus -} -#endif +void printInstance(INSTANCE str); +void printMagProbe(MAGPROBE str); +void printPfSupplies(PFSUPPLIES str); +void printPfCircuits(PFCIRCUIT str); +void printFluxLoop(FLUXLOOP str); +void printPfCoils(PFCOILS str); +void printPfPassive(PFPASSIVE str); +void printPlasmaCurrent(PLASMACURRENT str); +void printDiaMagnetic(DIAMAGNETIC str); +void printToroidalField(TOROIDALFIELD str); +void printLimiter(LIMITER str); +void printEFIT(EFIT str); #endif // UDA_CLIENTSERVER_INITXMLSTRUCTS_H diff --git a/source/clientserver/makeRequestBlock.cpp b/source/clientserver/makeRequestBlock.cpp index 42ba1d23..3af5d47f 100644 --- a/source/clientserver/makeRequestBlock.cpp +++ b/source/clientserver/makeRequestBlock.cpp @@ -13,11 +13,10 @@ #endif #include -#include +#include "logging/logging.h" #include "errorLog.h" #include "parseXML.h" -#include "plugins/pluginStructs.h" #include "stringUtils.h" #include "udaErrors.h" #include "udaStructs.h" diff --git a/source/clientserver/manageSockets.h b/source/clientserver/manageSockets.h index 5f7e1141..c662e082 100644 --- a/source/clientserver/manageSockets.h +++ b/source/clientserver/manageSockets.h @@ -1,31 +1,22 @@ #ifndef UDA_CLIENTSERVER_MANAGESOCKETS_H #define UDA_CLIENTSERVER_MANAGESOCKETS_H -#include "export.h" #include "socketStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - // Initialise -LIBRARY_API void initSocketList(SOCKETLIST* socks); +void initSocketList(SOCKETLIST* socks); // Add a New Socket to the Socket List -LIBRARY_API int addSocket(SOCKETLIST* socks, int type, int status, char* host, int port, int fh); +int addSocket(SOCKETLIST* socks, int type, int status, char* host, int port, int fh); // Search for an Open Socket in the Socket List -LIBRARY_API int getSocket(SOCKETLIST* socks, int type, int* status, char* host, int port, int* fh); +int getSocket(SOCKETLIST* socks, int type, int* status, char* host, int port, int* fh); // Search for an Open Socket in the Socket List -LIBRARY_API int getSocketRecordId(SOCKETLIST* socks, int fh); - -LIBRARY_API void closeClientSockets(SOCKETLIST* socks); +int getSocketRecordId(SOCKETLIST* socks, int fh); -LIBRARY_API void closeClientSocket(SOCKETLIST* socks, int fh); +void closeClientSockets(SOCKETLIST* socks); -#ifdef __cplusplus -} -#endif +void closeClientSocket(SOCKETLIST* socks, int fh); #endif // UDA_CLIENTSERVER_MANAGESOCKETS_H diff --git a/source/clientserver/memstream.h b/source/clientserver/memstream.h index b4ba024b..7ca0b13e 100644 --- a/source/clientserver/memstream.h +++ b/source/clientserver/memstream.h @@ -1,17 +1,8 @@ #ifndef UDA_CLIENTSERVER_MAC_MEMSTREAM_H #define UDA_CLIENTSERVER_MAC_MEMSTREAM_H -#include "export.h" #include -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API FILE* open_memstream(char** cp, size_t* lenp); - -#ifdef __cplusplus -} -#endif +FILE* open_memstream(char** cp, size_t* lenp); #endif // UDA_CLIENTSERVER_MAC_MEMSTREAM_H diff --git a/source/clientserver/mkstemp.h b/source/clientserver/mkstemp.h index 9f8c333c..51449257 100644 --- a/source/clientserver/mkstemp.h +++ b/source/clientserver/mkstemp.h @@ -1,18 +1,8 @@ #ifndef UDA_CLIENTSERVER_MKSTEMP_H #define UDA_CLIENTSERVER_MKSTEMP_H -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - #ifndef __GNUC__ -LIBRARY_API int mkstemp(char* tmpl); -#endif - -#ifdef __cplusplus -} +int mkstemp(char* tmpl); #endif #endif // UDA_CLIENTSERVER_MKSTEMP_H diff --git a/source/clientserver/nameValueSubstitution.cpp b/source/clientserver/nameValueSubstitution.cpp index bfd0808f..163af624 100644 --- a/source/clientserver/nameValueSubstitution.cpp +++ b/source/clientserver/nameValueSubstitution.cpp @@ -10,11 +10,11 @@ #include "initStructs.h" #include "udaErrors.h" -#include -#include -#include +#include "clientserver/errorLog.h" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/stringUtils.h" #include -#include +#include "logging/logging.h" static void embedded_value_substitution(NAMEVALUELIST* nameValueList); diff --git a/source/clientserver/nameValueSubstitution.h b/source/clientserver/nameValueSubstitution.h index 5dbeb073..6fb8059f 100644 --- a/source/clientserver/nameValueSubstitution.h +++ b/source/clientserver/nameValueSubstitution.h @@ -1,9 +1,8 @@ #ifndef UDA_CLIENTSERVER_NAMEVALUESUBSTITUTION_H #define UDA_CLIENTSERVER_NAMEVALUESUBSTITUTION_H -#include "export.h" #include "udaStructs.h" -LIBRARY_API int name_value_substitution(NAMEVALUELIST* nameValueList, char* tpass); +int name_value_substitution(NAMEVALUELIST* nameValueList, char* tpass); #endif // UDA_CLIENTSERVER_NAMEVALUESUBSTITUTION_H diff --git a/source/clientserver/parseOperation.h b/source/clientserver/parseOperation.h index 135a4a03..6c6d9ebc 100644 --- a/source/clientserver/parseOperation.h +++ b/source/clientserver/parseOperation.h @@ -1,17 +1,8 @@ #ifndef UDA_CLIENTSERVER_PARSEOPERATION_H #define UDA_CLIENTSERVER_PARSEOPERATION_H -#include "export.h" #include "parseXML.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int parseOperation(SUBSET* sub); - -#ifdef __cplusplus -} -#endif +int parseOperation(SUBSET* sub); #endif // UDA_CLIENTSERVER_PARSEOPERATION_H diff --git a/source/clientserver/parseXML.cpp b/source/clientserver/parseXML.cpp index 64ef7925..797e0051 100644 --- a/source/clientserver/parseXML.cpp +++ b/source/clientserver/parseXML.cpp @@ -19,13 +19,13 @@ #include #include -#include +#include "logging/logging.h" #ifndef NOXMLPARSER -# include "udaTypes.h" -# include -# include -# include +# include +# include "clientserver/errorLog.h" +# include "clientserver/parseOperation.h" +# include "clientserver/stringUtils.h" static double deScale(char* scale); static void parse_target_value(xmlDocPtr doc, xmlNodePtr cur, const char* target, double* value); diff --git a/source/clientserver/parseXML.h b/source/clientserver/parseXML.h index 07feef84..06717e58 100644 --- a/source/clientserver/parseXML.h +++ b/source/clientserver/parseXML.h @@ -8,14 +8,9 @@ #include -#include "export.h" #include "udaDefines.h" #include "udaStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef struct Map { int nmap; // the Number of Mapping Operations double value[UDA_MAX_DATA_RANK]; // Array of values to Map to @@ -146,19 +141,15 @@ typedef struct Actions { } ACTIONS; #ifndef NOXMLPARSER -LIBRARY_API int parseDoc(char* docname, ACTIONS* actions); -#endif -LIBRARY_API void printAction(ACTION action); -LIBRARY_API void printActions(ACTIONS actions); -LIBRARY_API void initAction(ACTION* act); -LIBRARY_API void initActions(ACTIONS* act); -LIBRARY_API void freeActions(ACTIONS* actions); -LIBRARY_API void copyActions(ACTIONS* actions_out, ACTIONS* actions_in); -LIBRARY_API void initServerside(SERVERSIDE* act); -LIBRARY_API void initSubset(SUBSET* act); - -#ifdef __cplusplus -} +int parseDoc(char* docname, ACTIONS* actions); #endif +void printAction(ACTION action); +void printActions(ACTIONS actions); +void initAction(ACTION* act); +void initActions(ACTIONS* act); +void freeActions(ACTIONS* actions); +void copyActions(ACTIONS* actions_out, ACTIONS* actions_in); +void initServerside(SERVERSIDE* act); +void initSubset(SUBSET* act); #endif // UDA_CLIENTSERVER_PARSEXML_H diff --git a/source/clientserver/printStructs.cpp b/source/clientserver/printStructs.cpp index 79e0f1f0..8f317db5 100644 --- a/source/clientserver/printStructs.cpp +++ b/source/clientserver/printStructs.cpp @@ -4,9 +4,9 @@ #include "printStructs.h" -#include "udaTypes.h" -#include -#include +#include +#include "clientserver/errorLog.h" +#include "logging/logging.h" void printRequestData(REQUEST_DATA str) { diff --git a/source/clientserver/printStructs.h b/source/clientserver/printStructs.h index c1ba2b51..2b4b1fdd 100644 --- a/source/clientserver/printStructs.h +++ b/source/clientserver/printStructs.h @@ -1,27 +1,18 @@ #ifndef UDA_CLIENTSERVER_PRINTSTRUCTS_H #define UDA_CLIENTSERVER_PRINTSTRUCTS_H -#include "export.h" #include "udaStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API void printRequestData(REQUEST_DATA str); -LIBRARY_API void printRequestBlock(REQUEST_BLOCK str); -LIBRARY_API void printClientBlock(CLIENT_BLOCK str); -LIBRARY_API void printServerBlock(SERVER_BLOCK str); -LIBRARY_API void printDataBlockList(DATA_BLOCK_LIST str); -LIBRARY_API void printDataBlock(DATA_BLOCK str); -LIBRARY_API void printSystemConfig(SYSTEM_CONFIG str); -LIBRARY_API void printDataSystem(DATA_SYSTEM str); -LIBRARY_API void printDataSource(DATA_SOURCE str); -LIBRARY_API void printSignal(SIGNAL str); -LIBRARY_API void printSignalDesc(SIGNAL_DESC str); - -#ifdef __cplusplus -} -#endif +void printRequestData(REQUEST_DATA str); +void printRequestBlock(REQUEST_BLOCK str); +void printClientBlock(CLIENT_BLOCK str); +void printServerBlock(SERVER_BLOCK str); +void printDataBlockList(DATA_BLOCK_LIST str); +void printDataBlock(DATA_BLOCK str); +void printSystemConfig(SYSTEM_CONFIG str); +void printDataSystem(DATA_SYSTEM str); +void printDataSource(DATA_SOURCE str); +void printSignal(SIGNAL str); +void printSignalDesc(SIGNAL_DESC str); #endif // UDA_CLIENTSERVER_PRINTSTRUCTS_H diff --git a/source/clientserver/protocol.cpp b/source/clientserver/protocol.cpp index 0c0b0218..c7fd919a 100644 --- a/source/clientserver/protocol.cpp +++ b/source/clientserver/protocol.cpp @@ -23,9 +23,9 @@ #include "protocol.h" -#include "udaTypes.h" +#include #include -#include +#include "logging/logging.h" #include "allocData.h" #include "compressDim.h" @@ -36,7 +36,7 @@ #include "xdrlib.h" #ifdef SERVERBUILD -# include +# include "server/serverStartup.h" #endif int protocol(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOCLIST* logmalloclist, diff --git a/source/clientserver/protocol.h b/source/clientserver/protocol.h index a129cc52..2f30371e 100644 --- a/source/clientserver/protocol.h +++ b/source/clientserver/protocol.h @@ -6,9 +6,7 @@ # include # include -# include "genStructs.h" - -# include "export.h" +# include "structures/genStructs.h" //------------------------------------------------------- // Client Server Conversation Protocols diff --git a/source/clientserver/protocol2.cpp b/source/clientserver/protocol2.cpp index 4e940b2b..c8c355f0 100644 --- a/source/clientserver/protocol2.cpp +++ b/source/clientserver/protocol2.cpp @@ -25,8 +25,8 @@ #include -#include "udaTypes.h" -#include +#include +#include "logging/logging.h" #include "allocData.h" #include "compressDim.h" diff --git a/source/clientserver/protocolXML.cpp b/source/clientserver/protocolXML.cpp index 9edc1479..5584912c 100644 --- a/source/clientserver/protocolXML.cpp +++ b/source/clientserver/protocolXML.cpp @@ -57,10 +57,10 @@ #include #include #include +#include -#include "struct.h" #include -#include +#include "logging/logging.h" #include "errorLog.h" #include "protocol.h" @@ -68,6 +68,7 @@ #include "stringUtils.h" #include "udaErrors.h" #include "xdrlib.h" +#include "protocolXML2.h" #ifdef HIERARCHICAL_DATA # include "allocXMLData.h" diff --git a/source/clientserver/protocolXML.h b/source/clientserver/protocolXML.h index 76ba0523..d963b04a 100644 --- a/source/clientserver/protocolXML.h +++ b/source/clientserver/protocolXML.h @@ -7,8 +7,7 @@ # include # include -# include "export.h" -# include "genStructs.h" +# include "structures/genStructs.h" # ifdef FATCLIENT # define protocolXML protocolXMLFat diff --git a/source/clientserver/protocolXML2.cpp b/source/clientserver/protocolXML2.cpp index e6c96274..7d1809ca 100644 --- a/source/clientserver/protocolXML2.cpp +++ b/source/clientserver/protocolXML2.cpp @@ -55,10 +55,10 @@ #include #include +#include -#include "struct.h" -#include -#include +#include "clientserver/memstream.h" +#include "logging/logging.h" #include "errorLog.h" #include "protocol.h" @@ -67,9 +67,9 @@ #include "xdrlib.h" #ifdef SERVERBUILD -# include -# include -# include +# include "server/createXDRStream.h" +# include "server/serverStartup.h" +# include "server/udaServer.h" #endif #ifndef FATCLIENT diff --git a/source/clientserver/protocolXML2.h b/source/clientserver/protocolXML2.h index 6ce932c8..f3dc691f 100644 --- a/source/clientserver/protocolXML2.h +++ b/source/clientserver/protocolXML2.h @@ -1,26 +1,23 @@ #ifndef UDA_CLIENTSERVER_PROTOCOLXML2_H #define UDA_CLIENTSERVER_PROTOCOLXML2_H -#include "export.h" -#include "genStructs.h" +#include "structures/genStructs.h" #include #include -#ifdef __cplusplus -extern "C" { -#endif - #ifdef FATCLIENT # define protocolXML2 protocolXML2Fat #endif -LIBRARY_API int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOCLIST* logmalloclist, +int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, void* str, int protocolVersion, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source); -#ifdef __cplusplus -} -#endif +int xdrUserDefinedTypeData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, + USERDEFINEDTYPE* userdefinedtype, void** data, int protocolVersion, bool xdr_stdio_flag, + LOGSTRUCTLIST* log_struct_list, int malloc_source); + +bool_t xdr_userdefinedtypelist(XDR* xdrs, USERDEFINEDTYPELIST* str, bool xdr_stdio_flag); #endif // UDA_CLIENTSERVER_PROTOCOLXML2_H diff --git a/source/clientserver/protocolXML2Put.cpp b/source/clientserver/protocolXML2Put.cpp index 1488b062..c91dd410 100644 --- a/source/clientserver/protocolXML2Put.cpp +++ b/source/clientserver/protocolXML2Put.cpp @@ -1,10 +1,9 @@ #include "protocolXML2Put.h" #include +#include -#include "struct.h" -#include "udaErrors.h" -#include +#include "logging/logging.h" #include #include "errorLog.h" @@ -13,7 +12,7 @@ #include "xdrlib.h" #ifdef SERVERBUILD -# include +# include "server/serverStartup.h" #endif static int recursiveDepthPut = 0; // Keep count of recursive calls diff --git a/source/clientserver/protocolXML2Put.h b/source/clientserver/protocolXML2Put.h index 8e2f34f9..0b012cdb 100644 --- a/source/clientserver/protocolXML2Put.h +++ b/source/clientserver/protocolXML2Put.h @@ -4,33 +4,26 @@ #include #include -#include "export.h" -#include "genStructs.h" +#include "structures/genStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* log_struct_list, +int xdrUserDefinedDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* log_struct_list, USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* userdefinedtype, void** data, int datacount, int structRank, int* structShape, int index, NTREE** NTree, int protocolVersion, int malloc_source); // Send/Receive Array of Structures -LIBRARY_API int xdrUserDefinedTypeDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, +int xdrUserDefinedTypeDataPut(XDR* xdrs, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* userdefinedtype, void** data, int protocolVersion, LOGSTRUCTLIST* log_struct_list, int malloc_source); -LIBRARY_API bool_t xdr_userdefinedtypelistPut(XDR* xdrs, USERDEFINEDTYPELIST* str); +bool_t xdr_userdefinedtype(XDR* xdrs, USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* str); + +bool_t xdr_userdefinedtypelistPut(XDR* xdrs, USERDEFINEDTYPELIST* str); -LIBRARY_API int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOCLIST* logmalloclist, +int protocolXML2Put(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, void* str, int protocolVersion, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source); -#ifdef __cplusplus -} -#endif - #endif // UDA_CLIENTSERVER_PROTOCOLXML2PUT_H diff --git a/source/clientserver/readXDRFile.cpp b/source/clientserver/readXDRFile.cpp index cb3cd70d..dc9b761e 100644 --- a/source/clientserver/readXDRFile.cpp +++ b/source/clientserver/readXDRFile.cpp @@ -2,12 +2,12 @@ #include #include -#include +#include "logging/logging.h" #include "errorLog.h" #ifdef SERVERBUILD -# include +# include "server/serverStartup.h" #endif #define MAXDOLOOPLIMIT 500 // ~50MB file diff --git a/source/clientserver/readXDRFile.h b/source/clientserver/readXDRFile.h index 946c0a1a..a4f9e661 100644 --- a/source/clientserver/readXDRFile.h +++ b/source/clientserver/readXDRFile.h @@ -3,7 +3,6 @@ #ifndef UDA_CLIENTSERVER_READXDRFILE_H # define UDA_CLIENTSERVER_READXDRFILE_H -# include "export.h" # include # include diff --git a/source/clientserver/socketStructs.h b/source/clientserver/socketStructs.h index 52483424..550b9437 100644 --- a/source/clientserver/socketStructs.h +++ b/source/clientserver/socketStructs.h @@ -5,7 +5,6 @@ # include "udaDefines.h" -# include "export.h" # include # include diff --git a/source/clientserver/stringUtils.h b/source/clientserver/stringUtils.h index afaf0a14..6e224fa4 100644 --- a/source/clientserver/stringUtils.h +++ b/source/clientserver/stringUtils.h @@ -3,28 +3,25 @@ #ifndef UDA_CLIENTSERVER_STRINGUTILS_H # define UDA_CLIENTSERVER_STRINGUTILS_H -# include "export.h" # include # include # include +# include +# include # ifndef _WIN32 # include # endif -# ifdef __cplusplus -extern "C" { -# endif - # if !defined(_GNU_SOURCE) && !defined(strcasestr) -LIBRARY_API char* strcasestr(const char* haystack, const char* needle); +char* strcasestr(const char* haystack, const char* needle); # endif // Reverse a String -LIBRARY_API void reverseString(const char* in, char* out); +void reverseString(const char* in, char* out); // Copy a String subject to a Maximum length constraint -LIBRARY_API void copyString(const char* in, char* out, int maxlength); +void copyString(const char* in, char* out, int maxlength); /** * Allocate and return a string built using the given format and arguments. @@ -32,65 +29,65 @@ LIBRARY_API void copyString(const char* in, char* out, int maxlength); * @param ... The arguments to use to generate the string * @return The allocated string, needs to be freed */ -LIBRARY_API char* FormatString(const char* fmt, ...); +char* FormatString(const char* fmt, ...); // Trim Trailing Space Characters from a String -LIBRARY_API char* TrimString(char* szSource); +char* TrimString(char* szSource); // Trim Leading Space Characters from a String -LIBRARY_API char* LeftTrimString(char* str); +char* LeftTrimString(char* str); -LIBRARY_API void StringCopy(char* dest, const char* src, size_t len); +void StringCopy(char* dest, const char* src, size_t len); # ifdef __GNUC__ // Convert all LowerCase Characters to Upper Case -LIBRARY_API char* strupr(char* a); +char* strupr(char* a); // Convert all UpperCase Characters to Lower Case -LIBRARY_API char* strlwr(char* a); +char* strlwr(char* a); # endif // Trim Internal Space Characters from a String -LIBRARY_API char* MidTrimString(char* str); +char* MidTrimString(char* str); // Replace all instances of string `find` with string `replace` in the given string -LIBRARY_API char* StringReplaceAll(const char* string, const char* find, const char* replace); +char* StringReplaceAll(const char* string, const char* find, const char* replace); // Replace the first instance of string `find` with string `replace` in the given string -LIBRARY_API char* StringReplace(const char* string, const char* find, const char* replace); +char* StringReplace(const char* string, const char* find, const char* replace); // Is the String an Integer Number? (Simple but not exhaustive Check) -LIBRARY_API int IsNumber(const char* a); +int IsNumber(const char* a); // Is the String a Simple Float Number? -LIBRARY_API int IsFloat(char* a); +int IsFloat(char* a); // Is the String a Number List (#,#,#,#;#;#;#)? -LIBRARY_API int IsNumberList(char* a); +int IsNumberList(char* a); -LIBRARY_API char* convertNonPrintable(char* str); +char* convertNonPrintable(char* str); -LIBRARY_API char* convertNonPrintable2(char* str); +char* convertNonPrintable2(char* str); -LIBRARY_API int IsLegalFilePath(const char* str); +int IsLegalFilePath(const char* str); # if !defined(asprintf) # if defined(__cplusplus) && !defined(__APPLE__) -LIBRARY_API int asprintf(char** strp, const char* fmt, ...) noexcept; +int asprintf(char** strp, const char* fmt, ...) noexcept; # else -LIBRARY_API int asprintf(char** strp, const char* fmt, ...); +int asprintf(char** strp, const char* fmt, ...); # endif # endif -LIBRARY_API char** SplitString(const char* string, const char* delim); +char** SplitString(const char* string, const char* delim); -LIBRARY_API void FreeSplitStringTokens(char*** tokens); +void FreeSplitStringTokens(char*** tokens); -LIBRARY_API bool StringEquals(const char* a, const char* b); +bool StringEquals(const char* a, const char* b); -LIBRARY_API bool StringIEquals(const char* a, const char* b); +bool StringIEquals(const char* a, const char* b); -LIBRARY_API bool StringEndsWith(const char* str, const char* find); +bool StringEndsWith(const char* str, const char* find); # define STR_STARTSWITH(X, Y) !strncmp(X, Y, strlen(Y)) # define STR_ISTARTSWITH(X, Y) !strncasecmp(X, Y, strlen(Y)) @@ -98,12 +95,6 @@ LIBRARY_API bool StringEndsWith(const char* str, const char* find); # define STR_EQUALS(X, Y) StringEquals(X, Y) # define STR_IEQUALS(X, Y) StringIEquals(X, Y) -# ifdef __cplusplus -} - -# include -# include - namespace uda { // remove non printable characters @@ -125,6 +116,5 @@ static inline void rtrim(std::string& s) s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) { return !std::isspace(ch); }).base(), s.end()); } } // namespace uda -# endif // defined(__cplusplus) #endif // UDA_CLIENTSERVER_STRINGUTILS_H diff --git a/source/clientserver/udaDefines.cpp b/source/clientserver/udaDefines.cpp index 5a107ddf..8b137891 100644 --- a/source/clientserver/udaDefines.cpp +++ b/source/clientserver/udaDefines.cpp @@ -1,33 +1 @@ -#include "udaDefines.h" -#include -#if defined(_WIN32) - -# include -# include -# include - -# if !defined(__MINGW32__) -int gettimeofday(struct timeval* tp, struct timezone* tzp) -{ - // Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's - // This magic number is the number of 100 nanosecond intervals since January 1, 1601 (UTC) - // until 00:00:00 January 1, 1970 - static const uint64_t EPOCH = ((uint64_t)116444736000000000ULL); - - SYSTEMTIME system_time = {0}; - FILETIME file_time = {0}; - uint64_t time = 0; - - GetSystemTime(&system_time); - SystemTimeToFileTime(&system_time, &file_time); - time = ((uint64_t)file_time.dwLowDateTime); - time += ((uint64_t)file_time.dwHighDateTime) << 32; - - tp->tv_sec = (long)((time - EPOCH) / 10000000L); - tp->tv_usec = (long)(system_time.wMilliseconds * 1000); - return 0; -} -# endif - -#endif diff --git a/source/include/udaDefines.h b/source/clientserver/udaDefines.h similarity index 94% rename from source/include/udaDefines.h rename to source/clientserver/udaDefines.h index 36cc46df..8cbec39c 100644 --- a/source/include/udaDefines.h +++ b/source/clientserver/udaDefines.h @@ -1,12 +1,6 @@ #ifndef UDA_CLIENTSERVER_IDAMDEFINES_H #define UDA_CLIENTSERVER_IDAMDEFINES_H -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - //-------------------------------------------------------- // Size Definitions @@ -147,17 +141,4 @@ extern "C" { #define DEFAULT_STATUS 1 // Default Signal and Data_Source Status value -//-------------------------------------------------------- -// Not defined functions for Windows MSVC - -#if defined(_WIN32) -# if !defined(__MINGW32__) -LIBRARY_API int gettimeofday(struct timeval* tp, struct timezone* tzp); -# endif -#endif - -#ifdef __cplusplus -} -#endif - #endif // UDA_CLIENTSERVER_IDAMDEFINES_H diff --git a/source/include/udaErrors.h b/source/clientserver/udaErrors.h similarity index 100% rename from source/include/udaErrors.h rename to source/clientserver/udaErrors.h diff --git a/source/clientserver/udaStructs.cpp b/source/clientserver/udaStructs.cpp index 333c79d9..96353139 100644 --- a/source/clientserver/udaStructs.cpp +++ b/source/clientserver/udaStructs.cpp @@ -1,8 +1,8 @@ #include "udaStructs.h" -#include +#include "logging/logging.h" -#include "udaTypes.h" +#include void freePutDataBlockList(PUTDATA_BLOCK_LIST* putDataBlockList) { diff --git a/source/clientserver/udaStructs.h b/source/clientserver/udaStructs.h index 931e2deb..28552f63 100644 --- a/source/clientserver/udaStructs.h +++ b/source/clientserver/udaStructs.h @@ -7,13 +7,7 @@ #include -#include "export.h" #include "udaDefines.h" -// #include "clientserver/parseXML.h" - -#ifdef __cplusplus -extern "C" { -#endif //-------------------------------------------------------- // Structure Definitions @@ -464,8 +458,4 @@ void freeRequestBlock(REQUEST_BLOCK* request_block); void freePutDataBlockList(PUTDATA_BLOCK_LIST* putDataBlockList); -#ifdef __cplusplus -} -#endif - #endif // UDA_CLIENTSERVER_UDASTRUCTS_H diff --git a/source/clientserver/udaTypes.cpp b/source/clientserver/udaTypes.cpp index 7f5c0ae7..6f68e40e 100755 --- a/source/clientserver/udaTypes.cpp +++ b/source/clientserver/udaTypes.cpp @@ -1,4 +1,4 @@ -#include "udaTypes.h" +#include #include "udaStructs.h" diff --git a/source/clientserver/xdrHData.h b/source/clientserver/xdrHData.h index c730fba1..5651cd93 100644 --- a/source/clientserver/xdrHData.h +++ b/source/clientserver/xdrHData.h @@ -1,12 +1,6 @@ #ifndef UDA_CLIENTSERVER_XDRHDATA_H #define UDA_CLIENTSERVER_XDRHDATA_H -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - #ifdef HIERARCHICAL_DATA # include "idamclientserver.h" @@ -14,61 +8,57 @@ extern "C" { //----------------------------------------------------------------------- // Signal Instance -LIBRARY_API bool_t xdr_instance(XDR* xdrs, INSTANCE* str); +bool_t xdr_instance(XDR* xdrs, INSTANCE* str); //----------------------------------------------------------------------- // Toroidal Magnetic Field -LIBRARY_API bool_t xdr_toroidalfield(XDR* xdrs, TOROIDALFIELD* str); +bool_t xdr_toroidalfield(XDR* xdrs, TOROIDALFIELD* str); //----------------------------------------------------------------------- // Plasma Current -LIBRARY_API bool_t xdr_plasmacurrent(XDR* xdrs, PLASMACURRENT* str); +bool_t xdr_plasmacurrent(XDR* xdrs, PLASMACURRENT* str); //----------------------------------------------------------------------- // Diamagnetic Flux -LIBRARY_API bool_t xdr_diamagnetic(XDR* xdrs, DIAMAGNETIC* str); +bool_t xdr_diamagnetic(XDR* xdrs, DIAMAGNETIC* str); //----------------------------------------------------------------------- // PF Circuit -LIBRARY_API bool_t xdr_pfcircuit1(XDR* xdrs, PFCIRCUIT* str); -LIBRARY_API bool_t xdr_pfcircuit2(XDR* xdrs, PFCIRCUIT* str); +bool_t xdr_pfcircuit1(XDR* xdrs, PFCIRCUIT* str); +bool_t xdr_pfcircuit2(XDR* xdrs, PFCIRCUIT* str); //----------------------------------------------------------------------- // Magnetic Probe -LIBRARY_API bool_t xdr_magprobe(XDR* xdrs, MAGPROBE* str); +bool_t xdr_magprobe(XDR* xdrs, MAGPROBE* str); //----------------------------------------------------------------------- // PF Supplies -LIBRARY_API bool_t xdr_pfsupplies(XDR* xdrs, PFSUPPLIES* str); +bool_t xdr_pfsupplies(XDR* xdrs, PFSUPPLIES* str); //----------------------------------------------------------------------- // Flux Loops -LIBRARY_API bool_t xdr_fluxloop1(XDR* xdrs, FLUXLOOP* str); -LIBRARY_API bool_t xdr_fluxloop2(XDR* xdrs, FLUXLOOP* str); +bool_t xdr_fluxloop1(XDR* xdrs, FLUXLOOP* str); +bool_t xdr_fluxloop2(XDR* xdrs, FLUXLOOP* str); //----------------------------------------------------------------------- // PF Passive -LIBRARY_API bool_t xdr_pfpassive1(XDR* xdrs, PFPASSIVE* str); -LIBRARY_API bool_t xdr_pfpassive2(XDR* xdrs, PFPASSIVE* str); +bool_t xdr_pfpassive1(XDR* xdrs, PFPASSIVE* str); +bool_t xdr_pfpassive2(XDR* xdrs, PFPASSIVE* str); //----------------------------------------------------------------------- // PF Coils -LIBRARY_API bool_t xdr_pfcoils1(XDR* xdrs, PFCOILS* str); -LIBRARY_API bool_t xdr_pfcoils2(XDR* xdrs, PFCOILS* str); +bool_t xdr_pfcoils1(XDR* xdrs, PFCOILS* str); +bool_t xdr_pfcoils2(XDR* xdrs, PFCOILS* str); //----------------------------------------------------------------------- // Limiter -LIBRARY_API bool_t xdr_limiter1(XDR* xdrs, LIMITER* str); -LIBRARY_API bool_t xdr_limiter2(XDR* xdrs, LIMITER* str); +bool_t xdr_limiter1(XDR* xdrs, LIMITER* str); +bool_t xdr_limiter2(XDR* xdrs, LIMITER* str); //----------------------------------------------------------------------- // EFIT -LIBRARY_API bool_t xdr_efit(XDR* xdrs, EFIT* str); +bool_t xdr_efit(XDR* xdrs, EFIT* str); #endif // HIERARCHICAL_DATA -#ifdef __cplusplus -} -#endif - #endif // UDA_CLIENTSERVER_XDRHDATA_H diff --git a/source/clientserver/xdrlib.cpp b/source/clientserver/xdrlib.cpp index 748ab146..9d867967 100644 --- a/source/clientserver/xdrlib.cpp +++ b/source/clientserver/xdrlib.cpp @@ -9,10 +9,11 @@ #include #include +#include -#include "struct.h" -#include -#include +#include "clientserver/protocol.h" +#include "clientserver/protocolXML2.h" +#include "logging/logging.h" #include "errorLog.h" #include "printStructs.h" diff --git a/source/clientserver/xdrlib.h b/source/clientserver/xdrlib.h index 497f3be9..cb99bf75 100644 --- a/source/clientserver/xdrlib.h +++ b/source/clientserver/xdrlib.h @@ -3,7 +3,6 @@ #ifndef UDA_CLIENTSERVER_XDRLIB_H # define UDA_CLIENTSERVER_XDRLIB_H -# include "export.h" # include "udaStructs.h" # include diff --git a/source/clientserver/xmlStructs.h b/source/clientserver/xmlStructs.h index 215333a9..5cee97df 100644 --- a/source/clientserver/xmlStructs.h +++ b/source/clientserver/xmlStructs.h @@ -1,12 +1,6 @@ #ifndef UDA_XMLSTRUCTS_H #define UDA_XMLSTRUCTS_H -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - #define XMLMAXSTRING 56 #define XMLMAX 200 * 1024 #define UDA_XML_MAX_LOOP 1024 // Max Number of Array elements @@ -145,8 +139,4 @@ typedef struct { LIMITER* limiter; // Limiter Coordinates } EFIT; -#ifdef __cplusplus -} -#endif - #endif // UDA_XMLSTRUCTS_H diff --git a/source/include/accAPI.h b/source/include/accAPI.h deleted file mode 100644 index a3031b84..00000000 --- a/source/include/accAPI.h +++ /dev/null @@ -1,225 +0,0 @@ -#ifndef UDA_CLIENT_ACCAPI_H -#define UDA_CLIENT_ACCAPI_H - -#include -#include - -#include "client.h" -#include "export.h" -#include "genStructs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define UDA_NUM_CLIENT_THREADS 30 - -LIBRARY_API void setIdamPrivateFlag(unsigned int flag); - -LIBRARY_API void resetIdamPrivateFlag(unsigned int flag); - -LIBRARY_API void setIdamClientFlag(unsigned int flag); - -LIBRARY_API void resetIdamClientFlag(unsigned int flag); - -LIBRARY_API void setIdamProperty(const char* property); - -LIBRARY_API int getIdamProperty(const char* property); - -LIBRARY_API void resetIdamProperty(const char* property); - -LIBRARY_API void resetIdamProperties(); - -#ifndef __APPLE__ - -LIBRARY_API int getIdamMemoryFree(); - -LIBRARY_API int getIdamMemoryUsed(); - -#endif - -LIBRARY_API void putIdamErrorModel(int handle, int model, int param_n, const float* params); - -LIBRARY_API void putIdamDimErrorModel(int handle, int ndim, int model, int param_n, const float* params); - -LIBRARY_API void putIdamServer(const char* host, int port); - -LIBRARY_API void putIdamServerHost(const char* host); - -LIBRARY_API void putIdamServerPort(int port); - -LIBRARY_API void putIdamServerSocket(int socket); - -LIBRARY_API void getIdamServer(const char** host, int* port, int* socket); - -LIBRARY_API int getIdamErrorCode(int handle); - -LIBRARY_API const char* getIdamErrorMsg(int handle); - -LIBRARY_API int getIdamSourceStatus(int handle); - -LIBRARY_API int getIdamSignalStatus(int handle); - -LIBRARY_API int getIdamDataStatus(int handle); - -LIBRARY_API int getIdamDataNum(int handle); - -LIBRARY_API int getIdamRank(int handle); - -LIBRARY_API int getIdamOrder(int handle); - -LIBRARY_API unsigned int getIdamCachePermission(int handle); - -LIBRARY_API unsigned int getIdamTotalDataBlockSize(int handle); - -LIBRARY_API int getIdamDataType(int handle); - -LIBRARY_API int getIdamDataOpaqueType(int handle); - -LIBRARY_API void* getIdamDataOpaqueBlock(int handle); - -LIBRARY_API int getIdamDataOpaqueCount(int handle); - -LIBRARY_API void getIdamErrorModel(int handle, int* model, int* param_n, float* params); - -LIBRARY_API int getIdamErrorType(int handle); - -LIBRARY_API int getIdamDataTypeId(const char* type); - -LIBRARY_API int getIdamDataTypeSize(int type); - -LIBRARY_API void getIdamErrorModel(int handle, int* model, int* param_n, float* params); - -LIBRARY_API int getIdamErrorAsymmetry(int handle); - -LIBRARY_API int getIdamErrorModelId(const char* model); - -LIBRARY_API char* acc_getSyntheticData(int handle); - -LIBRARY_API char* acc_getSyntheticDimData(int handle, int ndim); - -LIBRARY_API void acc_setSyntheticData(int handle, char* data); - -LIBRARY_API void acc_setSyntheticDimData(int handle, int ndim, char* data); - -LIBRARY_API char* getIdamSyntheticData(int handle); - -LIBRARY_API char* getIdamData(int handle); - -LIBRARY_API void getIdamDataTdi(int handle, char* data); - -LIBRARY_API char* getIdamAsymmetricError(int handle, int above); - -LIBRARY_API char* getIdamDataErrLo(int handle); - -LIBRARY_API char* getIdamDataErrHi(int handle); - -LIBRARY_API int getIdamDataErrAsymmetry(int handle); - -LIBRARY_API void acc_setIdamDataErrAsymmetry(int handle, int asymmetry); - -LIBRARY_API void acc_setIdamDataErrType(int handle, int type); - -LIBRARY_API void acc_setIdamDataErrLo(int handle, char* errlo); - -LIBRARY_API char* getIdamDimErrLo(int handle, int ndim); - -LIBRARY_API char* getIdamDimErrHi(int handle, int ndim); - -LIBRARY_API int getIdamDimErrAsymmetry(int handle, int ndim); - -LIBRARY_API void acc_setIdamDimErrAsymmetry(int handle, int ndim, int asymmetry); - -LIBRARY_API void acc_setIdamDimErrType(int handle, int ndim, int type); - -LIBRARY_API void acc_setIdamDimErrLo(int handle, int ndim, char* errlo); - -LIBRARY_API char* getIdamError(int handle); - -LIBRARY_API void getIdamDoubleData(int handle, double* fp); - -LIBRARY_API void getIdamFloatData(int handle, float* fp); - -LIBRARY_API void getIdamGenericData(int handle, void* data); - -LIBRARY_API void getIdamFloatAsymmetricError(int handle, int above, float* fp); - -LIBRARY_API void getIdamFloatError(int handle, float* fp); - -LIBRARY_API const char* getIdamDataLabel(int handle); - -LIBRARY_API void getIdamDataLabelTdi(int handle, char* label); - -LIBRARY_API const char* getIdamDataUnits(int handle); - -LIBRARY_API void getIdamDataUnitsTdi(int handle, char* units); - -LIBRARY_API const char* getIdamDataDesc(int handle); - -LIBRARY_API void getIdamDataDescTdi(int handle, char* desc); - -LIBRARY_API int getIdamDimNum(int handle, int ndim); - -LIBRARY_API int getIdamDimType(int handle, int ndim); - -LIBRARY_API int getIdamDimErrorType(int handle, int ndim); - -LIBRARY_API int getIdamDimErrorAsymmetry(int handle, int ndim); - -LIBRARY_API void getIdamDimErrorModel(int handle, int ndim, int* model, int* param_n, float* params); - -LIBRARY_API char* getIdamSyntheticDimData(int handle, int ndim); - -LIBRARY_API char* getIdamDimData(int handle, int ndim); - -LIBRARY_API const char* getIdamDimLabel(int handle, int ndim); - -LIBRARY_API const char* getIdamDimUnits(int handle, int ndim); - -LIBRARY_API void getIdamDimLabelTdi(int handle, int ndim, char* label); - -LIBRARY_API void getIdamDimUnitsTdi(int handle, int ndim, char* units); - -LIBRARY_API void getIdamDoubleDimData(int handle, int ndim, double* fp); - -LIBRARY_API void getIdamFloatDimData(int handle, int ndim, float* fp); - -LIBRARY_API void getIdamGenericDimData(int handle, int ndim, void* data); - -LIBRARY_API char* getIdamDimAsymmetricError(int handle, int ndim, int above); - -LIBRARY_API char* getIdamDimError(int handle, int ndim); - -LIBRARY_API void getIdamFloatDimAsymmetricError(int handle, int ndim, int above, float* fp); - -LIBRARY_API void getIdamFloatDimError(int handle, int ndim, float* fp); - -LIBRARY_API int idamDataCheckSum(void* data, int data_n, int type); - -LIBRARY_API int getIdamDataCheckSum(int handle); - -LIBRARY_API int getIdamDimDataCheckSum(int handle, int ndim); - -LIBRARY_API int getIdamThreadLastHandle(); - -LIBRARY_API void putIdamThreadLastHandle(int handle); - -LIBRARY_API int getIdamMaxThreadCount(); - -LIBRARY_API int setIdamDataTree(int handle); - -// Return a specific data tree - -typedef struct NTree NTREE; - -LIBRARY_API NTREE* getIdamDataTree(int handle); - -// Return a user defined data structure definition - -LIBRARY_API NTREE* findIdamNTreeStructureDefinition(NTREE* node, const char* target); - -#ifdef __cplusplus -} -#endif - -#endif // UDA_CLIENT_ACCAPI_H diff --git a/source/include/accessors.h b/source/include/accessors.h deleted file mode 100644 index 9332b1f0..00000000 --- a/source/include/accessors.h +++ /dev/null @@ -1,254 +0,0 @@ -#ifndef UDA_STRUCTURES_ACCESSORS_H -#define UDA_STRUCTURES_ACCESSORS_H - -#include "export.h" -#include "genStructs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Find (search type A) the first Tree Node with a data structure type containing a named element/member. - * The name of the element is also returned. - * - * This is a private function with the whole sub-tree in scope. - * - * @param ntree A pointer to a parent tree node that defines the start (root) of the sub-tree. If NULL the root node is - * assumed. - * @param target The name of the data structure element/member (case sensitive) using the hierachical naming syntax - * a.b.c or a/b/c. This element may be either a data structure or an atomic typed element. If a single named item is - * specified without its hierarchical naming context, the tree node with the first occurance of the name is selected. - * Using the hierarchy imposes more rigour to the search. - * @param lastname Returns the name of the element, i.e., the name of the last item in the name hierarchy. - * @return the Tree Node containing the named element. - */ -LIBRARY_API NTREE* findNTreeStructureComponent2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, - const char** lastname); - -/** Find (search type B) and return a Pointer to the named Data Tree Node with a data structure of the same name. - * The name of the structure is also returned. - * - * This is a private function with the whole sub-tree in scope. - * - * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the Structure (case sensitive) using a hierachical naming syntax a.b.c or a/b/c. - * @param lastname Returns the name of the Structure, i.e., the name of the last node in the name hierarchy. - * @return the Data Tree Node with the structure name. - */ -LIBRARY_API NTREE* findNTreeStructure2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, - const char** lastname); - -/** Find (search type A) and return a Pointer to the Data Tree Node with a data structure that contains a named element. - * - * This is a public function with the whole sub-tree in scope. - * - * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the structure element or member (case sensitive) using a hierachical naming syntax a.b.c or - * a/b/c. This element may be either a structure itself or an atomic typed element. - * @return the Data Tree Node. - */ -LIBRARY_API NTREE* findNTreeStructureComponent(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); - -/** Find (search type A) and return a Pointer to the Child Data Tree Node with a data structure that contains a named - * element. - * - * This is a public function with the child sub-trees in scope. - * - * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the structure element or member (case sensitive) using a hierachical naming syntax a.b.c or - * a/b/c. This element may be either a structure itself or an atomic typed element. - * @return the Data Tree Node. - */ -LIBRARY_API NTREE* findNTreeChildStructureComponent(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); - -/** Find (search type B) and return a Pointer to the named Data Tree Node with a data structure of the same name. - * - * This is a public function with the whole sub-tree in scope. - * - * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the Structure (case sensitive) using a hierachical naming syntax a.b.c or a/b/c. - * @return the Data Tree Node. - */ -LIBRARY_API NTREE* findNTreeStructure(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); - -/** Find (search type B) and return a Pointer to the named Data Tree Node with a data structure of the same name. - * - * This is a public function with child sub-trees in scope. - * - * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the Structure (case sensitive) using a hierachical naming syntax a.b.c or a/b/c. - * @return the child Data Tree Node. - */ -LIBRARY_API NTREE* findNTreeChildStructure(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); - -/** Find and return a Pointer to a Data Tree Node with a data structure located at a specific memory location. - * - * This is a public function with the whole sub-tree in scope. - * - * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. - * @param data The heap address of the data. - * @return the Data Tree Node. - */ -LIBRARY_API NTREE* findNTreeStructureMalloc(NTREE* ntree, void* data); - -/** Locate a tree node with structured data having the specified Structure Definition name. - * - * This is a public function with the whole sub-tree in scope. - * - * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the Structure Definition. - * @return A pointer to the First tree node found with the targeted structure definition. - */ -LIBRARY_API NTREE* findNTreeStructureDefinition(NTREE* ntree, const char* target); - -/** Locate a tree node with structured data having the specified Structure Definition name. - * - * This is a public function with the whole sub-tree in scope. - * - * @param tree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the Structure Definition. - * @return A pointer to the First tree node found with the targeted structure definition. - */ -LIBRARY_API NTREE* findNTreeStructureComponentDefinition(NTREE* tree, const char* target); - -/** Locate a tree node with structured data having a Specific Structure Class. - * - * This is a public function with the whole sub-tree in scope. - * - * @param tree A pointer to a parent tree node. If NULL the root node is assumed. - * @param class The Structure Class, e.g., UDA_TYPE_VLEN. - * @return A pointer to the First tree node found with the targeted structure class. - */ -LIBRARY_API NTREE* idam_findNTreeStructureClass(NTREE* tree, int cls); - -/** Identify the largest count of a Variable Length Array with a given structure type. - * - * This is a public function with the whole sub-tree in scope. - * - * @param tree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the VLEN Structure Definition. - * @param reset Reset the counbter to zero. - * @return An integer returning the maximum count value. - */ -LIBRARY_API int idam_maxCountVlenStructureArray(NTREE* tree, const char* target, int reset); - -/** Regularise a specific VLEN structure. - * - * This is a public function with the whole sub-tree in scope. - * - * @param tree A pointer to a parent tree node. If NULL the root node is assumed. - * @param target The name of the VLEN Structure Definition. - * @param count The maximum count size for the VLEN data arrays. - * @return An integer returning an error code: 0 => OK. - */ -LIBRARY_API int idam_regulariseVlenStructures(LOGMALLOCLIST* logmalloclist, NTREE* tree, - USERDEFINEDTYPELIST* userdefinedtypelist, const char* target, - unsigned int count); - -/** Regularise the Shape of All VLEN structured data arrays in the data tree: necessary for accessing in some languages, - * e.g. IDL. - * - * This is a public function with the whole sub-tree in scope. - * - * @param tree A pointer to a parent tree node. If NULL the root node is assumed. - * @return An integer returning an error code: 0 => OK. - */ -LIBRARY_API int idam_regulariseVlenData(LOGMALLOCLIST* logmalloclist, NTREE* tree, - USERDEFINEDTYPELIST* userdefinedtypelist); - -//--------------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------------- -// User Accessor functions to Node Data (only the current node is in scope) - -/** Return the Count of data array elements attached to this tree node. - * - * This is a public function with the current tree node only in scope. - * - * @param ntree A pointer to a tree node. If NULL the root node is assumed. - * @return the Count of structured data array elements. - */ -LIBRARY_API int getNodeStructureDataCount(LOGMALLOCLIST* logmalloclist, NTREE* ntree); - -/** Return the Size (bytes) of the structured data array attached to this tree node. - * - * This is a public function with the current tree node only in scope. - * - * @param ntree A pointer to a tree node. If NULL the root node is assumed. - * @return the Size (bytes) of the structured data array. - */ -LIBRARY_API int getNodeStructureDataSize(LOGMALLOCLIST* logmalloclist, NTREE* ntree); - -/** Return the rank of the structured data array attached to this tree node. - * - * This is a public function with the current tree node only in scope. - * - * @param ntree A pointer to a tree node. If NULL the root node is assumed. - * @return The rank of the structured data array. - */ -LIBRARY_API int getNodeStructureDataRank(LOGMALLOCLIST* logmalloclist, NTREE* ntree); - -/** Return the shape of the structured data array attached to this tree node. - * - * This is a public function with the current tree node only in scope. - * - * @param ntree A pointer to a tree node. If NULL the root node is assumed. - * @return A pointer to the integer shape array of the structured data array. - */ -LIBRARY_API int* getNodeStructureDataShape(LOGMALLOCLIST* logmalloclist, NTREE* ntree); - -/** Return a pointer to the structured data type name of the data array attached to this tree node. - * - * This is a public function with the current tree node only in scope. - * - * @param ntree A pointer to a tree node. If NULL the root node is assumed. - * @return the data type name of the structured data array. - */ -LIBRARY_API const char* getNodeStructureDataDataType(LOGMALLOCLIST* logmalloclist, NTREE* ntree); - -/** Return a pointer to the data attached to this tree node. - * - * This is a public function with the current tree node only in scope. - * - * @param ntree A pointer to a tree node. If NULL the root node is assumed. - * @return A void pointer to the data . - */ -LIBRARY_API void* getNodeStructureData(NTREE* ntree); - -//---------------------------------------------------------------------------------------------------------- -// Sundry utility functions - -/** Print the Contents of a tree node to a specified File Descriptor. The arguments for this function are - * available from the Structure Definition structure. - * - * This is a public function with the current tree node only in scope. - * - * @param fd The File Descriptor, e.g., stdout - * @param image A text block containing null terminated strings that forms an text image of the structure definition. - * @param imagecount The number of bytes in the image text block. - * @return Void - */ -LIBRARY_API void printImage(const char* image, int imagecount); - -//---------------------------------------------------------------------------------------------------------- -/**User defined structure field definition for common types - * - * This is a public function - * - * @param field The user defined structure's field to be populated - * @param name Name of the structure's field. - * @param desc Description of the fields contents - * @param offset Current field byte offset from the start of the structure. Ppdated on return. - * @param type_id Enumerated key indicating the type of data field, e.g. float array - * @return Void - */ -LIBRARY_API void defineField(COMPOUNDFIELD* field, const char* name, const char* desc, int* offset, - unsigned short type_id); - -LIBRARY_API void defineCompoundField(COMPOUNDFIELD* field, const char* type, const char* name, char* desc, int offset, - int size); - -#ifdef __cplusplus -} -#endif - -#endif // UDA_STRUCTURES_ACCESSORS_H diff --git a/source/include/client.h b/source/include/client.h deleted file mode 100644 index 4102fb84..00000000 --- a/source/include/client.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef UDA_CLIENT_H -#define UDA_CLIENT_H - -// TODO: remove this and the XDR globals -#include - -#include "export.h" -#include "genStructs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef FATCLIENT -# define idamClient idamClientFat -# define idamFreeAll idamFreeAllFat -# define udaClientFlags udaClientFlagsFat -#endif - -//-------------------------------------------------------------- -// Client Side API Error Codes - -#define NO_SOCKET_CONNECTION (-10000) -#define PROBLEM_OPENING_LOGS (-11000) -#define FILE_FORMAT_NOT_SUPPORTED (-12000) -#define ERROR_ALLOCATING_DATA_BOCK_HEAP (-13000) -#define SERVER_BLOCK_ERROR (-14000) -#define SERVER_SIDE_ERROR (-14001) -#define DATA_BLOCK_RECEIPT_ERROR (-15000) -#define ERROR_CONDITION_UNKNOWN (-16000) - -#define NO_EXP_NUMBER_SPECIFIED (-18005) - -#define MIN_STATUS (-1) // Deny Access to Data if this Status Value -#define DATA_STATUS_BAD (-17000) // Error Code if Status is Bad - -LIBRARY_API void udaFree(int handle); - -LIBRARY_API void udaFreeAll(); - -/** - * Get the version of the client c-library. - */ -LIBRARY_API const char* udaGetBuildVersion(); - -/** - * Get the date that the client c-library was built. - */ -LIBRARY_API const char* udaGetBuildDate(); - -LIBRARY_API const char* getIdamServerHost(); - -LIBRARY_API int getIdamServerPort(); - -LIBRARY_API int getIdamServerSocket(); - -LIBRARY_API const char* getIdamClientDOI(); - -LIBRARY_API const char* getIdamServerDOI(); - -LIBRARY_API const char* getIdamClientOSName(); - -LIBRARY_API const char* getIdamServerOSName(); - -LIBRARY_API int getIdamClientVersion(); - -LIBRARY_API int getIdamServerVersion(); - -LIBRARY_API int getIdamServerErrorCode(); - -LIBRARY_API const char* getIdamServerErrorMsg(); - -LIBRARY_API int getIdamServerErrorStackSize(); - -LIBRARY_API int getIdamServerErrorStackRecordType(int record); - -LIBRARY_API int getIdamServerErrorStackRecordCode(int record); - -LIBRARY_API const char* getIdamServerErrorStackRecordLocation(int record); - -LIBRARY_API const char* getIdamServerErrorStackRecordMsg(int record); - -LIBRARY_API void closeAllConnections(); - -LIBRARY_API int udaNumErrors(void); -LIBRARY_API const char* udaGetErrorMessage(int err_num); -LIBRARY_API int udaGetErrorCode(int err_num); -LIBRARY_API const char* udaGetErrorLocation(int err_num); - -typedef struct LogMallocList LOGMALLOCLIST; -typedef struct UserDefinedTypeList USERDEFINEDTYPELIST; - -LIBRARY_API LOGMALLOCLIST* getIdamLogMallocList(int handle); -LIBRARY_API USERDEFINEDTYPELIST* getIdamUserDefinedTypeList(int handle); - -#ifdef __cplusplus -} -#endif - -#endif // UDA_CLIENT_H diff --git a/source/include/clientAPI.h b/source/include/clientAPI.h deleted file mode 100644 index 23722833..00000000 --- a/source/include/clientAPI.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef UDA_CLIENT_CLIENTAPI_H -#define UDA_CLIENT_CLIENTAPI_H - -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int idamClientAPI(const char* file, const char* signal, int pass, int exp_number); -LIBRARY_API int idamClientFileAPI(const char* file, const char* signal, const char* format); -LIBRARY_API int idamClientFileAPI2(const char* file, const char* format, const char* owner, const char* signal, - int exp_number, int pass); -LIBRARY_API int idamClientTestAPI(const char* file, const char* signal, int pass, int exp_number); - -#ifdef __cplusplus -} -#endif - -#endif // UDA_CLIENT_CLIENTAPI_H \ No newline at end of file diff --git a/source/include/clientMDS.h b/source/include/clientMDS.h deleted file mode 100644 index dada6293..00000000 --- a/source/include/clientMDS.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef UDA_CLIENT_CLIENTMDS_H -#define UDA_CLIENT_CLIENTMDS_H - -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int idamClientMDS(const char* server, const char* tree, const char* node, int treenum); - -#ifdef __cplusplus -} -#endif - -#endif // UDA_CLIENT_CLIENTMDS_H diff --git a/source/include/export.h b/source/include/export.h deleted file mode 100644 index 7409629e..00000000 --- a/source/include/export.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef UDA_CLIENTSERVER_EXPORT_H -#define UDA_CLIENTSERVER_EXPORT_H - -#ifdef _WIN32 -# ifdef UDA_EXPORT -# define LIBRARY_API __declspec(dllexport) -# else -# define LIBRARY_API __declspec(dllimport) -# endif -#else -# define LIBRARY_API -#endif - -#endif // UDA_CLIENTSERVER_EXPORT_H diff --git a/source/include/uda.h b/source/include/uda.h new file mode 100644 index 00000000..2f21a0cc --- /dev/null +++ b/source/include/uda.h @@ -0,0 +1,20 @@ +#pragma once + +#ifndef UDA_H +#define UDA_H + +# include "uda/client.h" +# include "uda/export.h" +# include "uda/plugins.h" +# include "uda/structured.h" +# include "uda/types.h" + +# ifdef __cplusplus +# include "uda/uda_plugin_base.hpp" +# endif + +# ifdef UDA_LEGACY +# include "uda/legacy.h" +# endif // UDA_LEGACY + +#endif // UDA_H diff --git a/source/include/uda/client.h b/source/include/uda/client.h new file mode 100644 index 00000000..fcc36f87 --- /dev/null +++ b/source/include/uda/client.h @@ -0,0 +1,317 @@ +#ifndef UDA_CLIENT_H +#define UDA_CLIENT_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define NO_SOCKET_CONNECTION (-10000) +#define PROBLEM_OPENING_LOGS (-11000) +#define FILE_FORMAT_NOT_SUPPORTED (-12000) +#define ERROR_ALLOCATING_DATA_BOCK_HEAP (-13000) +#define SERVER_BLOCK_ERROR (-14000) +#define SERVER_SIDE_ERROR (-14001) +#define DATA_BLOCK_RECEIPT_ERROR (-15000) +#define ERROR_CONDITION_UNKNOWN (-16000) + +#define MIN_STATUS (-1) // Deny Access to Data if this Status Value +#define DATA_STATUS_BAD (-17000) // Error Code if Status is Bad + +typedef struct LogMallocList LOGMALLOCLIST; +typedef struct UserDefinedTypeList USERDEFINEDTYPELIST; + +#ifdef FATCLIENT +# define idamGetAPI idamGetAPIFat +# define idamGetBatchAPI idamGetBatchAPIFat +# define idamGetAPIWithHost idamGetAPIWithHostFat +# define idamGetBatchAPIWithHost idamGetBatchAPIWithHostFat +#endif + +LIBRARY_API int idamGetAPI(const char* data_object, const char* data_source); + +LIBRARY_API int idamGetBatchAPI(const char** uda_signals, const char** sources, int count, int* handles); + +LIBRARY_API int idamGetAPIWithHost(const char* data_object, const char* data_source, const char* host, int port); + +LIBRARY_API int idamGetBatchAPIWithHost(const char** uda_signals, const char** sources, int count, int* handles, + const char* host, int port); + +LIBRARY_API int idamPutListAPI(const char* putInstruction, PUTDATA_BLOCK_LIST* inPutDataBlockList); + +LIBRARY_API int idamPutAPI(const char* putInstruction, PUTDATA_BLOCK* inPutData); + +LIBRARY_API int idamClientAPI(const char *file, const char *signal, int pass, int exp_number); + +LIBRARY_API int idamClientFileAPI(const char *file, const char *signal, const char *format); + +LIBRARY_API int idamClientFileAPI2(const char *file, const char *format, const char *owner, const char *signal, + int exp_number, int pass); + +LIBRARY_API int idamClientTestAPI(const char *file, const char *signal, int pass, int exp_number); + +LIBRARY_API int idamClientMDS(const char *server, const char *tree, const char *node, int treenum); + +LIBRARY_API void udaFree(int handle); + +LIBRARY_API void udaFreeAll(); + +/** + * Get the version of the client c-library. + */ +LIBRARY_API const char *udaGetBuildVersion(); + +/** + * Get the date that the client c-library was built. + */ +LIBRARY_API const char *udaGetBuildDate(); + +LIBRARY_API const char *getIdamServerHost(); + +LIBRARY_API int getIdamServerPort(); + +LIBRARY_API int getIdamServerSocket(); + +LIBRARY_API const char *getIdamClientDOI(); + +LIBRARY_API const char *getIdamServerDOI(); + +LIBRARY_API const char *getIdamClientOSName(); + +LIBRARY_API const char *getIdamServerOSName(); + +LIBRARY_API int getIdamClientVersion(); + +LIBRARY_API int getIdamServerVersion(); + +LIBRARY_API int getIdamServerErrorCode(); + +LIBRARY_API const char *getIdamServerErrorMsg(); + +LIBRARY_API int getIdamServerErrorStackSize(); + +LIBRARY_API int getIdamServerErrorStackRecordType(int record); + +LIBRARY_API int getIdamServerErrorStackRecordCode(int record); + +LIBRARY_API const char *getIdamServerErrorStackRecordLocation(int record); + +LIBRARY_API const char *getIdamServerErrorStackRecordMsg(int record); + +LIBRARY_API void closeAllConnections(); + +LIBRARY_API int udaNumErrors(void); +LIBRARY_API const char *udaGetErrorMessage(int err_num); +LIBRARY_API int udaGetErrorCode(int err_num); +LIBRARY_API const char *udaGetErrorLocation(int err_num); + +LIBRARY_API LOGMALLOCLIST *getIdamLogMallocList(int handle); +LIBRARY_API USERDEFINEDTYPELIST *getIdamUserDefinedTypeList(int handle); + +#define UDA_NUM_CLIENT_THREADS 30 + +LIBRARY_API void setIdamPrivateFlag(unsigned int flag); + +LIBRARY_API void resetIdamPrivateFlag(unsigned int flag); + +LIBRARY_API void setIdamClientFlag(unsigned int flag); + +LIBRARY_API void resetIdamClientFlag(unsigned int flag); + +LIBRARY_API void setIdamProperty(const char *property); + +LIBRARY_API int getIdamProperty(const char *property); + +LIBRARY_API void resetIdamProperty(const char *property); + +LIBRARY_API void resetIdamProperties(); + +#ifndef __APPLE__ + +LIBRARY_API int getIdamMemoryFree(); + +LIBRARY_API int getIdamMemoryUsed(); + +#endif + +LIBRARY_API void putIdamErrorModel(int handle, int model, int param_n, const float *params); + +LIBRARY_API void putIdamDimErrorModel(int handle, int ndim, int model, int param_n, const float *params); + +LIBRARY_API void putIdamServer(const char *host, int port); + +LIBRARY_API void putIdamServerHost(const char *host); + +LIBRARY_API void putIdamServerPort(int port); + +LIBRARY_API void putIdamServerSocket(int socket); + +LIBRARY_API void getIdamServer(const char **host, int *port, int *socket); + +LIBRARY_API int getIdamErrorCode(int handle); + +LIBRARY_API const char *getIdamErrorMsg(int handle); + +LIBRARY_API int getIdamSourceStatus(int handle); + +LIBRARY_API int getIdamSignalStatus(int handle); + +LIBRARY_API int getIdamDataStatus(int handle); + +LIBRARY_API int getIdamDataNum(int handle); + +LIBRARY_API int getIdamRank(int handle); + +LIBRARY_API int getIdamOrder(int handle); + +LIBRARY_API unsigned int getIdamCachePermission(int handle); + +LIBRARY_API unsigned int getIdamTotalDataBlockSize(int handle); + +LIBRARY_API int getIdamDataType(int handle); + +LIBRARY_API int getIdamDataOpaqueType(int handle); + +LIBRARY_API void *getIdamDataOpaqueBlock(int handle); + +LIBRARY_API int getIdamDataOpaqueCount(int handle); + +LIBRARY_API void getIdamErrorModel(int handle, int *model, int *param_n, float *params); + +LIBRARY_API int getIdamErrorType(int handle); + +LIBRARY_API int getIdamDataTypeId(const char *type); + +LIBRARY_API int getIdamDataTypeSize(int type); + +LIBRARY_API void getIdamErrorModel(int handle, int *model, int *param_n, float *params); + +LIBRARY_API int getIdamErrorAsymmetry(int handle); + +LIBRARY_API int getIdamErrorModelId(const char *model); + +LIBRARY_API char *acc_getSyntheticData(int handle); + +LIBRARY_API char *acc_getSyntheticDimData(int handle, int ndim); + +LIBRARY_API void acc_setSyntheticData(int handle, char *data); + +LIBRARY_API void acc_setSyntheticDimData(int handle, int ndim, char *data); + +LIBRARY_API char *getIdamSyntheticData(int handle); + +LIBRARY_API char *getIdamData(int handle); + +LIBRARY_API void getIdamDataTdi(int handle, char *data); + +LIBRARY_API char *getIdamAsymmetricError(int handle, int above); + +LIBRARY_API char *getIdamDataErrLo(int handle); + +LIBRARY_API char *getIdamDataErrHi(int handle); + +LIBRARY_API int getIdamDataErrAsymmetry(int handle); + +LIBRARY_API void acc_setIdamDataErrAsymmetry(int handle, int asymmetry); + +LIBRARY_API void acc_setIdamDataErrType(int handle, int type); + +LIBRARY_API void acc_setIdamDataErrLo(int handle, char *errlo); + +LIBRARY_API char *getIdamDimErrLo(int handle, int ndim); + +LIBRARY_API char *getIdamDimErrHi(int handle, int ndim); + +LIBRARY_API int getIdamDimErrAsymmetry(int handle, int ndim); + +LIBRARY_API void acc_setIdamDimErrAsymmetry(int handle, int ndim, int asymmetry); + +LIBRARY_API void acc_setIdamDimErrType(int handle, int ndim, int type); + +LIBRARY_API void acc_setIdamDimErrLo(int handle, int ndim, char *errlo); + +LIBRARY_API char *getIdamError(int handle); + +LIBRARY_API void getIdamDoubleData(int handle, double *fp); + +LIBRARY_API void getIdamFloatData(int handle, float *fp); + +LIBRARY_API void getIdamGenericData(int handle, void *data); + +LIBRARY_API void getIdamFloatAsymmetricError(int handle, int above, float *fp); + +LIBRARY_API void getIdamFloatError(int handle, float *fp); + +LIBRARY_API const char *getIdamDataLabel(int handle); + +LIBRARY_API void getIdamDataLabelTdi(int handle, char *label); + +LIBRARY_API const char *getIdamDataUnits(int handle); + +LIBRARY_API void getIdamDataUnitsTdi(int handle, char *units); + +LIBRARY_API const char *getIdamDataDesc(int handle); + +LIBRARY_API void getIdamDataDescTdi(int handle, char *desc); + +LIBRARY_API int getIdamDimNum(int handle, int ndim); + +LIBRARY_API int getIdamDimType(int handle, int ndim); + +LIBRARY_API int getIdamDimErrorType(int handle, int ndim); + +LIBRARY_API int getIdamDimErrorAsymmetry(int handle, int ndim); + +LIBRARY_API void getIdamDimErrorModel(int handle, int ndim, int *model, int *param_n, float *params); + +LIBRARY_API char *getIdamSyntheticDimData(int handle, int ndim); + +LIBRARY_API char *getIdamDimData(int handle, int ndim); + +LIBRARY_API const char *getIdamDimLabel(int handle, int ndim); + +LIBRARY_API const char *getIdamDimUnits(int handle, int ndim); + +LIBRARY_API void getIdamDimLabelTdi(int handle, int ndim, char *label); + +LIBRARY_API void getIdamDimUnitsTdi(int handle, int ndim, char *units); + +LIBRARY_API void getIdamDoubleDimData(int handle, int ndim, double *fp); + +LIBRARY_API void getIdamFloatDimData(int handle, int ndim, float *fp); + +LIBRARY_API void getIdamGenericDimData(int handle, int ndim, void *data); + +LIBRARY_API char *getIdamDimAsymmetricError(int handle, int ndim, int above); + +LIBRARY_API char *getIdamDimError(int handle, int ndim); + +LIBRARY_API void getIdamFloatDimAsymmetricError(int handle, int ndim, int above, float *fp); + +LIBRARY_API void getIdamFloatDimError(int handle, int ndim, float *fp); + +LIBRARY_API int idamDataCheckSum(void *data, int data_n, int type); + +LIBRARY_API int getIdamDataCheckSum(int handle); + +LIBRARY_API int getIdamDimDataCheckSum(int handle, int ndim); + +LIBRARY_API int getIdamThreadLastHandle(); + +LIBRARY_API void putIdamThreadLastHandle(int handle); + +LIBRARY_API int getIdamMaxThreadCount(); + +LIBRARY_API int setIdamDataTree(int handle); + +LIBRARY_API NTREE *getIdamDataTree(int handle); + +LIBRARY_API NTREE *findIdamNTreeStructureDefinition(NTREE *node, const char *target); + +#ifdef __cplusplus +} +#endif + +#endif // UDA_CLIENT_H \ No newline at end of file diff --git a/source/include/uda/export.h b/source/include/uda/export.h new file mode 100644 index 00000000..038ba094 --- /dev/null +++ b/source/include/uda/export.h @@ -0,0 +1,14 @@ +#ifndef UDA_EXPORT_H +#define UDA_EXPORT_H + +#ifdef _WIN32 +# ifdef UDA_EXPORT +# define __declspec(dllexport) +# else +# define __declspec(dllimport) +# endif +#else +# define LIBRARY_API +#endif + +#endif // UDA_EXPORT_H diff --git a/source/include/legacy.h b/source/include/uda/legacy.h similarity index 97% rename from source/include/legacy.h rename to source/include/uda/legacy.h index c5f0d93f..ac874ab8 100644 --- a/source/include/legacy.h +++ b/source/include/uda/legacy.h @@ -1,7 +1,7 @@ #pragma once #ifndef UDA_LEGACY_H -# define UDA_LEGACY_H +#define UDA_LEGACY_H # warning "using UDA legacy name mappings" diff --git a/source/include/udaPlugin.h b/source/include/uda/plugins.h similarity index 95% rename from source/include/udaPlugin.h rename to source/include/uda/plugins.h index 5409ff63..cad62fd0 100644 --- a/source/include/udaPlugin.h +++ b/source/include/uda/plugins.h @@ -1,24 +1,8 @@ -#ifndef UDA_PLUGINS_UDAPLUGIN_H -#define UDA_PLUGINS_UDAPLUGIN_H +#ifndef UDA_PLUGINS_H +#define UDA_PLUGINS_H -#include - -#include "export.h" -#include "plugins/pluginStructs.h" -#include "udaTypes.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct UdaErrorStack UDA_ERROR_STACK; -typedef struct UdaPluginInterface UDA_PLUGIN_INTERFACE; -typedef struct CompoundField COMPOUNDFIELD; -typedef struct UserDefinedType USERDEFINEDTYPE; - -#define MAXFUNCTIONNAME 256 - -// plugin State +#include +#include #define UDA_PLUGIN_INTERNAL 0 #define UDA_PLUGIN_EXTERNAL 1 // The plugin resides in an external shared library @@ -30,6 +14,10 @@ typedef struct UserDefinedType USERDEFINEDTYPE; #define UDA_PLUGIN_PRIVATE 1 // Only internal users can use the service (access the data!) #define UDA_PLUGIN_PUBLIC 0 // All users - internal and external - can use the service +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*ADDIDAMERRORFUNP)(UDA_ERROR_STACK*, int, char*, int, char*); // Write to the Error Log // Prototypes @@ -49,9 +37,9 @@ LIBRARY_API UDA_PLUGIN_INTERFACE* udaCreatePluginInterface(const char* request); LIBRARY_API void udaFreePluginInterface(UDA_PLUGIN_INTERFACE* plugin_interface); -LIBRARY_API COMPOUNDFIELD* udaNewCompoundField(const char*, const char*, int*, int); +LIBRARY_API COMPOUNDFIELD* udaNewCompoundField(const char* name, const char* description, int* offset, int type); -LIBRARY_API USERDEFINEDTYPE* udaNewUserType(const char*, const char*, int, int, char*, size_t, size_t, COMPOUNDFIELD**); +LIBRARY_API USERDEFINEDTYPE* udaNewUserType(const char* name, const char* source, int ref_id, int image_count, char* image, size_t size, size_t num_fields, COMPOUNDFIELD** fields); LIBRARY_API int udaAddUserType(UDA_PLUGIN_INTERFACE*, USERDEFINEDTYPE* user_type); LIBRARY_API int udaRegisterMalloc(UDA_PLUGIN_INTERFACE* plugin_interface, void* data, int, size_t, const char*); @@ -195,4 +183,4 @@ LIBRARY_API bool findDoubleArray(const UDA_PLUGIN_INTERFACE* plugin_interface, d } #endif -#endif // UDA_PLUGINS_UDAPLUGIN_H +#endif // UDA_PLUGINS_H \ No newline at end of file diff --git a/source/include/uda/portability.h b/source/include/uda/portability.h new file mode 100644 index 00000000..d123151d --- /dev/null +++ b/source/include/uda/portability.h @@ -0,0 +1,30 @@ +#if defined(_WIN32) + +# include +# include +# include + +# if !defined(__MINGW32__) +inline int gettimeofday(struct timeval* tp, struct timezone* tzp) +{ + // Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's + // This magic number is the number of 100 nanosecond intervals since January 1, 1601 (UTC) + // until 00:00:00 January 1, 1970 + static const uint64_t EPOCH = ((uint64_t)116444736000000000ULL); + + SYSTEMTIME system_time = {0}; + FILETIME file_time = {0}; + uint64_t time = 0; + + GetSystemTime(&system_time); + SystemTimeToFileTime(&system_time, &file_time); + time = ((uint64_t)file_time.dwLowDateTime); + time += ((uint64_t)file_time.dwHighDateTime) << 32; + + tp->tv_sec = (long)((time - EPOCH) / 10000000L); + tp->tv_usec = (long)(system_time.wMilliseconds * 1000); + return 0; +} +# endif + +#endif \ No newline at end of file diff --git a/source/include/struct.h b/source/include/uda/structured.h similarity index 75% rename from source/include/struct.h rename to source/include/uda/structured.h index 62b75c2a..8d54fae3 100644 --- a/source/include/struct.h +++ b/source/include/uda/structured.h @@ -1,42 +1,25 @@ -#ifndef UDA_STRUCTURES_STRUCT_H -#define UDA_STRUCTURES_STRUCT_H +#ifndef UDA_STRUCTURED_H +#define UDA_STRUCTURED_H -#include -#include -#include +#include +#include +#include -#include "export.h" -#include "genStructs.h" -#include "udaTypes.h" - -#ifdef SERVERBUILD -# include -#endif +#define MAXELEMENTS 256 // Max number of structure elements +#define MAXELEMENTNAME 256 // structure element name #ifdef __cplusplus extern "C" { #endif +typedef intptr_t VOIDTYPE; +typedef uintptr_t UVOIDTYPE; + LIBRARY_API NTREE* udaGetFullNTree(); LIBRARY_API void udaSetFullNTree(NTREE* ntree); LIBRARY_API void setLastMallocIndexValue(unsigned int* lastMallocIndexValue_in); -/** Initialise a SARRAY data structure. - * - * @param str A pointer to a SARRAY data structure instance. - * @return void. - */ -LIBRARY_API void initSArray(SARRAY* str); - -/** Print the Contents of a SARRAY data structure. - * - * @param fd A File Descriptor. - * @param str A SARRAY data structure instance. - * @return void. - */ -LIBRARY_API void printSarray(SARRAY str); - /** Add an NTREE List entry. * * @param node A NTREE node to add. @@ -128,85 +111,6 @@ LIBRARY_API void initUserDefinedType(USERDEFINEDTYPE* str); */ LIBRARY_API void initUserDefinedTypeList(USERDEFINEDTYPELIST* str); -/** Initialise a GENERAL_BLOCK data structure. - * - * @param str A pointer to a GENERAL_BLOCK data structure instance. - * @return void. - */ -LIBRARY_API void initGeneralBlock(GENERAL_BLOCK* str); - -/** Print the Contents of a COMPOUNDFIELD data structure. - * - * @param fd A File Descriptor. - * @param str A COMPOUNDFIELD data structure instance. - * @return void. - */ -LIBRARY_API void printCompoundField(COMPOUNDFIELD str); - -/** Print the Tabulated Contents of a COMPOUNDFIELD data structure. - * - * @param fd A File Descriptor. - * @param str A COMPOUNDFIELD data structure instance. - * @return void. - */ -LIBRARY_API void printCompoundFieldTable(COMPOUNDFIELD str); - -/** Print the Contents of a USERDEFINEDTYPE data structure. - * - * @param fd A File Descriptor. - * @param str A USERDEFINEDTYPE data structure instance. - * @return void. - */ -LIBRARY_API void printUserDefinedType(USERDEFINEDTYPE str); - -/** Print the Tabulated Contents of a USERDEFINEDTYPE data structure. - * - * @param fd A File Descriptor. - * @param str A USERDEFINEDTYPE data structure instance. - * @return void. - */ -LIBRARY_API void printUserDefinedTypeTable(USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE str); - -/** Print the Tabulated Contents of a USERDEFINEDTYPE data structure with Zero Sized elements. - * - * @param fd A File Descriptor. - * @param str A USERDEFINEDTYPE data structure instance. - * @return void. - */ -LIBRARY_API void printZeroSizedUserDefinedTypeTable(USERDEFINEDTYPE str); - -/** Print the Contents of a USERDEFINEDTYPELIST data structure. - * - * @param fd A File Descriptor. - * @param str A USERDEFINEDTYPELIST data structure instance. - * @return void. - */ -LIBRARY_API void printUserDefinedTypeList(USERDEFINEDTYPELIST str); - -/** Print the Tabulated Contents of a USERDEFINEDTYPELIST data structure. - * - * @param fd A File Descriptor. - * @param str A USERDEFINEDTYPELIST data structure instance. - * @return void. - */ -LIBRARY_API void printUserDefinedTypeListTable(USERDEFINEDTYPELIST str); - -/** Print the Tabulated Contents of a USERDEFINEDTYPELIST data structure where the size is zero. - * - * @param fd A File Descriptor. - * @param str A USERDEFINEDTYPELIST data structure instance. - * @return void. - */ -LIBRARY_API void printZeroSizedUserDefinedTypeListTable(USERDEFINEDTYPELIST str); - -/** Print the Contents of a LOGMALLOC data structure. - * - * @param fd A File Descriptor. - * @param str A LOGMALLOC data structure instance. - * @return void. - */ -LIBRARY_API void printMallocLog(LOGMALLOC str); - /** Print the Contents of the Global LOGMALLOCLIST data structure. * * @param fd A File Descriptor. @@ -529,32 +433,12 @@ LIBRARY_API void printError(int warning, int line, char* file, char* msg); // The count of data structures to be received is passed ... // -LIBRARY_API int xdrAtomicData(LOGMALLOCLIST* logmalloclist, XDR* xdrs, const char* type, int count, int size, - char** data); - -// Send/Receive Array of Structures - -LIBRARY_API int xdrUserDefinedTypeData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, - USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* userdefinedtype, - void** data, int protocolVersion, bool xdr_stdio_flag, - LOGSTRUCTLIST* log_struct_list, int malloc_source); - LIBRARY_API int findUserDefinedTypeId(USERDEFINEDTYPELIST* userdefinedtypelist, const char* name); -LIBRARY_API USERDEFINEDTYPE* findUserDefinedType(USERDEFINEDTYPELIST* userdefinedtypelist, const char* name, - int ref_id); +LIBRARY_API USERDEFINEDTYPE* findUserDefinedType(USERDEFINEDTYPELIST* userdefinedtypelist, const char* name, int ref_id); LIBRARY_API int testUserDefinedType(USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* udt); -//============================================================================================================== -// Functions to Send or Receive Definitions of User Defined Structure - -LIBRARY_API bool_t xdr_compoundfield(XDR* xdrs, COMPOUNDFIELD* str); - -LIBRARY_API bool_t xdr_userdefinedtype(XDR* xdrs, USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* str); - -LIBRARY_API bool_t xdr_userdefinedtypelist(XDR* xdrs, USERDEFINEDTYPELIST* str, bool xdr_stdio_flag); - //---------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------- // Client Utility functions operating on Linked List N-Tree @@ -604,7 +488,7 @@ LIBRARY_API void printTypeCount(NTREE* ntree, const char* target); * @param target The name of a Structure Element. * @return the Structure Element Definition Structure. */ -COMPOUNDFIELD* getNodeStructureComponent(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); +LIBRARY_API COMPOUNDFIELD* getNodeStructureComponent(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); //--------------------------------------------------------------------------------------------- // Tree Node Family: Single tree node is in scope @@ -959,7 +843,7 @@ LIBRARY_API void printNodeStructure(LOGMALLOCLIST* logmalloclist, NTREE* ntree); * @return the User Defined Structure Component's data cast to float. */ -LIBRARY_API float* castNodeStructureComponentDatatoFloat(LOGMALLOCLIST* logmalloclist, NTREE* ntree, +float* castNodeStructureComponentDatatoFloat(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); /** Return a pointer to a User Defined Structure Component's data cast to DOUBLE. @@ -969,7 +853,7 @@ LIBRARY_API float* castNodeStructureComponentDatatoFloat(LOGMALLOCLIST* logmallo * @return the User Defined Structure Component's data cast to float. */ -LIBRARY_API double* castNodeStructureComponentDatatoDouble(LOGMALLOCLIST* logmalloclist, NTREE* ntree, +double* castNodeStructureComponentDatatoDouble(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); //--------------------------------------------------------------------------------------------- @@ -1122,10 +1006,249 @@ LIBRARY_API void castNodeStructureComponentDatatoFloat_f(LOGMALLOCLIST* logmallo float* data_f); LIBRARY_API void addStructureField(USERDEFINEDTYPE* user_type, const char* name, const char* desc, UDA_TYPE data_type, - bool is_pointer, int rank, int* shape, size_t offset); +LIBRARY_API bool is_pointer, int rank, int* shape, size_t offset); + +/** Find (search type A) the first Tree Node with a data structure type containing a named element/member. + * The name of the element is also returned. + * + * This is a private function with the whole sub-tree in scope. + * + * @param ntree A pointer to a parent tree node that defines the start (root) of the sub-tree. If NULL the root node is + * assumed. + * @param target The name of the data structure element/member (case sensitive) using the hierachical naming syntax + * a.b.c or a/b/c. This element may be either a data structure or an atomic typed element. If a single named item is + * specified without its hierarchical naming context, the tree node with the first occurance of the name is selected. + * Using the hierarchy imposes more rigour to the search. + * @param lastname Returns the name of the element, i.e., the name of the last item in the name hierarchy. + * @return the Tree Node containing the named element. + */ +LIBRARY_API NTREE* findNTreeStructureComponent2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, + const char** lastname); + +/** Find (search type B) and return a Pointer to the named Data Tree Node with a data structure of the same name. + * The name of the structure is also returned. + * + * This is a private function with the whole sub-tree in scope. + * + * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the Structure (case sensitive) using a hierachical naming syntax a.b.c or a/b/c. + * @param lastname Returns the name of the Structure, i.e., the name of the last node in the name hierarchy. + * @return the Data Tree Node with the structure name. + */ +LIBRARY_API NTREE* findNTreeStructure2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, + const char** lastname); + +/** Find (search type A) and return a Pointer to the Data Tree Node with a data structure that contains a named element. + * + * This is a public function with the whole sub-tree in scope. + * + * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the structure element or member (case sensitive) using a hierachical naming syntax a.b.c or + * a/b/c. This element may be either a structure itself or an atomic typed element. + * @return the Data Tree Node. + */ +LIBRARY_API NTREE* findNTreeStructureComponent(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); + +/** Find (search type A) and return a Pointer to the Child Data Tree Node with a data structure that contains a named + * element. + * + * This is a public function with the child sub-trees in scope. + * + * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the structure element or member (case sensitive) using a hierachical naming syntax a.b.c or + * a/b/c. This element may be either a structure itself or an atomic typed element. + * @return the Data Tree Node. + */ +LIBRARY_API NTREE* findNTreeChildStructureComponent(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); + +/** Find (search type B) and return a Pointer to the named Data Tree Node with a data structure of the same name. + * + * This is a public function with the whole sub-tree in scope. + * + * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the Structure (case sensitive) using a hierachical naming syntax a.b.c or a/b/c. + * @return the Data Tree Node. + */ +LIBRARY_API NTREE* findNTreeStructure(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); + +/** Find (search type B) and return a Pointer to the named Data Tree Node with a data structure of the same name. + * + * This is a public function with child sub-trees in scope. + * + * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the Structure (case sensitive) using a hierachical naming syntax a.b.c or a/b/c. + * @return the child Data Tree Node. + */ +LIBRARY_API NTREE* findNTreeChildStructure(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); + +/** Find and return a Pointer to a Data Tree Node with a data structure located at a specific memory location. + * + * This is a public function with the whole sub-tree in scope. + * + * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. + * @param data The heap address of the data. + * @return the Data Tree Node. + */ +LIBRARY_API NTREE* findNTreeStructureMalloc(NTREE* ntree, void* data); + +/** Locate a tree node with structured data having the specified Structure Definition name. + * + * This is a public function with the whole sub-tree in scope. + * + * @param ntree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the Structure Definition. + * @return A pointer to the First tree node found with the targeted structure definition. + */ +LIBRARY_API NTREE* findNTreeStructureDefinition(NTREE* ntree, const char* target); + +/** Locate a tree node with structured data having the specified Structure Definition name. + * + * This is a public function with the whole sub-tree in scope. + * + * @param tree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the Structure Definition. + * @return A pointer to the First tree node found with the targeted structure definition. + */ +LIBRARY_API NTREE* findNTreeStructureComponentDefinition(NTREE* tree, const char* target); + +/** Locate a tree node with structured data having a Specific Structure Class. + * + * This is a public function with the whole sub-tree in scope. + * + * @param tree A pointer to a parent tree node. If NULL the root node is assumed. + * @param class The Structure Class, e.g., UDA_TYPE_VLEN. + * @return A pointer to the First tree node found with the targeted structure class. + */ +LIBRARY_API NTREE* idam_findNTreeStructureClass(NTREE* tree, int cls); + +/** Identify the largest count of a Variable Length Array with a given structure type. + * + * This is a public function with the whole sub-tree in scope. + * + * @param tree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the VLEN Structure Definition. + * @param reset Reset the counbter to zero. + * @return An integer returning the maximum count value. + */ +LIBRARY_API int idam_maxCountVlenStructureArray(NTREE* tree, const char* target, int reset); + +/** Regularise a specific VLEN structure. + * + * This is a public function with the whole sub-tree in scope. + * + * @param tree A pointer to a parent tree node. If NULL the root node is assumed. + * @param target The name of the VLEN Structure Definition. + * @param count The maximum count size for the VLEN data arrays. + * @return An integer returning an error code: 0 => OK. + */ +LIBRARY_API int idam_regulariseVlenStructures(LOGMALLOCLIST* logmalloclist, NTREE* tree, + USERDEFINEDTYPELIST* userdefinedtypelist, const char* target, + unsigned int count); + +/** Regularise the Shape of All VLEN structured data arrays in the data tree: necessary for accessing in some languages, + * e.g. IDL. + * + * This is a public function with the whole sub-tree in scope. + * + * @param tree A pointer to a parent tree node. If NULL the root node is assumed. + * @return An integer returning an error code: 0 => OK. + */ +LIBRARY_API int idam_regulariseVlenData(LOGMALLOCLIST* logmalloclist, NTREE* tree, + USERDEFINEDTYPELIST* userdefinedtypelist); + +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- +// User Accessor functions to Node Data (only the current node is in scope) + +/** Return the Count of data array elements attached to this tree node. + * + * This is a public function with the current tree node only in scope. + * + * @param ntree A pointer to a tree node. If NULL the root node is assumed. + * @return the Count of structured data array elements. + */ +LIBRARY_API int getNodeStructureDataCount(LOGMALLOCLIST* logmalloclist, NTREE* ntree); + +/** Return the Size (bytes) of the structured data array attached to this tree node. + * + * This is a public function with the current tree node only in scope. + * + * @param ntree A pointer to a tree node. If NULL the root node is assumed. + * @return the Size (bytes) of the structured data array. + */ +LIBRARY_API int getNodeStructureDataSize(LOGMALLOCLIST* logmalloclist, NTREE* ntree); + +/** Return the rank of the structured data array attached to this tree node. + * + * This is a public function with the current tree node only in scope. + * + * @param ntree A pointer to a tree node. If NULL the root node is assumed. + * @return The rank of the structured data array. + */ +LIBRARY_API int getNodeStructureDataRank(LOGMALLOCLIST* logmalloclist, NTREE* ntree); + +/** Return the shape of the structured data array attached to this tree node. + * + * This is a public function with the current tree node only in scope. + * + * @param ntree A pointer to a tree node. If NULL the root node is assumed. + * @return A pointer to the integer shape array of the structured data array. + */ +LIBRARY_API int* getNodeStructureDataShape(LOGMALLOCLIST* logmalloclist, NTREE* ntree); + +/** Return a pointer to the structured data type name of the data array attached to this tree node. + * + * This is a public function with the current tree node only in scope. + * + * @param ntree A pointer to a tree node. If NULL the root node is assumed. + * @return the data type name of the structured data array. + */ +LIBRARY_API const char* getNodeStructureDataDataType(LOGMALLOCLIST* logmalloclist, NTREE* ntree); + +/** Return a pointer to the data attached to this tree node. + * + * This is a public function with the current tree node only in scope. + * + * @param ntree A pointer to a tree node. If NULL the root node is assumed. + * @return A void pointer to the data . + */ +LIBRARY_API void* getNodeStructureData(NTREE* ntree); + +//---------------------------------------------------------------------------------------------------------- +// Sundry utility functions + +/** Print the Contents of a tree node to a specified File Descriptor. The arguments for this function are + * available from the Structure Definition structure. + * + * This is a public function with the current tree node only in scope. + * + * @param fd The File Descriptor, e.g., stdout + * @param image A text block containing null terminated strings that forms an text image of the structure definition. + * @param imagecount The number of bytes in the image text block. + * @return Void + */ +LIBRARY_API void printImage(const char* image, int imagecount); + +//---------------------------------------------------------------------------------------------------------- +/**User defined structure field definition for common types + * + * This is a public function + * + * @param field The user defined structure's field to be populated + * @param name Name of the structure's field. + * @param desc Description of the fields contents + * @param offset Current field byte offset from the start of the structure. Ppdated on return. + * @param type_id Enumerated key indicating the type of data field, e.g. float array + * @return Void + */ +LIBRARY_API void defineField(COMPOUNDFIELD* field, const char* name, const char* desc, int* offset, + unsigned short type_id); + +LIBRARY_API void defineCompoundField(COMPOUNDFIELD* field, const char* type, const char* name, char* desc, int offset, + int size); #ifdef __cplusplus } #endif -#endif // UDA_STRUCTURES_STRUCT_H +#endif // UDA_STRUCTURED_H \ No newline at end of file diff --git a/source/include/uda/types.h b/source/include/uda/types.h new file mode 100644 index 00000000..5b51d131 --- /dev/null +++ b/source/include/uda/types.h @@ -0,0 +1,118 @@ +#ifndef UDA_TYPES_H +#define UDA_TYPES_H + +#ifdef __cplusplus +# include +#else +# include +#endif + +#include "include/uda/export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//#define NO_SOCKET_CONNECTION (-10000) +//#define PROBLEM_OPENING_LOGS (-11000) +//#define FILE_FORMAT_NOT_SUPPORTED (-12000) +//#define ERROR_ALLOCATING_DATA_BOCK_HEAP (-13000) +//#define SERVER_BLOCK_ERROR (-14000) +//#define SERVER_SIDE_ERROR (-14001) +//#define DATA_BLOCK_RECEIPT_ERROR (-15000) +//#define ERROR_CONDITION_UNKNOWN (-16000) +// +//#define NO_EXP_NUMBER_SPECIFIED (-18005) +// +//#define MIN_STATUS (-1) // Deny Access to Data if this Status Value +//#define DATA_STATUS_BAD (-17000) // Error Code if Status is Bad + +/** + * Data Type Codes + */ +typedef enum UdaType { + UDA_TYPE_UNKNOWN = 0, + UDA_TYPE_CHAR = 1, + UDA_TYPE_SHORT = 2, + UDA_TYPE_INT = 3, + UDA_TYPE_UNSIGNED_INT = 4, + UDA_TYPE_LONG = 5, + UDA_TYPE_FLOAT = 6, + UDA_TYPE_DOUBLE = 7, + UDA_TYPE_UNSIGNED_CHAR = 8, + UDA_TYPE_UNSIGNED_SHORT = 9, + UDA_TYPE_UNSIGNED_LONG = 10, + UDA_TYPE_LONG64 = 11, + UDA_TYPE_UNSIGNED_LONG64 = 12, + UDA_TYPE_COMPLEX = 13, + UDA_TYPE_DCOMPLEX = 14, + UDA_TYPE_UNDEFINED = 15, + UDA_TYPE_VLEN = 16, + UDA_TYPE_STRING = 17, + UDA_TYPE_COMPOUND = 18, + UDA_TYPE_OPAQUE = 19, + UDA_TYPE_ENUM = 20, + UDA_TYPE_VOID = 21, + UDA_TYPE_CAPNP = 22, + UDA_TYPE_STRING2 = 99 +} UDA_TYPE; + +/** + * Opaque Structure Types + */ +typedef enum UdaOpaqueTypes { + UDA_OPAQUE_TYPE_UNKNOWN = 0, + UDA_OPAQUE_TYPE_XML_DOCUMENT = 1, + UDA_OPAQUE_TYPE_STRUCTURES = 2, + UDA_OPAQUE_TYPE_XDRFILE = 3, + UDA_OPAQUE_TYPE_XDROBJECT = 4 +} UDA_OPAQUE_TYPE; + +LIBRARY_API size_t getSizeOf(UDA_TYPE data_type); +LIBRARY_API size_t getPtrSizeOf(UDA_TYPE data_type); + +#define SCALARDOUBLE 1 +#define ARRAYDOUBLE 2 +#define SCALARFLOAT 3 +#define ARRAYFLOAT 4 +#define SCALARLONG64 5 +#define ARRAYLONG64 6 +#define SCALARULONG64 7 +#define ARRAYULONG64 8 +#define SCALARINT 9 +#define ARRAYINT 10 +#define SCALARUINT 11 +#define ARRAYUINT 12 +#define SCALARSHORT 13 +#define ARRAYSHORT 14 +#define SCALARUSHORT 15 +#define ARRAYUSHORT 16 +#define SCALARCHAR 17 +#define ARRAYCHAR 18 +#define SCALARSTRING 19 +#define ARRAYSTRING 20 +#define ARRAYVOID 21 +#define SCALARUCHAR 22 +#define ARRAYUCHAR 23 + +typedef struct NTree NTREE; +typedef struct NTreeList NTREELIST; +typedef struct LogMallocList LOGMALLOCLIST; +typedef struct LogMalloc LOGMALLOC; +typedef struct LogStruct LOGSTRUCT; +typedef struct LogStructList LOGSTRUCTLIST; +typedef struct CompoundField COMPOUNDFIELD; +typedef struct UserDefinedType USERDEFINEDTYPE; +typedef struct UserDefinedTypeList USERDEFINEDTYPELIST; +typedef struct UdaErrorStack UDA_ERROR_STACK; +typedef struct UdaPluginInterface UDA_PLUGIN_INTERFACE; +typedef struct CompoundField COMPOUNDFIELD; +typedef struct UserDefinedType USERDEFINEDTYPE; +typedef struct PutDataBlockList PUTDATA_BLOCK_LIST; +typedef struct PutDataBlock PUTDATA_BLOCK; + +#ifdef __cplusplus +} +#endif + +#endif // UDA_TYPES_H diff --git a/source/include/uda_plugin_base.hpp b/source/include/uda/uda_plugin_base.hpp similarity index 96% rename from source/include/uda_plugin_base.hpp rename to source/include/uda/uda_plugin_base.hpp index 438189e6..6c76e321 100644 --- a/source/include/uda_plugin_base.hpp +++ b/source/include/uda/uda_plugin_base.hpp @@ -1,7 +1,7 @@ #pragma once -#ifndef UDA_UDA_PLUGIN_H -#define UDA_UDA_PLUGIN_H +#ifndef UDA_PLUGIN_BASE_HPP +#define UDA_PLUGIN_BASE_HPP #include @@ -12,7 +12,9 @@ #include #include -#include "udaPlugin.h" +#include +#include +#include class UDAPluginBase; @@ -141,4 +143,4 @@ class UDAPluginBase { std::unordered_map function_map_; }; -#endif //UDA_UDA_PLUGIN_H +#endif // UDA_PLUGIN_BASE_HPP diff --git a/source/include/udaGetAPI.h b/source/include/udaGetAPI.h deleted file mode 100644 index 1b8be7c0..00000000 --- a/source/include/udaGetAPI.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef UDA_CLIENT_UDAGETAPI_H -#define UDA_CLIENT_UDAGETAPI_H - -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef FATCLIENT -# define idamGetAPI idamGetAPIFat -# define idamGetBatchAPI idamGetBatchAPIFat -# define idamGetAPIWithHost idamGetAPIWithHostFat -# define idamGetBatchAPIWithHost idamGetBatchAPIWithHostFat -#endif - -LIBRARY_API int idamGetAPI(const char* data_object, const char* data_source); -LIBRARY_API int idamGetBatchAPI(const char** uda_signals, const char** sources, int count, int* handles); -LIBRARY_API int idamGetAPIWithHost(const char* data_object, const char* data_source, const char* host, int port); -LIBRARY_API int idamGetBatchAPIWithHost(const char** uda_signals, const char** sources, int count, int* handles, - const char* host, int port); - -#ifdef __cplusplus -} -#endif - -#endif // UDA_CLIENT_UDAGETAPI_H diff --git a/source/include/udaPutAPI.h b/source/include/udaPutAPI.h deleted file mode 100644 index 3500ad57..00000000 --- a/source/include/udaPutAPI.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef UDA_CLIENT_UDAPUTAPI_H -#define UDA_CLIENT_UDAPUTAPI_H - -#include "export.h" - -typedef struct PutDataBlockList PUTDATA_BLOCK_LIST; -typedef struct PutDataBlock PUTDATA_BLOCK; - -#ifdef FATCLIENT -# define idamPutListAPI idamPutListAPIFat -# define idamPutAPI idamPutAPIFat -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int idamPutListAPI(const char* putInstruction, PUTDATA_BLOCK_LIST* inPutDataBlockList); -LIBRARY_API int idamPutAPI(const char* putInstruction, PUTDATA_BLOCK* inPutData); - -#ifdef __cplusplus -} -#endif - -#endif // UDA_CLIENT_UDAPUTAPI_H diff --git a/source/include/udaTypes.h b/source/include/udaTypes.h deleted file mode 100644 index d734604a..00000000 --- a/source/include/udaTypes.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef UDA_CLIENTSERVER_UDATYPES_H -#define UDA_CLIENTSERVER_UDATYPES_H - -#ifdef __cplusplus -# include -#else -# include -#endif - -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Data Type Codes - */ -typedef enum UdaType { - UDA_TYPE_UNKNOWN = 0, - UDA_TYPE_CHAR = 1, - UDA_TYPE_SHORT = 2, - UDA_TYPE_INT = 3, - UDA_TYPE_UNSIGNED_INT = 4, - UDA_TYPE_LONG = 5, - UDA_TYPE_FLOAT = 6, - UDA_TYPE_DOUBLE = 7, - UDA_TYPE_UNSIGNED_CHAR = 8, - UDA_TYPE_UNSIGNED_SHORT = 9, - UDA_TYPE_UNSIGNED_LONG = 10, - UDA_TYPE_LONG64 = 11, - UDA_TYPE_UNSIGNED_LONG64 = 12, - UDA_TYPE_COMPLEX = 13, - UDA_TYPE_DCOMPLEX = 14, - UDA_TYPE_UNDEFINED = 15, - UDA_TYPE_VLEN = 16, - UDA_TYPE_STRING = 17, - UDA_TYPE_COMPOUND = 18, - UDA_TYPE_OPAQUE = 19, - UDA_TYPE_ENUM = 20, - UDA_TYPE_VOID = 21, - UDA_TYPE_CAPNP = 22, - UDA_TYPE_STRING2 = 99 -} UDA_TYPE; - -/** - * Opaque Structure Types - */ -typedef enum UdaOpaqueTypes { - UDA_OPAQUE_TYPE_UNKNOWN = 0, - UDA_OPAQUE_TYPE_XML_DOCUMENT = 1, - UDA_OPAQUE_TYPE_STRUCTURES = 2, - UDA_OPAQUE_TYPE_XDRFILE = 3, - UDA_OPAQUE_TYPE_XDROBJECT = 4 -} UDA_OPAQUE_TYPE; - -LIBRARY_API size_t getSizeOf(UDA_TYPE data_type); -LIBRARY_API size_t getPtrSizeOf(UDA_TYPE data_type); - -#ifdef __cplusplus -} -#endif - -#endif // UDA_CLIENTSERVER_UDATYPES_H diff --git a/source/logging/accessLog.cpp b/source/logging/accessLog.cpp index 010c5b89..03ea819d 100644 --- a/source/logging/accessLog.cpp +++ b/source/logging/accessLog.cpp @@ -23,8 +23,8 @@ #include "clientserver/errorLog.h" #include "logging.h" -#include "udaTypes.h" -#include +#include +#include "clientserver/stringUtils.h" #if defined(SERVERBUILD) || defined(FATCLIENT) # include diff --git a/source/logging/accessLog.h b/source/logging/accessLog.h index 62105ac1..31222fcc 100644 --- a/source/logging/accessLog.h +++ b/source/logging/accessLog.h @@ -1,8 +1,7 @@ #ifndef UDA_LOGGING_ACCESSLOG_H #define UDA_LOGGING_ACCESSLOG_H -#include "export.h" -#include "udaPlugin.h" +#include "clientserver/udaStructs.h" #define HOSTNAMELENGTH 20 #define DATELENGTH 27 @@ -11,10 +10,10 @@ extern "C" { #endif -LIBRARY_API unsigned int countDataBlockListSize(const DATA_BLOCK_LIST* data_block_list, CLIENT_BLOCK* client_block); -LIBRARY_API unsigned int countDataBlockSize(const DATA_BLOCK* data_block, CLIENT_BLOCK* client_block); +unsigned int countDataBlockListSize(const DATA_BLOCK_LIST* data_block_list, CLIENT_BLOCK* client_block); +unsigned int countDataBlockSize(const DATA_BLOCK* data_block, CLIENT_BLOCK* client_block); -LIBRARY_API void udaAccessLog(int init, CLIENT_BLOCK client_block, REQUEST_BLOCK request_block, +void udaAccessLog(int init, CLIENT_BLOCK client_block, REQUEST_BLOCK request_block, SERVER_BLOCK server_block, unsigned int total_datablock_size); #ifdef __cplusplus diff --git a/source/logging/logging.h b/source/logging/logging.h index 78598830..bc50d4c2 100644 --- a/source/logging/logging.h +++ b/source/logging/logging.h @@ -1,7 +1,6 @@ #ifndef UDA_LOGGING_IDAMLOG_H #define UDA_LOGGING_IDAMLOG_H -#include "export.h" #include #include @@ -49,12 +48,12 @@ typedef enum LogLevel { typedef void (*logFunc)(FILE*); -LIBRARY_API void udaSetLogLevel(LOG_LEVEL level); -LIBRARY_API LOG_LEVEL udaGetLogLevel(); -LIBRARY_API void udaCloseLogging(); -LIBRARY_API void udaSetLogFile(LOG_LEVEL mode, FILE* file); -LIBRARY_API void udaLogWithFunc(LOG_LEVEL mode, logFunc func); -LIBRARY_API void udaLog(LOG_LEVEL mode, const char* fmt, ...); +void udaSetLogLevel(LOG_LEVEL level); +LOG_LEVEL udaGetLogLevel(); +void udaCloseLogging(); +void udaSetLogFile(LOG_LEVEL mode, FILE* file); +void udaLogWithFunc(LOG_LEVEL mode, logFunc func); +void udaLog(LOG_LEVEL mode, const char* fmt, ...); #ifdef __cplusplus } diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 9687f497..b96acac4 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -1,10 +1,10 @@ #include "bytesPlugin.h" #include "logging/logging.h" -#include -#include -#include -#include "include/uda_plugin_base.hpp" +#include "clientserver/errorLog.h" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/stringUtils.h" +#include "include/uda/uda_plugin_base.hpp" #include diff --git a/source/plugins/bytes/bytesPlugin.h b/source/plugins/bytes/bytesPlugin.h index 44a8bf08..70566cd8 100644 --- a/source/plugins/bytes/bytesPlugin.h +++ b/source/plugins/bytes/bytesPlugin.h @@ -1,8 +1,7 @@ #ifndef UDA_PLUGIN_BYTESPLUGIN_H #define UDA_PLUGIN_BYTESPLUGIN_H -#include "export.h" -#include "udaPlugin.h" +#include #ifdef __cplusplus extern "C" { @@ -12,7 +11,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* plugin_interface); +int bytesPlugin(UDA_PLUGIN_INTERFACE* plugin_interface); #ifdef __cplusplus } diff --git a/source/plugins/bytes/md5Sum.h b/source/plugins/bytes/md5Sum.h index d92755b2..2e10c5f3 100755 --- a/source/plugins/bytes/md5Sum.h +++ b/source/plugins/bytes/md5Sum.h @@ -1,13 +1,11 @@ #ifndef UDA_CLIENTSERVER_MD5SUM_H #define UDA_CLIENTSERVER_MD5SUM_H -#include "export.h" - #ifdef __cplusplus extern "C" { #endif -LIBRARY_API void md5Sum(char* bp, int size, char* md5check); +void md5Sum(char* bp, int size, char* md5check); #ifdef __cplusplus } diff --git a/source/plugins/bytes/readBytesNonOptimally.cpp b/source/plugins/bytes/readBytesNonOptimally.cpp index 239ce9e8..8adc823d 100644 --- a/source/plugins/bytes/readBytesNonOptimally.cpp +++ b/source/plugins/bytes/readBytesNonOptimally.cpp @@ -50,41 +50,60 @@ int is_legal_file_path(const char *str) { } } -std::string hash_sum(char* bp, int size) +EVP_MD_CTX* new_hash_context() { EVP_MD_CTX* context = EVP_MD_CTX_new(); std::string hash_string; - if (context != nullptr) { - if (EVP_DigestInit_ex(context, EVP_sha256(), nullptr)) { - if (EVP_DigestUpdate(context, bp, size)) { - unsigned char hash[EVP_MAX_MD_SIZE]; - unsigned int length = 0; - - if (EVP_DigestFinal_ex(context, hash, &length)) { - std::stringstream ss; - ss << std::hex << std::setw(2) << std::setfill('0'); - for (unsigned int i = 0; i < length; ++i) { - ss << (int) hash[i]; - } - hash_string = ss.str(); - } - } - } + if (context != nullptr && EVP_DigestInit_ex(context, EVP_sha256(), nullptr)) { + return context; + } + + return nullptr; +} + +void update_hash(EVP_MD_CTX* context, const char* data, size_t size) +{ + EVP_DigestUpdate(context, data, size); +} + +std::string get_hash_sum(EVP_MD_CTX* context) +{ + std::string hash_string; + + unsigned char hash[EVP_MAX_MD_SIZE]; + unsigned int length = 0; - EVP_MD_CTX_free(context); + if (EVP_DigestFinal_ex(context, hash, &length)) { + std::stringstream ss; + ss << std::hex << std::setw(2) << std::setfill('0'); + for (unsigned int i = 0; i < length; ++i) { + ss << (int) hash[i]; + } + hash_string = ss.str(); } + EVP_MD_CTX_free(context); return hash_string; } +std::string exec(const char* cmd) { + std::array buffer; + std::string result; + std::unique_ptr pipe(popen(cmd, "r"), pclose); + if (!pipe) { + throw std::runtime_error("popen() failed!"); + } + while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) { + result.append(buffer.data()); + } + return result; +} + int readBytes(const std::string& path, UDA_PLUGIN_INTERFACE* plugin_interface) { int err; - char md5file[2 * MD5_SIZE + 1] = ""; - char md5check[2 * MD5_SIZE + 1] = ""; - //---------------------------------------------------------------------- // Block Access to External Users @@ -161,14 +180,20 @@ int readBytes(const std::string& path, UDA_PLUGIN_INTERFACE* plugin_interface) return err; } - auto sum = hash_sum(bp, nchar); + auto ctx = new_hash_context(); + update_hash(ctx, bp, nchar); + auto read_hash = get_hash_sum(ctx); int shape[] = { (int)nchar }; - setReturnData(plugin_interface, bp, nchar, UDA_TYPE_CHAR, 1, shape, sum.c_str()); + setReturnData(plugin_interface, bp, nchar, UDA_TYPE_CHAR, 1, shape, read_hash.c_str()); + + // TODO: read sha256 sum command from config and try and run +// std::string cmd = "sha3sum -a 256 -b " + path; +// auto file_hash = exec(cmd.c_str()); udaPluginLog(plugin_interface, "File Size : %d \n", nchar); - udaPluginLog(plugin_interface, "File Checksum : %s \n", md5file); - udaPluginLog(plugin_interface, "Read Checksum : %s \n", md5check); +// udaPluginLog(plugin_interface, "File Checksum : %s \n", file_hash.c_str()); + udaPluginLog(plugin_interface, "Read Checksum : %s \n", read_hash.c_str()); return err; } diff --git a/source/plugins/bytes/readBytesNonOptimally.h b/source/plugins/bytes/readBytesNonOptimally.h index 3cf8260f..9b3c92f2 100644 --- a/source/plugins/bytes/readBytesNonOptimally.h +++ b/source/plugins/bytes/readBytesNonOptimally.h @@ -1,7 +1,7 @@ #ifndef UDA_PLUGIN_READBYTESNONOPTIMALLY_H #define UDA_PLUGIN_READBYTESNONOPTIMALLY_H -#include "udaPlugin.h" +#include #include diff --git a/source/plugins/hdf5/hdf5plugin.cpp b/source/plugins/hdf5/hdf5plugin.cpp index be2d4f50..b60c26e3 100644 --- a/source/plugins/hdf5/hdf5plugin.cpp +++ b/source/plugins/hdf5/hdf5plugin.cpp @@ -1,6 +1,6 @@ #include "hdf5plugin.h" -#include "include/uda_plugin_base.hpp" +#include "include/uda/uda_plugin_base.hpp" #include "readHDF58.h" diff --git a/source/plugins/hdf5/hdf5plugin.h b/source/plugins/hdf5/hdf5plugin.h index eee303ae..68d25e09 100644 --- a/source/plugins/hdf5/hdf5plugin.h +++ b/source/plugins/hdf5/hdf5plugin.h @@ -7,9 +7,7 @@ # include #endif -#include "export.h" -#include "udaPlugin.h" -#include +#include #ifdef __cplusplus extern "C" { @@ -19,9 +17,7 @@ extern "C" { #define THISPLUGIN_MAX_INTERFACE_VERSION 1 #define THISPLUGIN_DEFAULT_METHOD "get" -extern UDA_PLUGIN_FILE_LIST pluginFileList; - -LIBRARY_API int hdf5Plugin(UDA_PLUGIN_INTERFACE* plugin_interface); +int hdf5Plugin(UDA_PLUGIN_INTERFACE* plugin_interface); #ifdef __cplusplus } diff --git a/source/plugins/hdf5/readHDF58.cpp b/source/plugins/hdf5/readHDF58.cpp index 21e01451..d39bdd02 100644 --- a/source/plugins/hdf5/readHDF58.cpp +++ b/source/plugins/hdf5/readHDF58.cpp @@ -25,8 +25,8 @@ # include #endif -#include "udaErrors.h" -#include +#include "clientserver/udaErrors.h" +#include "clientserver/errorLog.h" #ifdef NOHDF5PLUGIN @@ -45,10 +45,10 @@ void H5Fclose(int fh) #else # include "clientserver/initStructs.h" -# include "udaTypes.h" +# include # include # include -# include +# include "clientserver/stringUtils.h" # include # include diff --git a/source/plugins/hdf5/readHDF58.h b/source/plugins/hdf5/readHDF58.h index 302081e9..2aabcc9b 100644 --- a/source/plugins/hdf5/readHDF58.h +++ b/source/plugins/hdf5/readHDF58.h @@ -1,18 +1,17 @@ #ifndef UDA_PLUGIN_READHDF58_H #define UDA_PLUGIN_READHDF58_H -#include "export.h" #include "clientserver/udaStructs.h" #ifdef __cplusplus extern "C" { #endif -LIBRARY_API int readHDF5(DATA_SOURCE data_source, SIGNAL_DESC signal_desc, DATA_BLOCK* data_block); +int readHDF5(DATA_SOURCE data_source, SIGNAL_DESC signal_desc, DATA_BLOCK* data_block); #ifdef NOHDF5PLUGIN -LIBRARY_API void H5Fclose(int fh); +void H5Fclose(int fh); #else @@ -29,8 +28,8 @@ LIBRARY_API void H5Fclose(int fh); # define HDF5_ERROR_UNKNOWN_TYPE 208 # define HDF5_ERROR_OPENING_DATASET 209 -LIBRARY_API int readHDF5IdamType(H5T_class_t classtype, int precision, int issigned); -LIBRARY_API int readHDF5Att(hid_t file_id, char* object, hid_t att_id, char* attname, DATA_BLOCK* data_block); +int readHDF5IdamType(H5T_class_t classtype, int precision, int issigned); +int readHDF5Att(hid_t file_id, char* object, hid_t att_id, char* attname, DATA_BLOCK* data_block); #endif diff --git a/source/plugins/help/help_plugin.cpp b/source/plugins/help/help_plugin.cpp index 8d5f6a5b..9658d557 100644 --- a/source/plugins/help/help_plugin.cpp +++ b/source/plugins/help/help_plugin.cpp @@ -2,8 +2,9 @@ #include #include - -#include "uda_plugin_base.hpp" +#include +#include +#include class HelpPlugin : public UDAPluginBase { diff --git a/source/plugins/help/help_plugin.h b/source/plugins/help/help_plugin.h index 2c07f369..8fa07da8 100644 --- a/source/plugins/help/help_plugin.h +++ b/source/plugins/help/help_plugin.h @@ -1,8 +1,7 @@ #ifndef UDA_PLUGIN_IDAMSERVERHELP_H #define UDA_PLUGIN_IDAMSERVERHELP_H -#include "export.h" -#include "udaPlugin.h" +#include #ifdef __cplusplus extern "C" { @@ -12,7 +11,7 @@ extern "C" { #define THISPLUGIN_MAX_INTERFACE_VERSION 1 #define THISPLUGIN_DEFAULT_METHOD "help" -LIBRARY_API int helpPlugin(UDA_PLUGIN_INTERFACE* plugin_interface); +int helpPlugin(UDA_PLUGIN_INTERFACE* plugin_interface); #ifdef __cplusplus } diff --git a/source/plugins/keyvalue/keyvaluePlugin.cpp b/source/plugins/keyvalue/keyvaluePlugin.cpp index e74d2523..a53cdbf6 100644 --- a/source/plugins/keyvalue/keyvaluePlugin.cpp +++ b/source/plugins/keyvalue/keyvaluePlugin.cpp @@ -3,12 +3,11 @@ #include #include -#include "include/uda_plugin_base.hpp" +#include "include/uda/uda_plugin_base.hpp" #include "clientserver/initStructs.h" -#include "udaPlugin.h" -#include "udaTypes.h" -#include +#include +#include "clientserver/stringUtils.h" namespace uda { diff --git a/source/plugins/keyvalue/keyvaluePlugin.h b/source/plugins/keyvalue/keyvaluePlugin.h index a1a3e8e6..db8ef0c8 100644 --- a/source/plugins/keyvalue/keyvaluePlugin.h +++ b/source/plugins/keyvalue/keyvaluePlugin.h @@ -1,8 +1,7 @@ #ifndef UDA_PLUGIN_KEYVALUEPLUGIN_H #define UDA_PLUGIN_KEYVALUEPLUGIN_H -#include "export.h" -#include "udaPlugin.h" +#include #ifdef __cplusplus extern "C" { @@ -12,7 +11,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* plugin_interface); +int keyValue(UDA_PLUGIN_INTERFACE* plugin_interface); #ifdef __cplusplus } diff --git a/source/plugins/managePluginFiles.cpp b/source/plugins/managePluginFiles.cpp index 33d09f49..d61bc1dc 100644 --- a/source/plugins/managePluginFiles.cpp +++ b/source/plugins/managePluginFiles.cpp @@ -9,8 +9,8 @@ # include #endif -#include -#include +#include "clientserver/stringUtils.h" +#include "logging/logging.h" #define UDA_PLUGIN_FILE_ALLOC 10 #define MAX_OPEN_PLUGIN_FILE_DESC 50 diff --git a/source/plugins/managePluginFiles.h b/source/plugins/managePluginFiles.h index 4b9208b1..6040a409 100644 --- a/source/plugins/managePluginFiles.h +++ b/source/plugins/managePluginFiles.h @@ -1,26 +1,25 @@ #ifndef UDA_PLUGINS_MANAGEPLUGINFILES_H #define UDA_PLUGINS_MANAGEPLUGINFILES_H -#include "export.h" #include #ifdef __cplusplus extern "C" { #endif -LIBRARY_API void initIdamPluginFileList(UDA_PLUGIN_FILE_LIST* idamfiles); -LIBRARY_API void registerIdamPluginFileClose(UDA_PLUGIN_FILE_LIST* idamfiles, void* fptr); -LIBRARY_API int addIdamPluginFilePtr(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename, void* handle); -LIBRARY_API int addIdamPluginFileLong(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename, long handle); -LIBRARY_API void* getOpenIdamPluginFilePtr(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename); -LIBRARY_API long getOpenIdamPluginFileLong(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename); -LIBRARY_API int getClosedIdamPluginFile(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename); -LIBRARY_API void closeIdamPluginFile(UDA_PLUGIN_FILE_LIST* idamfiles, const char* filename); -LIBRARY_API void closeIdamPluginFiles(UDA_PLUGIN_FILE_LIST* uda_files); -LIBRARY_API void purgeStalestIdamPluginFile(UDA_PLUGIN_FILE_LIST* uda_files); -LIBRARY_API int findIdamPluginFileByName(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename); -LIBRARY_API int findIdamPluginFileByLong(UDA_PLUGIN_FILE_LIST* uda_files, long handle); -LIBRARY_API void setIdamPluginFileClosed(UDA_PLUGIN_FILE_LIST* uda_files, int record); +void initIdamPluginFileList(UDA_PLUGIN_FILE_LIST* idamfiles); +void registerIdamPluginFileClose(UDA_PLUGIN_FILE_LIST* idamfiles, void* fptr); +int addIdamPluginFilePtr(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename, void* handle); +int addIdamPluginFileLong(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename, long handle); +void* getOpenIdamPluginFilePtr(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename); +long getOpenIdamPluginFileLong(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename); +int getClosedIdamPluginFile(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename); +void closeIdamPluginFile(UDA_PLUGIN_FILE_LIST* idamfiles, const char* filename); +void closeIdamPluginFiles(UDA_PLUGIN_FILE_LIST* uda_files); +void purgeStalestIdamPluginFile(UDA_PLUGIN_FILE_LIST* uda_files); +int findIdamPluginFileByName(UDA_PLUGIN_FILE_LIST* uda_files, const char* filename); +int findIdamPluginFileByLong(UDA_PLUGIN_FILE_LIST* uda_files, long handle); +void setIdamPluginFileClosed(UDA_PLUGIN_FILE_LIST* uda_files, int record); #ifdef __cplusplus } diff --git a/source/plugins/pluginStructs.h b/source/plugins/pluginStructs.h deleted file mode 100644 index 7467e188..00000000 --- a/source/plugins/pluginStructs.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef UDA_PLUGINS_PLUGINSTRUCTS_H -#define UDA_PLUGINS_PLUGINSTRUCTS_H - -#include - -#include "export.h" -#include "genStructs.h" - -#include "clientserver/udaStructs.h" - -#ifdef __cplusplus -extern "C" { -#endif - - - -#ifdef __cplusplus -} -#endif - -#endif // UDA_PLUGINS_PLUGINSTRUCTS_H diff --git a/source/plugins/template/templatePlugin.cpp b/source/plugins/template/templatePlugin.cpp index 1016b4fc..ef72afa5 100644 --- a/source/plugins/template/templatePlugin.cpp +++ b/source/plugins/template/templatePlugin.cpp @@ -21,8 +21,8 @@ #include "templatePlugin.h" #include "clientserver/initStructs.h" -#include -#include "include/uda_plugin_base.hpp" +#include "clientserver/stringUtils.h" +#include "include/uda/uda_plugin_base.hpp" #include diff --git a/source/plugins/template/templatePlugin.h b/source/plugins/template/templatePlugin.h index 83ff23b5..0813ac22 100644 --- a/source/plugins/template/templatePlugin.h +++ b/source/plugins/template/templatePlugin.h @@ -1,8 +1,7 @@ #ifndef UDA_PLUGIN_TEMPLATEPLUGIN_H #define UDA_PLUGIN_TEMPLATEPLUGIN_H -#include "export.h" -#include "udaPlugin.h" +#include #ifdef __cplusplus extern "C" { @@ -12,7 +11,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* plugin_interface); +int templatePlugin(UDA_PLUGIN_INTERFACE* plugin_interface); #ifdef __cplusplus } diff --git a/source/plugins/testplugin/testplugin.cpp b/source/plugins/testplugin/testplugin.cpp index 2060ee7e..a480713b 100644 --- a/source/plugins/testplugin/testplugin.cpp +++ b/source/plugins/testplugin/testplugin.cpp @@ -4,13 +4,11 @@ #include #include -#include "accessors.h" #include "clientserver/initStructs.h" -#include "struct.h" -#include -#include -#include -#include "include/uda_plugin_base.hpp" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/printStructs.h" +#include "clientserver/stringUtils.h" +#include "include/uda/uda_plugin_base.hpp" #include #include diff --git a/source/plugins/testplugin/testplugin.h b/source/plugins/testplugin/testplugin.h index 7c818c27..318ca553 100644 --- a/source/plugins/testplugin/testplugin.h +++ b/source/plugins/testplugin/testplugin.h @@ -1,8 +1,7 @@ #ifndef UDA_PLUGIN_TESTPLUGIN_TESTPLUGIN_H #define UDA_PLUGIN_TESTPLUGIN_TESTPLUGIN_H -#include "export.h" -#include "udaPlugin.h" +#include #ifdef __cplusplus extern "C" { diff --git a/source/plugins/testplugin/teststructs.cpp b/source/plugins/testplugin/teststructs.cpp index 68f7e506..965129b7 100644 --- a/source/plugins/testplugin/teststructs.cpp +++ b/source/plugins/testplugin/teststructs.cpp @@ -1,7 +1,6 @@ #include "teststructs.h" -#include "struct.h" -#include +#include "logging/logging.h" void init_structure_definitions(UDA_PLUGIN_INTERFACE* plugin_interface) { diff --git a/source/plugins/uda/uda_plugin.cpp b/source/plugins/uda/uda_plugin.cpp index 9d6044cd..94554e25 100644 --- a/source/plugins/uda/uda_plugin.cpp +++ b/source/plugins/uda/uda_plugin.cpp @@ -2,15 +2,13 @@ #include -#include "accAPI.h" #include "clientserver/initStructs.h" -#include "udaGetAPI.h" -#include "udaPlugin.h" -#include -#include -#include -#include "include/uda_plugin_base.hpp" +#include "client/udaClient.h" +#include "clientserver/stringUtils.h" +#include "logging/logging.h" +#include "include/uda/uda_plugin_base.hpp" #include "server/serverPlugin.h" +#include "uda/client.h" #include #include diff --git a/source/plugins/uda/uda_plugin.h b/source/plugins/uda/uda_plugin.h index c0dfd368..6d75539b 100644 --- a/source/plugins/uda/uda_plugin.h +++ b/source/plugins/uda/uda_plugin.h @@ -1,8 +1,7 @@ #ifndef UDA_PLUGIN_UDA_PLUGIN_H #define UDA_PLUGIN_UDA_PLUGIN_H -#include "export.h" -#include "udaPlugin.h" +#include #ifdef __cplusplus extern "C" { diff --git a/source/plugins/udaPlugin.cpp b/source/plugins/udaPlugin.cpp index 6f855606..a6b6f726 100644 --- a/source/plugins/udaPlugin.cpp +++ b/source/plugins/udaPlugin.cpp @@ -1,18 +1,17 @@ -#include "udaPlugin.h" +#include "uda/plugins.h" #include "server/initPluginList.h" #include "server/serverPlugin.h" #include "server/serverSubsetData.h" -#include "struct.h" #include "clientserver/initStructs.h" #include "logging/logging.h" -#include "udaTypes.h" -#include "accessors.h" -#include -#include -#include -#include +#include +#include "clientserver/errorLog.h" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/stringUtils.h" +#include "server/getServerEnvironment.h" +#include "uda/structured.h" UDA_PLUGIN_INTERFACE* udaCreatePluginInterface(const char* request) { diff --git a/source/plugins/udaPluginFiles.h b/source/plugins/udaPluginFiles.h index 7832f984..ff1331e2 100644 --- a/source/plugins/udaPluginFiles.h +++ b/source/plugins/udaPluginFiles.h @@ -8,8 +8,7 @@ # include #endif -#include "export.h" -#include "udaDefines.h" +#include "clientserver/udaDefines.h" #ifdef __cplusplus extern "C" { diff --git a/source/plugins/uda_plugin_base.cpp b/source/plugins/uda_plugin_base.cpp index 72be65f1..c1ba20ca 100644 --- a/source/plugins/uda_plugin_base.cpp +++ b/source/plugins/uda_plugin_base.cpp @@ -1,6 +1,5 @@ -#include "uda_plugin_base.hpp" +#include "include/uda/uda_plugin_base.hpp" #include "clientserver/stringUtils.h" -#include "udaPlugin.h" #include #include diff --git a/source/plugins/viewport/viewport.cpp b/source/plugins/viewport/viewport.cpp index 12e5e6ee..8d73e7d5 100644 --- a/source/plugins/viewport/viewport.cpp +++ b/source/plugins/viewport/viewport.cpp @@ -18,11 +18,10 @@ # include #endif -#include "accAPI.h" #include "clientserver/initStructs.h" -#include "udaGetAPI.h" -#include -#include "include/uda_plugin_base.hpp" +#include "clientserver/stringUtils.h" +#include "include/uda/uda_plugin_base.hpp" +#include "uda/client.h" #include #include diff --git a/source/plugins/viewport/viewport.h b/source/plugins/viewport/viewport.h index 9c4e1507..31c1793f 100644 --- a/source/plugins/viewport/viewport.h +++ b/source/plugins/viewport/viewport.h @@ -1,8 +1,7 @@ #ifndef IDAM_PLUGINS_VIEWPORT_VIEWPORT_H #define IDAM_PLUGINS_VIEWPORT_VIEWPORT_H -#include "export.h" -#include "udaPlugin.h" +#include #ifdef __cplusplus extern "C" { diff --git a/source/security/authenticationUtils.cpp b/source/security/authenticationUtils.cpp index 896c2c49..9638d3e7 100644 --- a/source/security/authenticationUtils.cpp +++ b/source/security/authenticationUtils.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include "clientserver/errorLog.h" int testFilePermissions(const char* object) { diff --git a/source/security/authenticationUtils.h b/source/security/authenticationUtils.h index 3015b9e4..c2258b94 100644 --- a/source/security/authenticationUtils.h +++ b/source/security/authenticationUtils.h @@ -1,19 +1,10 @@ #ifndef UDA_SECURITY_AUTHENTICATIONUTILS_H #define UDA_SECURITY_AUTHENTICATIONUTILS_H -#include "export.h" #include "clientserver/udaStructs.h" -#ifdef __cplusplus -extern "C" { -#endif +int testFilePermissions(const char* object); -LIBRARY_API int testFilePermissions(const char* object); - -LIBRARY_API void initSecurityBlock(SECURITY_BLOCK* str); - -#ifdef __cplusplus -} -#endif +void initSecurityBlock(SECURITY_BLOCK* str); #endif // UDA_SECURITY_AUTHENTICATIONUTILS_H diff --git a/source/security/clientAuthentication.cpp b/source/security/clientAuthentication.cpp index 3acab35e..2915ad80 100644 --- a/source/security/clientAuthentication.cpp +++ b/source/security/clientAuthentication.cpp @@ -1,13 +1,13 @@ #include "clientAuthentication.h" -#include -#include -#include -#include +#include "clientserver/errorLog.h" +#include "clientserver/printStructs.h" +#include "clientserver/protocol.h" +#include "logging/logging.h" #ifndef TESTIDAMSECURITY # include "include/client.h" -# include "include/udaErrors.h" -# include +# include "clientserver/udaErrors.h" +# include "clientserver/xdrlib.h" #endif #include "authenticationUtils.h" diff --git a/source/security/clientAuthentication.h b/source/security/clientAuthentication.h index 0a70717b..39dbfc84 100644 --- a/source/security/clientAuthentication.h +++ b/source/security/clientAuthentication.h @@ -1,22 +1,13 @@ #ifndef UDA_SECURITY_CLIENTAUTHENTICATION_H #define UDA_SECURITY_CLIENTAUTHENTICATION_H -#include "export.h" -#include "genStructs.h" +#include "structures/genStructs.h" #include "clientserver/udaStructs.h" #include "security.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int clientAuthentication(CLIENT_BLOCK* client_block, SERVER_BLOCK* server_block, +int clientAuthentication(CLIENT_BLOCK* client_block, SERVER_BLOCK* server_block, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, AUTHENTICATION_STEP authenticationStep); -#ifdef __cplusplus -} -#endif - #endif // UDA_SECURITY_CLIENTAUTHENTICATION_H diff --git a/source/security/security.cpp b/source/security/security.cpp index d13dd28d..0156070a 100644 --- a/source/security/security.cpp +++ b/source/security/security.cpp @@ -86,9 +86,9 @@ #include -#include "udaTypes.h" -#include -#include +#include +#include "clientserver/errorLog.h" +#include "logging/logging.h" #include static void logToken(const char* msg, const gcry_mpi_t mpi_token) diff --git a/source/security/security.h b/source/security/security.h index 496f2a29..a2aca891 100644 --- a/source/security/security.h +++ b/source/security/security.h @@ -1,13 +1,8 @@ #ifndef UDA_SECURITY_SECURITY_H #define UDA_SECURITY_SECURITY_H -#include "export.h" #include -#ifdef __cplusplus -extern "C" { -#endif - #define UDA_SECURITY_VERSION 7 // Limits @@ -42,14 +37,10 @@ typedef enum AuthenticationStep { HOUSEKEEPING = 9, } AUTHENTICATION_STEP; -LIBRARY_API int udaAuthentication(AUTHENTICATION_STEP authenticationStep, ENCRYPTION_METHOD encryptionMethod, +int udaAuthentication(AUTHENTICATION_STEP authenticationStep, ENCRYPTION_METHOD encryptionMethod, TOKEN_TYPE tokenType, unsigned short tokenByteLength, gcry_sexp_t publickey, gcry_sexp_t privatekey, gcry_mpi_t* client_mpiToken, gcry_mpi_t* server_mpiToken, unsigned char** client_ciphertext, size_t* client_ciphertextLength, unsigned char** server_ciphertext, size_t* server_ciphertextLength); -#ifdef __cplusplus -} -#endif - #endif // UDA_SECURITY_SECURITY_H diff --git a/source/security/serverAuthentication.cpp b/source/security/serverAuthentication.cpp index 375746cf..b3fd9076 100644 --- a/source/security/serverAuthentication.cpp +++ b/source/security/serverAuthentication.cpp @@ -2,14 +2,14 @@ # include "serverAuthentication.h" -# include -# include -# include +# include "clientserver/errorLog.h" +# include "logging/logging.h" +# include "server/udaServer.h" # ifndef TESTIDAMSECURITY -# include -# include -# include -# include +# include "clientserver/printStructs.h" +# include "clientserver/protocol.h" +# include "clientserver/udaErrors.h" +# include "clientserver/xdrlib.h" # endif # include "authenticationUtils.h" diff --git a/source/security/serverAuthentication.h b/source/security/serverAuthentication.h index 2264fbcb..ef0a05ba 100644 --- a/source/security/serverAuthentication.h +++ b/source/security/serverAuthentication.h @@ -1,22 +1,13 @@ #ifndef UDA_SECURITY_SERVERAUTHENTICATION_H #define UDA_SECURITY_SERVERAUTHENTICATION_H -#include "export.h" -#include "genStructs.h" +#include "structures/genStructs.h" #include "clientserver/udaStructs.h" #include "security.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int serverAuthentication(CLIENT_BLOCK* client_block, SERVER_BLOCK* server_block, +int serverAuthentication(CLIENT_BLOCK* client_block, SERVER_BLOCK* server_block, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, AUTHENTICATION_STEP authenticationStep); -#ifdef __cplusplus -} -#endif - #endif // UDA_SECURITY_SERVERAUTHENTICATION_H diff --git a/source/security/x509Utils.cpp b/source/security/x509Utils.cpp index 08c4893f..e6a89c5d 100644 --- a/source/security/x509Utils.cpp +++ b/source/security/x509Utils.cpp @@ -2,8 +2,8 @@ #include -#include -#include +#include "clientserver/errorLog.h" +#include "clientserver/stringUtils.h" #include "security.h" diff --git a/source/security/x509Utils.h b/source/security/x509Utils.h index c02fb3ac..3ad07a48 100644 --- a/source/security/x509Utils.h +++ b/source/security/x509Utils.h @@ -4,23 +4,13 @@ #include #include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int makeX509CertObject(unsigned char* doc, unsigned short docLength, ksba_cert_t* cert); -LIBRARY_API int testX509Dates(ksba_cert_t certificate); -LIBRARY_API int extractX509SExpKey(ksba_cert_t cert, gcry_sexp_t* key_sexp); -LIBRARY_API int importPEMPrivateKey(const char* keyFile, gcry_sexp_t* key_sexp); -LIBRARY_API int importX509Reader(const char* fileName, ksba_cert_t* cert); -LIBRARY_API int checkX509Signature(ksba_cert_t issuer_cert, ksba_cert_t cert); -LIBRARY_API int importSecurityDoc(const char* file, unsigned char** contents, unsigned short* length); -LIBRARY_API int importPEMPublicKey(char* keyFile, gcry_sexp_t* key_sexp); - -#ifdef __cplusplus -} -#endif +int makeX509CertObject(unsigned char* doc, unsigned short docLength, ksba_cert_t* cert); +int testX509Dates(ksba_cert_t certificate); +int extractX509SExpKey(ksba_cert_t cert, gcry_sexp_t* key_sexp); +int importPEMPrivateKey(const char* keyFile, gcry_sexp_t* key_sexp); +int importX509Reader(const char* fileName, ksba_cert_t* cert); +int checkX509Signature(ksba_cert_t issuer_cert, ksba_cert_t cert); +int importSecurityDoc(const char* file, unsigned char** contents, unsigned short* length); +int importPEMPublicKey(char* keyFile, gcry_sexp_t* key_sexp); #endif // UDA_X509UTILS_H diff --git a/source/serialisation/capnp_serialisation.cpp b/source/serialisation/capnp_serialisation.cpp index ae948921..c2756265 100644 --- a/source/serialisation/capnp_serialisation.cpp +++ b/source/serialisation/capnp_serialisation.cpp @@ -11,7 +11,7 @@ #include #include -#include "udaTypes.h" +#include #include "schema.capnp.h" diff --git a/source/server/applyXML.cpp b/source/server/applyXML.cpp index a470026f..57c42b03 100644 --- a/source/server/applyXML.cpp +++ b/source/server/applyXML.cpp @@ -17,9 +17,9 @@ #include #include -#include "udaTypes.h" -#include -#include +#include +#include "clientserver/stringUtils.h" +#include "logging/logging.h" int serverParseSignalXML(DATA_SOURCE data_source, SIGNAL signal, SIGNAL_DESC signal_desc, ACTIONS* actions_desc, ACTIONS* actions_sig) diff --git a/source/server/applyXML.h b/source/server/applyXML.h index 12ef3f52..ccdbd73a 100644 --- a/source/server/applyXML.h +++ b/source/server/applyXML.h @@ -3,9 +3,8 @@ #ifndef UDA_SERVER_APPLYXML_H # define UDA_SERVER_APPLYXML_H -# include "export.h" # include "clientserver/udaStructs.h" -# include +# include "clientserver/parseXML.h" int serverParseSignalXML(DATA_SOURCE data_source, SIGNAL signal, SIGNAL_DESC signal_desc, ACTIONS* actions_desc, ACTIONS* actions_sig); diff --git a/source/server/closeServerSockets.cpp b/source/server/closeServerSockets.cpp index c020e3b1..86fc1912 100644 --- a/source/server/closeServerSockets.cpp +++ b/source/server/closeServerSockets.cpp @@ -9,8 +9,8 @@ #endif #include -#include -#include +#include "clientserver/manageSockets.h" +#include "clientserver/stringUtils.h" void closeNamedServerSocket(SOCKETLIST* socks, char* host, int port) { diff --git a/source/server/closeServerSockets.h b/source/server/closeServerSockets.h index 94e22807..fac94d8d 100644 --- a/source/server/closeServerSockets.h +++ b/source/server/closeServerSockets.h @@ -3,8 +3,7 @@ #ifndef UDA_SERVER_CLOSESERVERSOCKETS_H # define UDA_SERVER_CLOSESERVERSOCKETS_H -# include "export.h" -# include +# include "clientserver/socketStructs.h" void closeServerSocket(SOCKETLIST* socks, int fh); void closeServerSockets(SOCKETLIST* socks); diff --git a/source/server/createXDRStream.cpp b/source/server/createXDRStream.cpp index 37715963..5c3bdcc3 100644 --- a/source/server/createXDRStream.cpp +++ b/source/server/createXDRStream.cpp @@ -1,6 +1,6 @@ #include "createXDRStream.h" -#include +#include "server/udaServer.h" #include "writer.h" diff --git a/source/server/createXDRStream.h b/source/server/createXDRStream.h index 0841f2d2..b4dfdbd5 100644 --- a/source/server/createXDRStream.h +++ b/source/server/createXDRStream.h @@ -6,8 +6,6 @@ # include # include -# include "export.h" - struct IoData { int* server_tot_block_time; int* server_timeout; diff --git a/source/server/fatServer.cpp b/source/server/fatServer.cpp index f0bd57e1..5437a138 100644 --- a/source/server/fatServer.cpp +++ b/source/server/fatServer.cpp @@ -4,16 +4,15 @@ #include "clientserver/initStructs.h" #include "logging/logging.h" -#include "struct.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "clientserver/copyStructs.h" +#include "clientserver/errorLog.h" +#include "clientserver/manageSockets.h" +#include "clientserver/printStructs.h" +#include "clientserver/protocol.h" +#include "clientserver/protocolXML.h" +#include "clientserver/xdrlib.h" +#include "logging/accessLog.h" +#include "server/serverPlugin.h" #include #include "createXDRStream.h" @@ -22,6 +21,7 @@ #include "serverGetData.h" #include "serverLegacyPlugin.h" #include "serverProcessing.h" +#include "uda/structured.h" #ifdef NONETCDFPLUGIN void ncclose(int fh) {} @@ -426,7 +426,6 @@ int startup_fat_server(SERVER_BLOCK* server_block, USERDEFINEDTYPELIST& parsedus getInitialUserDefinedTypeList(&user_defined_type_list); parseduserdefinedtypelist = *user_defined_type_list; - printUserDefinedTypeList(*user_defined_type_list); user_defined_type_list = nullptr; // Startup State /* diff --git a/source/server/getPluginAddress.cpp b/source/server/getPluginAddress.cpp index 0db3b5f6..f38dd5af 100644 --- a/source/server/getPluginAddress.cpp +++ b/source/server/getPluginAddress.cpp @@ -5,7 +5,7 @@ #include #include "logging/logging.h" -#include +#include "clientserver/errorLog.h" /** * Return the function address for plugin data readers located in external shared libraries diff --git a/source/server/getServerEnvironment.cpp b/source/server/getServerEnvironment.cpp index 1f561785..36cdb099 100644 --- a/source/server/getServerEnvironment.cpp +++ b/source/server/getServerEnvironment.cpp @@ -2,7 +2,7 @@ #include -#include +#include "logging/logging.h" // 2019-07-04 Herve Ancher (CEA): Add prefix "g_" to avoid conflict with internal MinGW varaible static ENVIRONMENT g_environ; diff --git a/source/server/getServerEnvironment.h b/source/server/getServerEnvironment.h index c16f7c35..503977af 100644 --- a/source/server/getServerEnvironment.h +++ b/source/server/getServerEnvironment.h @@ -3,7 +3,6 @@ #ifndef UDA_SERVER_GETSERVERENVIRONMENT_H # define UDA_SERVER_GETSERVERENVIRONMENT_H -# include "export.h" # include "clientserver/udaStructs.h" void printServerEnvironment(const ENVIRONMENT* environment); diff --git a/source/server/initPluginList.cpp b/source/server/initPluginList.cpp index b9eb9916..f7722d3b 100644 --- a/source/server/initPluginList.cpp +++ b/source/server/initPluginList.cpp @@ -1,12 +1,13 @@ #include "initPluginList.h" #include - -#include -#include -#include #include -#include + +#include "cache/memcache.hpp" +#include "clientserver/errorLog.h" +#include "clientserver/stringUtils.h" +#include "uda/plugins.h" +#include "server/serverPlugin.h" #include "getPluginAddress.h" diff --git a/source/server/makeServerRequestBlock.cpp b/source/server/makeServerRequestBlock.cpp index 8d252018..7d40aa03 100644 --- a/source/server/makeServerRequestBlock.cpp +++ b/source/server/makeServerRequestBlock.cpp @@ -1,7 +1,7 @@ #include "makeServerRequestBlock.h" #include "clientserver/initStructs.h" -#include +#include "clientserver/makeRequestBlock.h" #include "getServerEnvironment.h" diff --git a/source/server/serverGetData.cpp b/source/server/serverGetData.cpp index 345323bd..961bf38d 100644 --- a/source/server/serverGetData.cpp +++ b/source/server/serverGetData.cpp @@ -9,18 +9,18 @@ #include "clientserver/initStructs.h" #include "logging/logging.h" -#include "struct.h" -#include -#include -#include -#include -#include +#include "clientserver/errorLog.h" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/nameValueSubstitution.h" +#include "clientserver/printStructs.h" +#include "clientserver/stringUtils.h" #include "applyXML.h" #include "getServerEnvironment.h" #include "makeServerRequestBlock.h" #include "serverPlugin.h" #include "serverSubsetData.h" +#include "uda/plugins.h" static int swap_signal_error(DATA_BLOCK* data_block, DATA_BLOCK* data_block2, int asymmetry); static int swap_signal_dim(DIMCOMPOSITE dimcomposite, DATA_BLOCK* data_block, DATA_BLOCK* data_block2); diff --git a/source/server/serverGetData.h b/source/server/serverGetData.h index b9bd6489..8d97ede8 100644 --- a/source/server/serverGetData.h +++ b/source/server/serverGetData.h @@ -1,10 +1,10 @@ #pragma once -#include "genStructs.h" +#include "structures/genStructs.h" #include "clientserver/udaStructs.h" #include "serverPlugin.h" -#include -#include +#include "clientserver/parseXML.h" +#include "clientserver/socketStructs.h" int udaGetData(int* depth, REQUEST_DATA* request_data, CLIENT_BLOCK client_block, DATA_BLOCK* data_block, DATA_SOURCE* data_source, SIGNAL* signal_rec, SIGNAL_DESC* signal_desc, ACTIONS* actions_desc, diff --git a/source/server/serverLegacyPlugin.cpp b/source/server/serverLegacyPlugin.cpp index 73ec0b6c..4b2ac657 100644 --- a/source/server/serverLegacyPlugin.cpp +++ b/source/server/serverLegacyPlugin.cpp @@ -5,12 +5,12 @@ # include #endif -#include -#include -#include +#include "clientserver/errorLog.h" +#include "clientserver/stringUtils.h" +#include "logging/logging.h" #ifndef FATCLIENT -# include +# include "server/getServerEnvironment.h" #endif int udaServerLegacyPlugin(REQUEST_DATA* request, DATA_SOURCE* data_source, SIGNAL_DESC* signal_desc) diff --git a/source/server/serverLegacyPlugin.h b/source/server/serverLegacyPlugin.h index a46a4f9a..b68e867e 100644 --- a/source/server/serverLegacyPlugin.h +++ b/source/server/serverLegacyPlugin.h @@ -3,7 +3,6 @@ #ifndef UDA_SERVER_SERVERLEGACYPLUGIN_H # define UDA_SERVER_SERVERLEGACYPLUGIN_H -# include "export.h" # include "clientserver/udaStructs.h" int udaServerLegacyPlugin(REQUEST_DATA* request, DATA_SOURCE* data_source, SIGNAL_DESC* signal_desc); diff --git a/source/server/serverPlugin.cpp b/source/server/serverPlugin.cpp index 8a381af2..08ae14dd 100644 --- a/source/server/serverPlugin.cpp +++ b/source/server/serverPlugin.cpp @@ -17,14 +17,15 @@ #endif #include "clientserver/initStructs.h" -#include "struct.h" -#include -#include -#include -#include -#include -#include -#include +#include "cache/memcache.hpp" +#include "clientserver/errorLog.h" +#include "clientserver/expand_path.h" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/printStructs.h" +#include "clientserver/stringUtils.h" +#include "logging/logging.h" +#include "uda/plugins.h" +#include "uda/structured.h" #define REQUEST_READ_START 1000 #define REQUEST_PLUGIN_MCOUNT 100 // Maximum initial number of plugins that can be registered diff --git a/source/server/serverPlugin.h b/source/server/serverPlugin.h index f5d183d5..3680f364 100644 --- a/source/server/serverPlugin.h +++ b/source/server/serverPlugin.h @@ -1,7 +1,10 @@ #ifndef UDA_SERVER_SERVERPLUGIN_H #define UDA_SERVER_SERVERPLUGIN_H -#include "udaPlugin.h" +#include +#include + +#include "clientserver/udaStructs.h" #define REQUEST_READ_START 1000 #define REQUEST_PLUGIN_MCOUNT 100 // Maximum initial number of plugins that can be registered diff --git a/source/server/serverProcessing.cpp b/source/server/serverProcessing.cpp index b2d0f2a5..e4968414 100644 --- a/source/server/serverProcessing.cpp +++ b/source/server/serverProcessing.cpp @@ -2,8 +2,8 @@ #include -#include "udaTypes.h" -#include +#include +#include "logging/logging.h" template bool reduce_dim(DIMS* ddim) { diff --git a/source/server/serverProcessing.h b/source/server/serverProcessing.h index d4176a11..631ce4d2 100644 --- a/source/server/serverProcessing.h +++ b/source/server/serverProcessing.h @@ -3,7 +3,6 @@ #ifndef UDA_SERVER_SERVERPROCESSING_H # define UDA_SERVER_SERVERPROCESSING_H -# include "export.h" # include "clientserver/udaStructs.h" int serverProcessing(CLIENT_BLOCK client_block, DATA_BLOCK* data_block); diff --git a/source/server/serverStartup.cpp b/source/server/serverStartup.cpp index fcc8aa5f..80354fa2 100644 --- a/source/server/serverStartup.cpp +++ b/source/server/serverStartup.cpp @@ -4,8 +4,8 @@ #include #include -#include -#include +#include "clientserver/errorLog.h" +#include "logging/logging.h" #include "getServerEnvironment.h" diff --git a/source/server/serverStartup.h b/source/server/serverStartup.h index dfe18b10..5d3d077b 100644 --- a/source/server/serverStartup.h +++ b/source/server/serverStartup.h @@ -3,8 +3,6 @@ #ifndef UDA_SERVER_SERVERSTARTUP_H # define UDA_SERVER_SERVERSTARTUP_H -# include "export.h" - int startup(); #endif // UDA_SERVER_SERVERSTARTUP_H diff --git a/source/server/serverSubsetData.cpp b/source/server/serverSubsetData.cpp index 63c4cef5..3e71dda9 100644 --- a/source/server/serverSubsetData.cpp +++ b/source/server/serverSubsetData.cpp @@ -9,7 +9,6 @@ #include "clientserver/makeRequestBlock.h" #include "clientserver/parseOperation.h" #include "getServerEnvironment.h" -#include "udaPlugin.h" #include #include @@ -23,14 +22,14 @@ #endif #include "clientserver/initStructs.h" -#include "struct.h" -#include "udaTypes.h" +#include #include -#include -#include -#include -#include -#include +#include "clientserver/compressDim.h" +#include "clientserver/errorLog.h" +#include "clientserver/printStructs.h" +#include "clientserver/stringUtils.h" +#include "logging/logging.h" +#include "uda/structured.h" //---------------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------- diff --git a/source/server/serverSubsetData.h b/source/server/serverSubsetData.h index 6bd5c8cf..66f80c45 100644 --- a/source/server/serverSubsetData.h +++ b/source/server/serverSubsetData.h @@ -1,8 +1,8 @@ #pragma once -#include "genStructs.h" +#include "structures/genStructs.h" #include "clientserver/udaStructs.h" -#include +#include "clientserver/parseXML.h" #include "serverPlugin.h" int serverSubsetData(DATA_BLOCK* data_block, const ACTION& action, LOGMALLOCLIST* logmalloclist); diff --git a/source/server/sleepServer.cpp b/source/server/sleepServer.cpp index 71560d77..c88c9b0b 100644 --- a/source/server/sleepServer.cpp +++ b/source/server/sleepServer.cpp @@ -7,11 +7,11 @@ *--------------------------------------------------------------*/ #include "sleepServer.h" -#include -#include -#include -#include -#include +#include "clientserver/errorLog.h" +#include "clientserver/protocol.h" +#include "clientserver/xdrlib.h" +#include "logging/logging.h" +#include "server/udaServer.h" int sleepServer(XDR* server_input, XDR* server_output, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, int protocolVersion, LOGSTRUCTLIST* log_struct_list, diff --git a/source/server/sleepServer.h b/source/server/sleepServer.h index f59e101e..d2be209a 100644 --- a/source/server/sleepServer.h +++ b/source/server/sleepServer.h @@ -5,8 +5,7 @@ # include -# include "export.h" -# include "genStructs.h" +# include "structures/genStructs.h" struct IoData; diff --git a/source/server/udaLegacyServer.cpp b/source/server/udaLegacyServer.cpp index b8e3134a..8d6c3d62 100644 --- a/source/server/udaLegacyServer.cpp +++ b/source/server/udaLegacyServer.cpp @@ -6,16 +6,15 @@ #include "udaLegacyServer.h" #include "clientserver/initStructs.h" -#include "struct.h" -#include "udaTypes.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "uda/structured.h" +#include "clientserver/errorLog.h" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/printStructs.h" +#include "clientserver/protocol.h" +#include "clientserver/xdrlib.h" +#include "logging/accessLog.h" +#include "logging/logging.h" +#include "server/serverPlugin.h" #include "closeServerSockets.h" #include "createXDRStream.h" diff --git a/source/server/udaLegacyServer.h b/source/server/udaLegacyServer.h index 6ebf8eee..78213543 100644 --- a/source/server/udaLegacyServer.h +++ b/source/server/udaLegacyServer.h @@ -1,11 +1,10 @@ #pragma once -#include "export.h" -#include "genStructs.h" -#include "plugins/pluginStructs.h" +#include "uda/types.h" #include "clientserver/udaStructs.h" -#include #include "serverPlugin.h" +#include "clientserver/socketStructs.h" + /** * UDA Legacy Data Server (protocol versions <= 6) diff --git a/source/server/udaServer.cpp b/source/server/udaServer.cpp index f7faec99..79794316 100644 --- a/source/server/udaServer.cpp +++ b/source/server/udaServer.cpp @@ -9,17 +9,16 @@ #include #include "clientserver/initStructs.h" -#include "struct.h" -#include "udaErrors.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "clientserver/udaErrors.h" +#include "cache/memcache.hpp" +#include "clientserver/errorLog.h" +#include "clientserver/manageSockets.h" +#include "clientserver/printStructs.h" +#include "clientserver/protocol.h" +#include "clientserver/xdrlib.h" +#include "logging/accessLog.h" +#include "logging/logging.h" +#include "server/serverPlugin.h" #include #include "closeServerSockets.h" @@ -31,6 +30,7 @@ #include "serverProcessing.h" #include "serverStartup.h" #include "udaLegacyServer.h" +#include "uda/structured.h" #ifdef SECURITYENABLED # include @@ -858,7 +858,6 @@ int do_server_loop(REQUEST_BLOCK* request_block, DATA_BLOCK_LIST* data_block_lis getInitialUserDefinedTypeList(&user_defined_type_list); parsed_user_defined_type_list = *user_defined_type_list; - printUserDefinedTypeList(*user_defined_type_list); log_malloc_list = (LOGMALLOCLIST*)malloc(sizeof(LOGMALLOCLIST)); initLogMallocList(log_malloc_list); diff --git a/source/server/udaServer.h b/source/server/udaServer.h index 48f222c6..502574c1 100644 --- a/source/server/udaServer.h +++ b/source/server/udaServer.h @@ -1,9 +1,6 @@ #pragma once -# include "export.h" -# include "genStructs.h" -# include "plugins/pluginStructs.h" -# include +#include "clientserver/udaStructs.h" int uda_server(CLIENT_BLOCK client_block); diff --git a/source/server/writer.cpp b/source/server/writer.cpp index 9d2d7a16..32969fc7 100644 --- a/source/server/writer.cpp +++ b/source/server/writer.cpp @@ -2,8 +2,8 @@ #include -#include "udaDefines.h" -#include +#include "clientserver/udaDefines.h" +#include "logging/logging.h" #include "createXDRStream.h" diff --git a/source/server/writer.h b/source/server/writer.h index 60c649ba..26fd745d 100644 --- a/source/server/writer.h +++ b/source/server/writer.h @@ -14,8 +14,6 @@ # include # endif -# include "export.h" - # define MIN_BLOCK_TIME 1000 # define MAX_BLOCK_TIME 10000 diff --git a/source/server2/apply_XML.cpp b/source/server2/apply_XML.cpp index f714466a..5cf5ef2e 100644 --- a/source/server2/apply_XML.cpp +++ b/source/server2/apply_XML.cpp @@ -17,9 +17,9 @@ #include #include -#include "udaTypes.h" -#include -#include +#include +#include "clientserver/stringUtils.h" +#include "logging/logging.h" int uda::server_parse_signal_XML(DATA_SOURCE data_source, SIGNAL signal, SIGNAL_DESC signal_desc, ACTIONS* actions_desc, ACTIONS* actions_sig) diff --git a/source/server2/apply_XML.hpp b/source/server2/apply_XML.hpp index 19c26fdb..22511484 100755 --- a/source/server2/apply_XML.hpp +++ b/source/server2/apply_XML.hpp @@ -3,9 +3,9 @@ #ifndef UDA_SERVER_APPLYXML_H #define UDA_SERVER_APPLYXML_H -#include +#include "clientserver/parseXML.h" #include "clientserver/udaStructs.h" -#include "export.h" +#include "include/uda/export.h" namespace uda { diff --git a/source/server2/get_data.cpp b/source/server2/get_data.cpp index 5bd8c9e1..8e7fd803 100644 --- a/source/server2/get_data.cpp +++ b/source/server2/get_data.cpp @@ -1,4 +1,5 @@ #include "get_data.hpp" + #include "apply_XML.hpp" #include "clientserver/errorLog.h" #include "clientserver/nameValueSubstitution.h" @@ -9,8 +10,10 @@ #include "make_server_request_block.hpp" #include "server_plugin.h" #include "server_subset_data.h" -#include "udaPlugin.h" -#include "udaTypes.h" +#include "server.hpp" +#include "plugins.hpp" +#include "uda/plugins.h" +#include namespace { diff --git a/source/server2/get_plugin_address.cpp b/source/server2/get_plugin_address.cpp index ced8fd33..50141574 100644 --- a/source/server2/get_plugin_address.cpp +++ b/source/server2/get_plugin_address.cpp @@ -5,7 +5,7 @@ #include #include "logging/logging.h" -#include +#include "clientserver/errorLog.h" /** * Return the function address for plugin data readers located in external shared libraries diff --git a/source/server2/get_plugin_address.hpp b/source/server2/get_plugin_address.hpp index bffd8f5c..45c1d410 100755 --- a/source/server2/get_plugin_address.hpp +++ b/source/server2/get_plugin_address.hpp @@ -1,8 +1,6 @@ #pragma once -#include "udaPlugin.h" - -typedef int (*PLUGINFUNP)(UDA_PLUGIN_INTERFACE*); // Plugin function type +#include "plugins.hpp" namespace uda { diff --git a/source/server2/make_server_request_block.cpp b/source/server2/make_server_request_block.cpp index 37254c96..25816004 100644 --- a/source/server2/make_server_request_block.cpp +++ b/source/server2/make_server_request_block.cpp @@ -1,7 +1,7 @@ #include "make_server_request_block.hpp" #include "clientserver/initStructs.h" -#include +#include "clientserver/makeRequestBlock.h" #include "plugins.hpp" #include "server_environment.hpp" diff --git a/source/server2/make_server_request_block.hpp b/source/server2/make_server_request_block.hpp index 9466400a..857011a7 100755 --- a/source/server2/make_server_request_block.hpp +++ b/source/server2/make_server_request_block.hpp @@ -3,10 +3,7 @@ #ifndef UDA_SERVER_MAKESERVERREQUESTBLOCK_HPP #define UDA_SERVER_MAKESERVERREQUESTBLOCK_HPP -#include "udaPlugin.h" #include "clientserver/udaStructs.h" -#include "export.h" - #include "plugins.hpp" #include "server_environment.hpp" diff --git a/source/server2/plugins.cpp b/source/server2/plugins.cpp index d7277bbf..cfb0971f 100644 --- a/source/server2/plugins.cpp +++ b/source/server2/plugins.cpp @@ -9,8 +9,8 @@ #include "clientserver/stringUtils.h" #include "logging/logging.h" -#include "udaPlugin.h" -#include +#include "clientserver/errorLog.h" +#include "uda/plugins.h" #define REQUEST_READ_START 1000 diff --git a/source/server2/plugins.hpp b/source/server2/plugins.hpp index 439e8233..7392aeac 100644 --- a/source/server2/plugins.hpp +++ b/source/server2/plugins.hpp @@ -6,8 +6,7 @@ #include #include -#include "udaDefines.h" -#include "udaPlugin.h" +#include "clientserver/udaDefines.h" enum pluginClass { UDA_PLUGIN_CLASS_UNKNOWN, @@ -18,6 +17,7 @@ enum pluginClass { UDA_PLUGIN_CLASS_OTHER }; +typedef struct UdaPluginInterface UDA_PLUGIN_INTERFACE; typedef int (*PLUGINFUNP)(UDA_PLUGIN_INTERFACE*); // Plugin function type struct PluginData { diff --git a/source/server2/server.cpp b/source/server2/server.cpp index de6d7eb5..7194b0c7 100644 --- a/source/server2/server.cpp +++ b/source/server2/server.cpp @@ -15,10 +15,11 @@ #include "server_exceptions.h" #include "server_plugin.h" #include "server_processing.h" -#include "struct.h" -#include "udaErrors.h" +#include "clientserver/udaErrors.h" #ifdef SSLAUTHENTICATION # include "authentication/udaServerSSL.h" +#include "uda/structured.h" + #endif void free_data_blocks(std::vector& data_blocks) diff --git a/source/server2/server.hpp b/source/server2/server.hpp index 5b9a2cc0..818fda6e 100644 --- a/source/server2/server.hpp +++ b/source/server2/server.hpp @@ -13,7 +13,7 @@ #include "clientserver/parseXML.h" #include "clientserver/socketStructs.h" #include "cache/memcache.hpp" -#include "export.h" +#include "include/uda/export.h" namespace uda { diff --git a/source/server2/server_environment.cpp b/source/server2/server_environment.cpp index 9a7a28ef..d5072772 100644 --- a/source/server2/server_environment.cpp +++ b/source/server2/server_environment.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "logging/logging.h" void uda::server::Environment::print() { diff --git a/source/server2/server_environment.hpp b/source/server2/server_environment.hpp index 1721b3bc..c65fd247 100755 --- a/source/server2/server_environment.hpp +++ b/source/server2/server_environment.hpp @@ -4,7 +4,7 @@ #define UDA_SERVER_GETSERVERENVIRONMENT_HPP #include "clientserver/udaStructs.h" -#include "export.h" +#include "include/uda/export.h" namespace uda { namespace server { diff --git a/source/server2/server_plugin.cpp b/source/server2/server_plugin.cpp index 9610604c..a96b7c8f 100644 --- a/source/server2/server_plugin.cpp +++ b/source/server2/server_plugin.cpp @@ -20,13 +20,14 @@ #include "clientserver/initStructs.h" #include "logging/logging.h" -#include "struct.h" -#include -#include -#include -#include -#include -#include +#include "cache/memcache.hpp" +#include "clientserver/errorLog.h" +#include "clientserver/expand_path.h" +#include "clientserver/makeRequestBlock.h" +#include "clientserver/printStructs.h" +#include "clientserver/stringUtils.h" +#include "uda/plugins.h" +#include "uda/structured.h" #define REQUEST_READ_START 1000 #define REQUEST_PLUGIN_MCOUNT 100 // Maximum initial number of plugins that can be registered diff --git a/source/server2/server_plugin.h b/source/server2/server_plugin.h index 735866c9..30c864a5 100644 --- a/source/server2/server_plugin.h +++ b/source/server2/server_plugin.h @@ -1,15 +1,16 @@ #ifndef UDA_SERVER_SERVERPLUGIN_H #define UDA_SERVER_SERVERPLUGIN_H -#include "export.h" #include "plugins.hpp" -#include "server.hpp" -#include "udaPlugin.h" +#include "clientserver/udaStructs.h" +#include "uda/types.h" #define REQUEST_READ_START 1000 #define REQUEST_PLUGIN_MCOUNT 100 // Maximum initial number of plugins that can be registered #define REQUEST_PLUGIN_MSTEP 10 // Increase heap by 10 records once the maximum is exceeded +typedef struct PluginList PLUGINLIST; + typedef struct UdaPluginInterface { // Standard Plugin interface unsigned short interfaceVersion; // Interface Version unsigned short pluginVersion; // Plugin Version @@ -32,9 +33,18 @@ typedef struct UdaPluginInterface { // Standard Plugin interface UDA_ERROR_STACK error_stack; } UDA_PLUGIN_INTERFACE; +struct PluginData; + namespace uda { +class Plugins; +struct MetadataBlock; + +namespace server { +class Environment; +} + int serverRedirectStdStreams(int reset); int serverPlugin(RequestData* request, DataSource* data_source, SignalDesc* signal_desc, const Plugins& plugins, @@ -43,11 +53,11 @@ int serverPlugin(RequestData* request, DataSource* data_source, SignalDesc* sign int provenancePlugin(ClientBlock* client_block, RequestData* original_request, const Plugins& plugins, const char* logRecord, const server::Environment& environment, uda::MetadataBlock& metadata); -boost::optional find_metadata_plugin(const Plugins& plugins, const server::Environment& environment); - int call_metadata_plugin(const PluginData& plugin, RequestData* request_block, const server::Environment& environment, const uda::Plugins& plugins, uda::MetadataBlock& metadata); +boost::optional find_metadata_plugin(const Plugins& plugins, const server::Environment& environment); + } // namespace uda #endif // UDA_SERVER_SERVERPLUGIN_H diff --git a/source/server2/server_processing.cpp b/source/server2/server_processing.cpp index 09221313..9b8fbe20 100644 --- a/source/server2/server_processing.cpp +++ b/source/server2/server_processing.cpp @@ -2,8 +2,8 @@ #include -#include "udaTypes.h" -#include +#include +#include "logging/logging.h" /** * UDA Server Side Data Processing diff --git a/source/server2/server_processing.h b/source/server2/server_processing.h index 6d200309..bffd4bdc 100644 --- a/source/server2/server_processing.h +++ b/source/server2/server_processing.h @@ -3,7 +3,6 @@ #ifndef UDA_SERVER_SERVERPROCESSING_H # define UDA_SERVER_SERVERPROCESSING_H -# include "export.h" # include "clientserver/udaStructs.h" namespace uda diff --git a/source/server2/server_subset_data.cpp b/source/server2/server_subset_data.cpp index 42dce29e..761316cc 100644 --- a/source/server2/server_subset_data.cpp +++ b/source/server2/server_subset_data.cpp @@ -18,13 +18,13 @@ #endif #include "clientserver/initStructs.h" -#include "struct.h" -#include "udaTypes.h" -#include -#include -#include -#include -#include +#include +#include "clientserver/compressDim.h" +#include "clientserver/errorLog.h" +#include "clientserver/printStructs.h" +#include "clientserver/stringUtils.h" +#include "logging/logging.h" +#include "uda/structured.h" //---------------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------- diff --git a/source/server2/server_subset_data.h b/source/server2/server_subset_data.h index b65d374e..50afb45d 100644 --- a/source/server2/server_subset_data.h +++ b/source/server2/server_subset_data.h @@ -3,10 +3,9 @@ #ifndef UDA_SERVER_SERVERSUBSETDATA_H # define UDA_SERVER_SERVERSUBSETDATA_H -# include "export.h" -# include "genStructs.h" +# include "structures/genStructs.h" # include "clientserver/udaStructs.h" -# include +# include "clientserver/parseXML.h" namespace uda { diff --git a/source/server2/xdr_protocol.cpp b/source/server2/xdr_protocol.cpp index 083e0e3f..2ffd126d 100644 --- a/source/server2/xdr_protocol.cpp +++ b/source/server2/xdr_protocol.cpp @@ -3,9 +3,8 @@ #include "clientserver/printStructs.h" #include "clientserver/protocol.h" #include "clientserver/xdrlib.h" -#include "struct.h" -#include "udaErrors.h" -#include "udaTypes.h" +#include "clientserver/udaErrors.h" +#include #ifdef SSLAUTHENTICATION # include "authentication/udaServerSSL.h" #endif @@ -13,8 +12,8 @@ #include #include -#include "udaDefines.h" -#include +#include "clientserver/udaDefines.h" +#include "logging/logging.h" #include "server.hpp" diff --git a/source/server2/xdr_protocol.hpp b/source/server2/xdr_protocol.hpp index 751d4f31..24acff22 100644 --- a/source/server2/xdr_protocol.hpp +++ b/source/server2/xdr_protocol.hpp @@ -6,9 +6,9 @@ #include #include -#include "udaDefines.h" +#include "clientserver/udaDefines.h" #include "clientserver/udaStructs.h" -#include "genStructs.h" +#include "structures/genStructs.h" #include "cache/memcache.hpp" #include "server_environment.hpp" diff --git a/source/structures/accessors.cpp b/source/structures/accessors.cpp index ef2316e8..0456e2b1 100644 --- a/source/structures/accessors.cpp +++ b/source/structures/accessors.cpp @@ -46,13 +46,11 @@ // // printImage // -#include "accessors.h" +#include -#include -#include -#include - -#include "struct.h" +#include "clientserver/stringUtils.h" +#include +#include "logging/logging.h" /** Find (search type A) the first Tree Node with a data structure type containing a named element/member. * diff --git a/source/include/genStructs.h b/source/structures/genStructs.h similarity index 92% rename from source/include/genStructs.h rename to source/structures/genStructs.h index 3ef985f0..0c04b608 100644 --- a/source/include/genStructs.h +++ b/source/structures/genStructs.h @@ -3,12 +3,9 @@ #include #include +#include +#include -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif //------------------------------------------------------------------------------------------------------- // Macro definitions @@ -24,30 +21,6 @@ extern "C" { #define MAXRECURSIVEDEPTH 30 -#define SCALARDOUBLE 1 -#define ARRAYDOUBLE 2 -#define SCALARFLOAT 3 -#define ARRAYFLOAT 4 -#define SCALARLONG64 5 -#define ARRAYLONG64 6 -#define SCALARULONG64 7 -#define ARRAYULONG64 8 -#define SCALARINT 9 -#define ARRAYINT 10 -#define SCALARUINT 11 -#define ARRAYUINT 12 -#define SCALARSHORT 13 -#define ARRAYSHORT 14 -#define SCALARUSHORT 15 -#define ARRAYUSHORT 16 -#define SCALARCHAR 17 -#define ARRAYCHAR 18 -#define SCALARSTRING 19 -#define ARRAYSTRING 20 -#define ARRAYVOID 21 -#define SCALARUCHAR 22 -#define ARRAYUCHAR 23 - typedef intptr_t VOIDTYPE; typedef uintptr_t UVOIDTYPE; @@ -185,8 +158,8 @@ typedef struct GeneralBlock { // Generalised Data Structures: Cl #define UDA_PACKAGE_STRUCTDATA 2 #define UDA_PACKAGE_XDROBJECT 3 -#ifdef __cplusplus -} -#endif +int xdrAtomicData(LOGMALLOCLIST* logmalloclist, XDR* xdrs, const char* type, int count, int size, char** data); +void printUserDefinedTypeListTable(USERDEFINEDTYPELIST str); +void initSArray(SARRAY* str); #endif // UDA_STRUCTURES_GENSTRUCTS_H diff --git a/source/structures/parseIncludeFile.cpp b/source/structures/parseIncludeFile.cpp index 23649af8..4535a1ba 100644 --- a/source/structures/parseIncludeFile.cpp +++ b/source/structures/parseIncludeFile.cpp @@ -22,15 +22,13 @@ #include "parseIncludeFile.h" #include -#include #include -#include "udaDefines.h" -#include "udaErrors.h" -#include -#include +#include -#include "struct.h" +#include "clientserver/udaDefines.h" +#include "clientserver/errorLog.h" +#include "clientserver/stringUtils.h" int parseIncludeFile(USERDEFINEDTYPELIST* userdefinedtypelist, const char* header) { diff --git a/source/structures/parseIncludeFile.h b/source/structures/parseIncludeFile.h index aa94bb8a..ccd67ef9 100644 --- a/source/structures/parseIncludeFile.h +++ b/source/structures/parseIncludeFile.h @@ -3,16 +3,6 @@ #include "genStructs.h" -#include "export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int parseIncludeFile(USERDEFINEDTYPELIST* userdefinedtypelist, const char* header); - -#ifdef __cplusplus -} -#endif +int parseIncludeFile(USERDEFINEDTYPELIST* userdefinedtypelist, const char* header); #endif // UDA_STRUCTURES_PARSEINCLUDEFILE_H diff --git a/source/structures/struct.cpp b/source/structures/struct.cpp index f3d3a031..8cdb9f31 100644 --- a/source/structures/struct.cpp +++ b/source/structures/struct.cpp @@ -37,7 +37,7 @@ // //============================================================================================================== -#include "struct.h" +#include "genStructs.h" #include #include @@ -51,17 +51,17 @@ # define strcasecmp _stricmp #endif -#include "udaErrors.h" -#include -#include -#include -#include +#include "clientserver/errorLog.h" +#include "clientserver/stringUtils.h" +#include "clientserver/xdrlib.h" +#include "logging/logging.h" +#include "clientserver/protocolXML2Put.h" -#include "accessors.h" +#include #include "xdrUserDefinedData.h" #if defined(SERVERBUILD) -# include +# include "server/udaServer.h" #endif static unsigned int last_malloc_index = 0; // Malloc Log search index last value diff --git a/source/structures/xdrUserDefinedData.cpp b/source/structures/xdrUserDefinedData.cpp index d27cf6f0..33c4a811 100644 --- a/source/structures/xdrUserDefinedData.cpp +++ b/source/structures/xdrUserDefinedData.cpp @@ -1,15 +1,13 @@ #include "xdrUserDefinedData.h" #include +#include -#include "udaErrors.h" -#include -#include -#include -#include -#include - -#include "struct.h" +#include "clientserver/errorLog.h" +#include "clientserver/protocol.h" +#include "clientserver/stringUtils.h" +#include "clientserver/xdrlib.h" +#include "logging/logging.h" static int recursiveDepth = 0; // Keep count of recursive calls diff --git a/source/structures/xdrUserDefinedData.h b/source/structures/xdrUserDefinedData.h index 3430853e..077eb8e5 100644 --- a/source/structures/xdrUserDefinedData.h +++ b/source/structures/xdrUserDefinedData.h @@ -3,20 +3,11 @@ #include -#include "export.h" #include "genStructs.h" -#ifdef __cplusplus -extern "C" { -#endif - -LIBRARY_API int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* log_struct_list, +int xdrUserDefinedData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, LOGSTRUCTLIST* log_struct_list, USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* userdefinedtype, void** data, int datacount, int structRank, int* structShape, int index, NTREE** NTree, int protocolVersion, int malloc_source); -#ifdef __cplusplus -} -#endif - #endif // UDA_STRUCTURES_XDRUSERDEFINEDDATA_H diff --git a/source/uda.h b/source/uda.h deleted file mode 100644 index d5939dbd..00000000 --- a/source/uda.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#ifndef UDA_H -# define UDA_H - -# include "accAPI.h" -# include "accessors.h" -# include "clientAPI.h" -# include "clientMDS.h" -# include "genStructs.h" -# include "clientserver/initStructs.h" -# include "struct.h" -# include "udaGetAPI.h" -# include "udaPlugin.h" -# include "udaPutAPI.h" -# include "clientserver/udaStructs.h" -# include "udaTypes.h" -# include "version.h" - -# ifdef UDA_LEGACY -# include "legacy.h" -# endif // UDA_LEGACY - -#endif // UDA_H diff --git a/source/wrappers/c++/array.cpp b/source/wrappers/c++/array.cpp index c7c284f6..0e5164fd 100644 --- a/source/wrappers/c++/array.cpp +++ b/source/wrappers/c++/array.cpp @@ -3,7 +3,6 @@ // globals. # include #endif -#include #include "array.hpp" #include "result.hpp" diff --git a/source/wrappers/c++/array.hpp b/source/wrappers/c++/array.hpp index 74b1bffa..81dadec9 100755 --- a/source/wrappers/c++/array.hpp +++ b/source/wrappers/c++/array.hpp @@ -3,7 +3,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #include "dim.hpp" #include "data.hpp" diff --git a/source/wrappers/c++/client.cpp b/source/wrappers/c++/client.cpp index 1fce64b1..c2e8eb52 100644 --- a/source/wrappers/c++/client.cpp +++ b/source/wrappers/c++/client.cpp @@ -3,13 +3,9 @@ #include #include #include +#include -#include "accAPI.h" -#include "client.h" #include "clientserver/initStructs.h" -#include "udaGetAPI.h" -#include "udaPutAPI.h" -#include "udaTypes.h" #include "data.hpp" #include "result.hpp" diff --git a/source/wrappers/c++/client.hpp b/source/wrappers/c++/client.hpp index 0b4ae921..5845fcdc 100755 --- a/source/wrappers/c++/client.hpp +++ b/source/wrappers/c++/client.hpp @@ -7,7 +7,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #include "UDA.hpp" diff --git a/source/wrappers/c++/data.hpp b/source/wrappers/c++/data.hpp index bc462ba2..41a84548 100755 --- a/source/wrappers/c++/data.hpp +++ b/source/wrappers/c++/data.hpp @@ -3,7 +3,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" namespace uda { diff --git a/source/wrappers/c++/dim.hpp b/source/wrappers/c++/dim.hpp index 16d8cf60..2035587b 100755 --- a/source/wrappers/c++/dim.hpp +++ b/source/wrappers/c++/dim.hpp @@ -3,7 +3,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #include "vector.hpp" #if defined(_WIN32) diff --git a/source/wrappers/c++/result.cpp b/source/wrappers/c++/result.cpp index 659311a1..6ff007ce 100644 --- a/source/wrappers/c++/result.cpp +++ b/source/wrappers/c++/result.cpp @@ -5,11 +5,7 @@ #include "result.hpp" #include -#include - -#include "accAPI.h" -#include "client.h" -#include "udaTypes.h" +#include #include "array.hpp" #include "string.hpp" diff --git a/source/wrappers/c++/result.hpp b/source/wrappers/c++/result.hpp index 627cdca8..8d4b9ead 100755 --- a/source/wrappers/c++/result.hpp +++ b/source/wrappers/c++/result.hpp @@ -6,7 +6,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #include "dim.hpp" #include "treenode.hpp" diff --git a/source/wrappers/c++/scalar.hpp b/source/wrappers/c++/scalar.hpp index 2c0b7dd5..30cf5c92 100755 --- a/source/wrappers/c++/scalar.hpp +++ b/source/wrappers/c++/scalar.hpp @@ -5,7 +5,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #include "data.hpp" #if defined(_WIN32) diff --git a/source/wrappers/c++/signal.cpp b/source/wrappers/c++/signal.cpp index 3d61eeb6..f21f8aeb 100644 --- a/source/wrappers/c++/signal.cpp +++ b/source/wrappers/c++/signal.cpp @@ -1,8 +1,7 @@ #include "signal.hpp" #include -#include -#include +#include void uda::Signal::put() const { diff --git a/source/wrappers/c++/signal.hpp b/source/wrappers/c++/signal.hpp index afa29db9..cca2271d 100755 --- a/source/wrappers/c++/signal.hpp +++ b/source/wrappers/c++/signal.hpp @@ -2,7 +2,7 @@ #define UDA_WRAPPERS_CPP_SIGNAL_H #include "array.hpp" -#include "export.h" +#include "include/uda/export.h" #if defined(_WIN32) # if !defined(__GNUC__) diff --git a/source/wrappers/c++/string.hpp b/source/wrappers/c++/string.hpp index 37c3f4e6..927a11ad 100755 --- a/source/wrappers/c++/string.hpp +++ b/source/wrappers/c++/string.hpp @@ -5,7 +5,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #include "data.hpp" #if defined(_WIN32) diff --git a/source/wrappers/c++/structdata.hpp b/source/wrappers/c++/structdata.hpp index b0e0ceb0..e7461b93 100755 --- a/source/wrappers/c++/structdata.hpp +++ b/source/wrappers/c++/structdata.hpp @@ -4,7 +4,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #ifdef __GNUC__ # include diff --git a/source/wrappers/c++/treenode.cpp b/source/wrappers/c++/treenode.cpp index 2ec12833..2a9f110f 100644 --- a/source/wrappers/c++/treenode.cpp +++ b/source/wrappers/c++/treenode.cpp @@ -1,8 +1,7 @@ #include "treenode.hpp" -#include "accAPI.h" -#include "accessors.h" -#include "struct.h" +#include +#include uda::TreeNode uda::TreeNode::parent() { @@ -72,20 +71,6 @@ uda::TreeNode uda::TreeNode::findStructureComponent(const std::string& name) return {handle_, findNTreeStructureComponent(logmalloclist, node_, (char*)name.c_str())}; } -void uda::TreeNode::printUserDefinedTypeTable(const std::string& name) -{ - USERDEFINEDTYPELIST* userdefinedtypelist = getIdamUserDefinedTypeList(handle_); - USERDEFINEDTYPE* type = findUserDefinedType(userdefinedtypelist, (char*)name.c_str(), 0); - ::printUserDefinedTypeTable(userdefinedtypelist, *type); -} - -void uda::TreeNode::printUserDefinedTypeTable() -{ - USERDEFINEDTYPELIST* userdefinedtypelist = getIdamUserDefinedTypeList(handle_); - USERDEFINEDTYPE* type = getNodeUserDefinedType(node_); - ::printUserDefinedTypeTable(userdefinedtypelist, *type); -} - int uda::TreeNode::structureCount() { return getNodeStructureCount(node_); diff --git a/source/wrappers/c++/treenode.hpp b/source/wrappers/c++/treenode.hpp index 890fa565..55db156b 100755 --- a/source/wrappers/c++/treenode.hpp +++ b/source/wrappers/c++/treenode.hpp @@ -4,8 +4,8 @@ #include #include -#include "genStructs.h" -#include "export.h" +#include "structures/genStructs.h" +#include "include/uda/export.h" #include "scalar.hpp" #include "vector.hpp" @@ -27,8 +27,6 @@ class LIBRARY_API TreeNode uda::TreeNode child(int num); void printNode(); void printStructureNames(); - void printUserDefinedTypeTable(); - void printUserDefinedTypeTable(const std::string& name); int structureCount(); std::vector structureNames(); diff --git a/source/wrappers/c++/utilities.h b/source/wrappers/c++/utilities.h index 013aa60f..99cb9a89 100644 --- a/source/wrappers/c++/utilities.h +++ b/source/wrappers/c++/utilities.h @@ -1,7 +1,6 @@ #ifndef UtilsClass #define UtilsClass -#include "export.h" #include "singleValue.h" #include #include @@ -28,7 +27,7 @@ namespace UtilitiesNs close to values.size()/2. \param times Array of times. \param values Array of times-series values. \return Time-window average. */ -LIBRARY_API SingleValueNs::SingleValue timeAverage(const SingleValueNs::SingleValue timeWindow, +SingleValueNs::SingleValue timeAverage(const SingleValueNs::SingleValue timeWindow, const SingleValueNs::SingleValue timePoint, const SingleValueNs::SingleValue index, const blitz::Array& times, @@ -41,7 +40,7 @@ LIBRARY_API SingleValueNs::SingleValue timeAverage(const SingleValueNs:: \param AttributeValue The variable into which to place the contents of the XML attribute. \return If successful returns true, otherwise false */ -LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, +bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, SingleValueNs::SingleValue& attributeValue); //! Assigns the value of an XML attribute to a SingleValueNs::SingleValue object. @@ -51,7 +50,7 @@ LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::str \param AttributeValue The variable into which to place the contents of the XML attribute. \return If successful returns true, otherwise false */ -LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, +bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, SingleValueNs::SingleValue& attributeValue); //! Assigns the value of an XML attribute to a blitz::Array object. @@ -65,7 +64,7 @@ LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::str \param AttributeValue The variable into which to place the contents of the XML attribute. \return If successful returns true, otherwise false */ -LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, +bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, blitz::Array& attributeValue); //! Assigns the value of an XML attribute to a blitz::Array object. @@ -79,7 +78,7 @@ LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::str \param AttributeValue The variable into which to place the contents of the XML attribute. \return If successful returns true, otherwise false */ -LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, +bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, blitz::Array& attributeValue); //! Assigns the value of an XML attribute to a blitz::Array object. @@ -93,7 +92,7 @@ LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::str \param AttributeValue The variable into which to place the contents of the XML attribute. \return If successful returns true, otherwise false */ -LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, +bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, blitz::Array& attributeValue); //! Assigns the value of an XML attribute to a std::string object. @@ -103,7 +102,7 @@ LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::str \param AttributeValue The variable into which to place the contents of the XML attribute (if it hadn't been specified, then returns "notSet"). \return If the variable has been set returns true, otherwise false. */ -LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, +bool getAttributeValue(const QDomElement& domElement, const std::string& attributeName, std::string& attributeValue); /*! @@ -118,7 +117,7 @@ LIBRARY_API bool getAttributeValue(const QDomElement& domElement, const std::str the string will be something like "development/main" (for the main development banch) or "development/nmercadier" for a subranch in the development thread. */ -LIBRARY_API std::string getEfitVersion(); +std::string getEfitVersion(); //! Returns a "NaN" into a floating point double variable type. /*! @@ -128,10 +127,10 @@ LIBRARY_API std::string getEfitVersion(); infinity. Nw we divid the number by itself, and the result is a "quiet" NaN. \return value NaN. */ -LIBRARY_API double getNaN(); +double getNaN(); //! Function opens an XML file, parses it and returns a reference to the DOM document. -LIBRARY_API bool openAndParseXmlFile(const std::string& xmlFileName, QDomDocument& domDocument); +bool openAndParseXmlFile(const std::string& xmlFileName, QDomDocument& domDocument); ///////////////////////////////////////////////////////////////////////////// // diff --git a/source/wrappers/c++/vector.hpp b/source/wrappers/c++/vector.hpp index 36d4a3e6..39fbb2f5 100755 --- a/source/wrappers/c++/vector.hpp +++ b/source/wrappers/c++/vector.hpp @@ -7,7 +7,7 @@ #include #include -#include "export.h" +#include "include/uda/export.h" #include "data.hpp" #if defined(_WIN32) diff --git a/source/wrappers/fortran/accAPI_F.c b/source/wrappers/fortran/accAPI_F.c index e3d81470..aacd3ee8 100755 --- a/source/wrappers/fortran/accAPI_F.c +++ b/source/wrappers/fortran/accAPI_F.c @@ -13,9 +13,9 @@ #include #include -#include -#include -#include +#include "logging/logging.h" +#include "clientserver/udaTypes.h" +#include "clientserver/stringUtils.h" #include "accAPI.h" #include "idamClient.h" diff --git a/source/wrappers/idl/idamStructs.c b/source/wrappers/idl/idamStructs.c index 1dd5f77a..5b75d311 100755 --- a/source/wrappers/idl/idamStructs.c +++ b/source/wrappers/idl/idamStructs.c @@ -7,10 +7,10 @@ #include "idl_export.h" -#include +#include "client/accAPI.h" #include #include -#include +#include "clientserver/stringUtils.h" typedef struct { IDL_KW_RESULT_FIRST_FIELD; diff --git a/source/wrappers/idl/idam_dlm.c b/source/wrappers/idl/idam_dlm.c index 149f5d60..f63c294e 100755 --- a/source/wrappers/idl/idam_dlm.c +++ b/source/wrappers/idl/idam_dlm.c @@ -18,16 +18,16 @@ #include "idl_export.h" // IDL API Header -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "client/udaClient.h" +#include "client/accAPI.h" +#include "client/udaGetAPI.h" +#include "client/udaPutAPI.h" +#include "client/clientAPI.h" +#include "client/clientMDS.h" +#include "clientserver/stringUtils.h" +#include "clientserver/udaTypes.h" +#include "clientserver/initStructs.h" +#include "clientserver/printStructs.h" #ifndef NDEBUG #define NDEBUG 0 diff --git a/source/wrappers/java/idam_jni.h b/source/wrappers/java/idam_jni.h index efe445b3..8ce8df7a 100644 --- a/source/wrappers/java/idam_jni.h +++ b/source/wrappers/java/idam_jni.h @@ -5,8 +5,6 @@ #ifndef _Included_Idam # define _Included_Idam -# include "export.h" - # ifdef __cplusplus extern "C" { # endif @@ -15,406 +13,406 @@ extern "C" { * Method: idamGetAPI * Signature: (Ljava/lang/String;Ljava/lang/String;)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_idamGetAPI(JNIEnv*, jclass, jstring, jstring); +JNIEXPORT jint JNICALL Java_Idam_idamGetAPI(JNIEnv*, jclass, jstring, jstring); /* * Class: Idam * Method: idamFree * Signature: (I)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_idamFree(JNIEnv*, jclass, jint); +JNIEXPORT void JNICALL Java_Idam_idamFree(JNIEnv*, jclass, jint); /* * Class: Idam * Method: idamFreeAll * Signature: ()V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_idamFreeAll(JNIEnv*, jclass); +JNIEXPORT void JNICALL Java_Idam_idamFreeAll(JNIEnv*, jclass); /* * Class: Idam * Method: setIdamPrivateFlag * Signature: (I)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_setIdamPrivateFlag(JNIEnv*, jclass, jint); +JNIEXPORT void JNICALL Java_Idam_setIdamPrivateFlag(JNIEnv*, jclass, jint); /* * Class: Idam * Method: setIdamClientFlag * Signature: (I)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_setIdamClientFlag(JNIEnv*, jclass, jint); +JNIEXPORT void JNICALL Java_Idam_setIdamClientFlag(JNIEnv*, jclass, jint); /* * Class: Idam * Method: setIdamProperty * Signature: (Ljava/lang/String;)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_setIdamProperty(JNIEnv*, jclass, jstring); +JNIEXPORT void JNICALL Java_Idam_setIdamProperty(JNIEnv*, jclass, jstring); /* * Class: Idam * Method: getIdamProperty * Signature: (Ljava/lang/String;)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamProperty(JNIEnv*, jclass, jstring); +JNIEXPORT jint JNICALL Java_Idam_getIdamProperty(JNIEnv*, jclass, jstring); /* * Class: Idam * Method: resetIdamPrivateFlag * Signature: (I)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamPrivateFlag(JNIEnv*, jclass, jint); +JNIEXPORT void JNICALL Java_Idam_resetIdamPrivateFlag(JNIEnv*, jclass, jint); /* * Class: Idam * Method: resetIdamClientFlag * Signature: (I)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamClientFlag(JNIEnv*, jclass, jint); +JNIEXPORT void JNICALL Java_Idam_resetIdamClientFlag(JNIEnv*, jclass, jint); /* * Class: Idam * Method: resetIdamProperty * Signature: (Ljava/lang/String;)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamProperty(JNIEnv*, jclass, jstring); +JNIEXPORT void JNICALL Java_Idam_resetIdamProperty(JNIEnv*, jclass, jstring); /* * Class: Idam * Method: resetIdamProperties * Signature: ()V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamProperties(JNIEnv*, jclass); +JNIEXPORT void JNICALL Java_Idam_resetIdamProperties(JNIEnv*, jclass); /* * Class: Idam * Method: putIdamServer * Signature: (Ljava/lang/String;I)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_putIdamServer(JNIEnv*, jclass, jstring, jint); +JNIEXPORT void JNICALL Java_Idam_putIdamServer(JNIEnv*, jclass, jstring, jint); /* * Class: Idam * Method: putIdamServerHost * Signature: (Ljava/lang/String;)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_putIdamServerHost(JNIEnv*, jclass, jstring); +JNIEXPORT void JNICALL Java_Idam_putIdamServerHost(JNIEnv*, jclass, jstring); /* * Class: Idam * Method: putIdamServerPort * Signature: (I)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_putIdamServerPort(JNIEnv*, jclass, jint); +JNIEXPORT void JNICALL Java_Idam_putIdamServerPort(JNIEnv*, jclass, jint); /* * Class: Idam * Method: putIdamServerSocket * Signature: (I)V */ -LIBRARY_API JNIEXPORT void JNICALL Java_Idam_putIdamServerSocket(JNIEnv*, jclass, jint); +JNIEXPORT void JNICALL Java_Idam_putIdamServerSocket(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamServerHost * Signature: ()Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamServerHost(JNIEnv*, jclass); +JNIEXPORT jstring JNICALL Java_Idam_getIdamServerHost(JNIEnv*, jclass); /* * Class: Idam * Method: getIdamServerPort * Signature: ()I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamServerPort(JNIEnv*, jclass); +JNIEXPORT jint JNICALL Java_Idam_getIdamServerPort(JNIEnv*, jclass); /* * Class: Idam * Method: getIdamServerSocket * Signature: ()I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamServerSocket(JNIEnv*, jclass); +JNIEXPORT jint JNICALL Java_Idam_getIdamServerSocket(JNIEnv*, jclass); /* * Class: Idam * Method: getIdamClientVersion * Signature: ()I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamClientVersion(JNIEnv*, jclass); +JNIEXPORT jint JNICALL Java_Idam_getIdamClientVersion(JNIEnv*, jclass); /* * Class: Idam * Method: getIdamServerVersion * Signature: ()I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamServerVersion(JNIEnv*, jclass); +JNIEXPORT jint JNICALL Java_Idam_getIdamServerVersion(JNIEnv*, jclass); /* * Class: Idam * Method: getIdamServerErrorCode * Signature: ()I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamServerErrorCode(JNIEnv*, jclass); +JNIEXPORT jint JNICALL Java_Idam_getIdamServerErrorCode(JNIEnv*, jclass); /* * Class: Idam * Method: getIdamServerErrorMsg * Signature: ()Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamServerErrorMsg(JNIEnv*, jclass); +JNIEXPORT jstring JNICALL Java_Idam_getIdamServerErrorMsg(JNIEnv*, jclass); /* * Class: Idam * Method: getIdamServerErrorStackSize * Signature: ()I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamServerErrorStackSize(JNIEnv*, jclass); +JNIEXPORT jint JNICALL Java_Idam_getIdamServerErrorStackSize(JNIEnv*, jclass); /* * Class: Idam * Method: getIdamServerErrorStackRecordType * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamServerErrorStackRecordType(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamServerErrorStackRecordType(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamServerErrorStackRecordCode * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamServerErrorStackRecordCode(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamServerErrorStackRecordCode(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamServerErrorStackRecordLocation * Signature: (I)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamServerErrorStackRecordLocation(JNIEnv*, jclass, jint); +JNIEXPORT jstring JNICALL Java_Idam_getIdamServerErrorStackRecordLocation(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamServerErrorStackRecordMsg * Signature: (I)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamServerErrorStackRecordMsg(JNIEnv*, jclass, jint); +JNIEXPORT jstring JNICALL Java_Idam_getIdamServerErrorStackRecordMsg(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamErrorCode * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamErrorCode(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamErrorCode(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamErrorMsg * Signature: (I)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamErrorMsg(JNIEnv*, jclass, jint); +JNIEXPORT jstring JNICALL Java_Idam_getIdamErrorMsg(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamSignalStatus * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamSignalStatus(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamSignalStatus(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamSourceStatus * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamSourceStatus(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamSourceStatus(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamDataStatus * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamDataStatus(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamDataStatus(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamLastHandle * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamLastHandle(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamLastHandle(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamDataNum * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamDataNum(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamDataNum(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamRank * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamRank(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamRank(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamOrder * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamOrder(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamOrder(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamDataType * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamDataType(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamDataType(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamErrorType * Signature: (I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamErrorType(JNIEnv*, jclass, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamErrorType(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamDataTypeId * Signature: (Ljava/lang/String;)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamDataTypeId(JNIEnv*, jclass, jstring); +JNIEXPORT jint JNICALL Java_Idam_getIdamDataTypeId(JNIEnv*, jclass, jstring); /* * Class: Idam * Method: getIdamDataLabel * Signature: (I)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamDataLabel(JNIEnv*, jclass, jint); +JNIEXPORT jstring JNICALL Java_Idam_getIdamDataLabel(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamDataUnits * Signature: (I)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamDataUnits(JNIEnv*, jclass, jint); +JNIEXPORT jstring JNICALL Java_Idam_getIdamDataUnits(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamDataDesc * Signature: (I)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamDataDesc(JNIEnv*, jclass, jint); +JNIEXPORT jstring JNICALL Java_Idam_getIdamDataDesc(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamFloatData * Signature: (I)[F */ -LIBRARY_API JNIEXPORT jfloatArray JNICALL Java_Idam_getIdamFloatData(JNIEnv*, jclass, jint); +JNIEXPORT jfloatArray JNICALL Java_Idam_getIdamFloatData(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamDoubleData * Signature: (I)[D */ -LIBRARY_API JNIEXPORT jdoubleArray JNICALL Java_Idam_getIdamDoubleData(JNIEnv*, jclass, jint); +JNIEXPORT jdoubleArray JNICALL Java_Idam_getIdamDoubleData(JNIEnv*, jclass, jint); /* * Class: Idam * Method: castIdamDataToFloat * Signature: (I)[F */ -LIBRARY_API JNIEXPORT jfloatArray JNICALL Java_Idam_castIdamDataToFloat(JNIEnv*, jclass, jint); +JNIEXPORT jfloatArray JNICALL Java_Idam_castIdamDataToFloat(JNIEnv*, jclass, jint); /* * Class: Idam * Method: castIdamDataToDouble * Signature: (I)[D */ -LIBRARY_API JNIEXPORT jdoubleArray JNICALL Java_Idam_castIdamDataToDouble(JNIEnv*, jclass, jint); +JNIEXPORT jdoubleArray JNICALL Java_Idam_castIdamDataToDouble(JNIEnv*, jclass, jint); /* * Class: Idam * Method: getIdamDimNum * Signature: (II)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamDimNum(JNIEnv*, jclass, jint, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamDimNum(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: getIdamDimType * Signature: (II)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamDimType(JNIEnv*, jclass, jint, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamDimType(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: getIdamDimErrorType * Signature: (II)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamDimErrorType(JNIEnv*, jclass, jint, jint); +JNIEXPORT jint JNICALL Java_Idam_getIdamDimErrorType(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: getIdamDimLabel * Signature: (II)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamDimLabel(JNIEnv*, jclass, jint, jint); +JNIEXPORT jstring JNICALL Java_Idam_getIdamDimLabel(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: getIdamDimUnits * Signature: (II)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getIdamDimUnits(JNIEnv*, jclass, jint, jint); +JNIEXPORT jstring JNICALL Java_Idam_getIdamDimUnits(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: getIdamFloatDimData * Signature: (II)[F */ -LIBRARY_API JNIEXPORT jfloatArray JNICALL Java_Idam_getIdamFloatDimData(JNIEnv*, jclass, jint, jint); +JNIEXPORT jfloatArray JNICALL Java_Idam_getIdamFloatDimData(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: getIdamDoubleDimData * Signature: (II)[D */ -LIBRARY_API JNIEXPORT jdoubleArray JNICALL Java_Idam_getIdamDoubleDimData(JNIEnv*, jclass, jint, jint); +JNIEXPORT jdoubleArray JNICALL Java_Idam_getIdamDoubleDimData(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: castIdamDimDataToFloat * Signature: (II)[F */ -LIBRARY_API JNIEXPORT jfloatArray JNICALL Java_Idam_castIdamDimDataToFloat(JNIEnv*, jclass, jint, jint); +JNIEXPORT jfloatArray JNICALL Java_Idam_castIdamDimDataToFloat(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: castIdamDimDataToDouble * Signature: (II)[D */ -LIBRARY_API JNIEXPORT jdoubleArray JNICALL Java_Idam_castIdamDimDataToDouble(JNIEnv*, jclass, jint, jint); +JNIEXPORT jdoubleArray JNICALL Java_Idam_castIdamDimDataToDouble(JNIEnv*, jclass, jint, jint); /* * Class: Idam * Method: getLine * Signature: (Ljava/lang/String;)Ljava/lang/String; */ -LIBRARY_API JNIEXPORT jstring JNICALL Java_Idam_getLine(JNIEnv*, jclass, jstring); +JNIEXPORT jstring JNICALL Java_Idam_getLine(JNIEnv*, jclass, jstring); /* * Class: Idam * Method: sumArray1 * Signature: ([I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_sumArray1(JNIEnv*, jclass, jintArray); +JNIEXPORT jint JNICALL Java_Idam_sumArray1(JNIEnv*, jclass, jintArray); /* * Class: Idam * Method: sumArray2 * Signature: ([I)I */ -LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_sumArray2(JNIEnv*, jclass, jintArray); +JNIEXPORT jint JNICALL Java_Idam_sumArray2(JNIEnv*, jclass, jintArray); # ifdef __cplusplus } diff --git a/test/plugins/test2_testplugin.cpp b/test/plugins/test2_testplugin.cpp index b2823947..72bbd683 100755 --- a/test/plugins/test2_testplugin.cpp +++ b/test/plugins/test2_testplugin.cpp @@ -1,11 +1,10 @@ #define CATCH_CONFIG_MAIN #include "catch.hpp" -#include "udaTypes.h" +#include "include/uda/udaTypes.h" #include "clientserver/initStructs.h" #include #include -#include "struct.h" #include #include #include