From 09bd8493ef85a874bfd94246c418efc77a3b7ad1 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 20 Jun 2024 13:32:09 +0100 Subject: [PATCH 01/54] WIP:Security fix to limit which folders/files can be accessed --- source/plugins/CMakeLists.txt | 2 +- source/plugins/bytes/bytesPlugin.cpp | 41 +++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/source/plugins/CMakeLists.txt b/source/plugins/CMakeLists.txt index 52b03f92..573d6598 100755 --- a/source/plugins/CMakeLists.txt +++ b/source/plugins/CMakeLists.txt @@ -82,7 +82,7 @@ if( BUILD_SHARED_LIBS ) add_library( plugins-shared SHARED $ ) endif() -set( LINK_LIB ${LIBXML2_LIBRARIES} fmt::fmt ) +set( LINK_LIB ${LIBXML2_LIBRARIES} fmt::fmt Boost::boost ) if( WIN32 OR MINGW ) if( MINGW ) set( LINK_LIB ${LINK_LIB} ${XDR_LIBRARIES} ws2_32 dlfcn-win32::dl stdc++ ) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index fb6950b7..47b3ce5f 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -5,6 +5,9 @@ #include "readBytesNonOptimally.h" +#include +#include + static int do_help(IDAM_PLUGIN_INTERFACE* idam_plugin_interface); static int do_version(IDAM_PLUGIN_INTERFACE* idam_plugin_interface); @@ -143,6 +146,37 @@ int do_maxinterfaceversion(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) //---------------------------------------------------------------------------------------- // Add functionality here .... + +// Check if path starts with pre-approved file path +// Raises Plugin Error if not +void check_allowed_path(char* expandedPath) { + boost::filesystem::path full_path; + try { + full_path = boost::filesystem::canonical(extendedPath); + } catch (boost::filesystem::filesystem_error e) { + UDA_LOG(UDA_LOG_DEBUG, "Filepath [%s] not found! Error: %s\n", file_path.string().c_str(), 3); + RAISE_PLUGIN_ERROR("Provided File Path Not Found!\n"); + return; + } + char* env_str = std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"); + std::vector allowed_paths; + if (env_str) { // gotta check if environment variable exists before using it + boost::algorithm::split(allowed_paths, std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"), boost::is_any_of(",")); + } + bool good_path = false; + for (std::string allowed_path : allowed_paths) { + if (full_path.string().rfind(allowed_path.c_str(), 0) != std::string::npos) { + good_path = true; + break; + } + } + if (!good_path) { + UDA_LOG(UDA_LOG_DEBUG, "Bad Path Provided %s\n", expandedPath); + RAISE_PLUGIN_ERROR("Bad File Path Provided\n"); + } + return; +} + int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) { DATA_SOURCE* data_source = idam_plugin_interface->data_source; @@ -154,7 +188,12 @@ int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) StringCopy(data_source->path, path, MAXPATH); UDA_LOG(UDA_LOG_DEBUG, "expandEnvironmentvariables! \n"); - expand_environment_variables(data_source->path); + expand_environment_variables(data_source->path); + + boost::filesystem::path boost_path = boost::filesystem::canonical(argv[1]); + std::cout << boost_path << std::endl; + + check_allowed_path(data_source->path); return readBytes(*data_source, *signal_desc, data_block, idam_plugin_interface->environment); } From ffb23fe80968221f02ebea881897f72dca49fea0 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 20 Jun 2024 13:43:49 +0100 Subject: [PATCH 02/54] WIP: Fixing bug in CMakeList for boost --- source/plugins/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/plugins/CMakeLists.txt b/source/plugins/CMakeLists.txt index 573d6598..5819573c 100755 --- a/source/plugins/CMakeLists.txt +++ b/source/plugins/CMakeLists.txt @@ -3,6 +3,7 @@ find_package( LibXml2 REQUIRED ) find_package( fmt REQUIRED ) +find_package( Boost REQUIRED ) if( WIN32 OR MINGW ) find_package( XDR REQUIRED ) From 419fb6ead29f76edad0e585fadde27ea4e2f99d0 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 20 Jun 2024 15:05:07 +0100 Subject: [PATCH 03/54] WIP: Boost is annoying, wrote my own functions, anyone can feel free to rewrite but security issue needs to be solved --- source/plugins/CMakeLists.txt | 3 +- source/plugins/bytes/bytesPlugin.cpp | 63 +++++++++++++++++++++------- 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/source/plugins/CMakeLists.txt b/source/plugins/CMakeLists.txt index 5819573c..52b03f92 100755 --- a/source/plugins/CMakeLists.txt +++ b/source/plugins/CMakeLists.txt @@ -3,7 +3,6 @@ find_package( LibXml2 REQUIRED ) find_package( fmt REQUIRED ) -find_package( Boost REQUIRED ) if( WIN32 OR MINGW ) find_package( XDR REQUIRED ) @@ -83,7 +82,7 @@ if( BUILD_SHARED_LIBS ) add_library( plugins-shared SHARED $ ) endif() -set( LINK_LIB ${LIBXML2_LIBRARIES} fmt::fmt Boost::boost ) +set( LINK_LIB ${LIBXML2_LIBRARIES} fmt::fmt ) if( WIN32 OR MINGW ) if( MINGW ) set( LINK_LIB ${LINK_LIB} ${XDR_LIBRARIES} ws2_32 dlfcn-win32::dl stdc++ ) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 47b3ce5f..20aa1ee8 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -148,28 +148,63 @@ int do_maxinterfaceversion(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Add functionality here .... // Check if path starts with pre-approved file path -// Raises Plugin Error if not -void check_allowed_path(char* expandedPath) { - boost::filesystem::path full_path; - try { - full_path = boost::filesystem::canonical(extendedPath); - } catch (boost::filesystem::filesystem_error e) { - UDA_LOG(UDA_LOG_DEBUG, "Filepath [%s] not found! Error: %s\n", file_path.string().c_str(), 3); - RAISE_PLUGIN_ERROR("Provided File Path Not Found!\n"); - return; +// Raises Plugin Error if notstd::vector split_string(const std::string& input_string, const std::string& delim) { + size_t pos = 0, prev_pos = 0, delim_len = delim.length(); + std::vector string_list = {}; + // Using for loop to make sure the loop ends, should cover all cases, + // including if the string made up of just the delim. + for (int i=0; i string_list, std::string delim) { + std::string str; + std::string tmp_delim = ""; + for (std::string element : string_list) { + str += tmp_delim + element; + tmp_delim = delim; + } + return str; +} + std::string resolve_filepath(char* path) { + std::vector foldernames = split_string(path, "/"); + for (int i=foldernames.size()-1; i>=0; i--) { + if (foldernames[i].compare("..") == 0) { + foldernames.erase(foldernames.begin() + i); + foldernames.erase(foldernames.begin() + i-1); + i--; + } } - char* env_str = std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"); + if (foldernames[0].compare(".") == 0) { + foldernames[0] = std::getenv("$PWD"); + } else if (foldernames[0].compare("~") == 0) { + foldernames[0] = (std::string("/home/")+std::getenv("USER")).c_str(); + } + return join_string(foldernames, "/"); +} + +void check_allowed_path(char* expandedPath) { + char* env_str = std::getenv("HOME"); std::vector allowed_paths; if (env_str) { // gotta check if environment variable exists before using it - boost::algorithm::split(allowed_paths, std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"), boost::is_any_of(",")); - } + allowed_paths = split_string(env_str, ","); + } + std::string resolved_path = resolve_filepath(expandedPath); bool good_path = false; for (std::string allowed_path : allowed_paths) { - if (full_path.string().rfind(allowed_path.c_str(), 0) != std::string::npos) { + if (resolved_path.rfind(allowed_path.c_str(), 0) != std::string::npos) { good_path = true; break; } - } + } if (!good_path) { UDA_LOG(UDA_LOG_DEBUG, "Bad Path Provided %s\n", expandedPath); RAISE_PLUGIN_ERROR("Bad File Path Provided\n"); From 5165e57fb4df7f240b3520045fc51240c3d6bf57 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 20 Jun 2024 15:44:45 +0100 Subject: [PATCH 04/54] missing newline on split string declaration --- source/plugins/bytes/bytesPlugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 20aa1ee8..e89235cd 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -148,7 +148,8 @@ int do_maxinterfaceversion(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Add functionality here .... // Check if path starts with pre-approved file path -// Raises Plugin Error if notstd::vector split_string(const std::string& input_string, const std::string& delim) { +// Raises Plugin Error if not +std::vector split_string(const std::string& input_string, const std::string& delim) { size_t pos = 0, prev_pos = 0, delim_len = delim.length(); std::vector string_list = {}; // Using for loop to make sure the loop ends, should cover all cases, From e3df5b262205127da3f5799f160644e3bfd1adb5 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 20 Jun 2024 15:59:01 +0100 Subject: [PATCH 05/54] WIP: fixing relating to strict nature of comipilation --- source/plugins/bytes/bytesPlugin.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index e89235cd..82228d65 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -154,7 +154,7 @@ std::vector split_string(const std::string& input_string, const std std::vector string_list = {}; // Using for loop to make sure the loop ends, should cover all cases, // including if the string made up of just the delim. - for (int i=0; i string_list, std::string delim) return join_string(foldernames, "/"); } -void check_allowed_path(char* expandedPath) { +int check_allowed_path(char* expandedPath) { char* env_str = std::getenv("HOME"); std::vector allowed_paths; if (env_str) { // gotta check if environment variable exists before using it @@ -210,7 +210,7 @@ void check_allowed_path(char* expandedPath) { UDA_LOG(UDA_LOG_DEBUG, "Bad Path Provided %s\n", expandedPath); RAISE_PLUGIN_ERROR("Bad File Path Provided\n"); } - return; + return 0; } int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) @@ -226,9 +226,6 @@ int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) UDA_LOG(UDA_LOG_DEBUG, "expandEnvironmentvariables! \n"); expand_environment_variables(data_source->path); - boost::filesystem::path boost_path = boost::filesystem::canonical(argv[1]); - std::cout << boost_path << std::endl; - check_allowed_path(data_source->path); return readBytes(*data_source, *signal_desc, data_block, idam_plugin_interface->environment); From eae1421d643cf7978c5b5f8e1f2f5d2a4f62a1e2 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 20 Jun 2024 16:17:19 +0100 Subject: [PATCH 06/54] umm maybe use instead of /home/jmeasure... --- source/plugins/bytes/bytesPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 82228d65..442ac5dd 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -193,7 +193,7 @@ std::string join_string(std::vector string_list, std::string delim) } int check_allowed_path(char* expandedPath) { - char* env_str = std::getenv("HOME"); + char* env_str = std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"); std::vector allowed_paths; if (env_str) { // gotta check if environment variable exists before using it allowed_paths = split_string(env_str, ","); From d9ca3b98890c6063a1fc31fbd031bcba06b6fcf9 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 20 Jun 2024 17:08:46 +0100 Subject: [PATCH 07/54] Adding check for more .. in folder path than folder names --- source/plugins/bytes/bytesPlugin.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 442ac5dd..75375326 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -175,13 +175,26 @@ std::string join_string(std::vector string_list, std::string delim) } return str; } - std::string resolve_filepath(char* path) { + +std::string resolve_filepath(char* path) { std::vector foldernames = split_string(path, "/"); - for (int i=foldernames.size()-1; i>=0; i--) { + // checking the number of '..' doesnt exceed the number of actual folders + int counter = 0; + for (std::string folder : foldernames) { + if (folder.compare("..") == 0) { + counter++; + } + } + if (counter > (int)foldernames.size()/2) { + RAISE_PLUGIN_ERROR("Illegal Path provided\n"); + } + int i = -1; + while ( i < (int)foldernames.size()) { + i++; if (foldernames[i].compare("..") == 0) { foldernames.erase(foldernames.begin() + i); foldernames.erase(foldernames.begin() + i-1); - i--; + i -= 2; } } if (foldernames[0].compare(".") == 0) { From fbe565007d27ab412e8d3fc8506900db5e9e4449 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 20 Jun 2024 17:15:39 +0100 Subject: [PATCH 08/54] bug RAISE_PLUGIN_ERROR returns a int so incompatible with std::string function, moved check to outside function --- source/plugins/bytes/bytesPlugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 75375326..285df4b5 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -186,7 +186,7 @@ std::string resolve_filepath(char* path) { } } if (counter > (int)foldernames.size()/2) { - RAISE_PLUGIN_ERROR("Illegal Path provided\n"); + return ""; } int i = -1; while ( i < (int)foldernames.size()) { @@ -212,6 +212,9 @@ int check_allowed_path(char* expandedPath) { allowed_paths = split_string(env_str, ","); } std::string resolved_path = resolve_filepath(expandedPath); + if (resolved_path.compare("") == 0) { + RAISE_PLUGIN_ERROR("Illegal File Path Provided\n"); + } bool good_path = false; for (std::string allowed_path : allowed_paths) { if (resolved_path.rfind(allowed_path.c_str(), 0) != std::string::npos) { From aeba019fe20826664688b9a707680444aa23c20e Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Fri, 21 Jun 2024 15:52:30 +0100 Subject: [PATCH 09/54] Adam adding filesystem requirements to CMakelist, bytes plugin updated to use filesystem library --- source/plugins/bytes/CMakeLists.txt | 1 + source/plugins/bytes/bytesPlugin.cpp | 55 +++++++++------------------- 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/source/plugins/bytes/CMakeLists.txt b/source/plugins/bytes/CMakeLists.txt index 49045947..dfae148c 100644 --- a/source/plugins/bytes/CMakeLists.txt +++ b/source/plugins/bytes/CMakeLists.txt @@ -20,4 +20,5 @@ uda_plugin( ${LIBXML2_INCLUDE_DIR} EXTRA_LINK_LIBS ${LIBXML2_LIBRARIES} + stdc++fs ) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 285df4b5..d055c1e2 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -5,8 +5,7 @@ #include "readBytesNonOptimally.h" -#include -#include +#include static int do_help(IDAM_PLUGIN_INTERFACE* idam_plugin_interface); @@ -149,6 +148,7 @@ int do_maxinterfaceversion(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Check if path starts with pre-approved file path // Raises Plugin Error if not + std::vector split_string(const std::string& input_string, const std::string& delim) { size_t pos = 0, prev_pos = 0, delim_len = delim.length(); std::vector string_list = {}; @@ -165,7 +165,7 @@ std::vector split_string(const std::string& input_string, const std } return string_list; } - +/* std::string join_string(std::vector string_list, std::string delim) { std::string str; std::string tmp_delim = ""; @@ -174,61 +174,41 @@ std::string join_string(std::vector string_list, std::string delim) tmp_delim = delim; } return str; -} +}*/ -std::string resolve_filepath(char* path) { - std::vector foldernames = split_string(path, "/"); - // checking the number of '..' doesnt exceed the number of actual folders - int counter = 0; - for (std::string folder : foldernames) { - if (folder.compare("..") == 0) { - counter++; - } - } - if (counter > (int)foldernames.size()/2) { - return ""; - } - int i = -1; - while ( i < (int)foldernames.size()) { - i++; - if (foldernames[i].compare("..") == 0) { - foldernames.erase(foldernames.begin() + i); - foldernames.erase(foldernames.begin() + i-1); - i -= 2; - } - } - if (foldernames[0].compare(".") == 0) { - foldernames[0] = std::getenv("$PWD"); - } else if (foldernames[0].compare("~") == 0) { - foldernames[0] = (std::string("/home/")+std::getenv("USER")).c_str(); - } - return join_string(foldernames, "/"); -} int check_allowed_path(char* expandedPath) { + UDA_LOG(UDA_LOG_DEBUG, "Entered CHECK ALLOWED PATH: %s\n", expandedPath); char* env_str = std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"); std::vector allowed_paths; if (env_str) { // gotta check if environment variable exists before using it allowed_paths = split_string(env_str, ","); } - std::string resolved_path = resolve_filepath(expandedPath); - if (resolved_path.compare("") == 0) { - RAISE_PLUGIN_ERROR("Illegal File Path Provided\n"); + UDA_LOG(UDA_LOG_DEBUG, "CHECKED UDA_BYTES_PLUGIN_ALLOWED_PATHS exists\n"); + std::string resolved_path; + try { + resolved_path = std::filesystem::canonical(expandedPath).string(); + } catch (std::filesystem::filesystem_error&) { + RAISE_PLUGIN_ERROR("File or Directory Not Found"); } + UDA_LOG(UDA_LOG_DEBUG, "NOT ILLEGAL FILE PATH: %s\n", resolved_path.c_str()); bool good_path = false; for (std::string allowed_path : allowed_paths) { if (resolved_path.rfind(allowed_path.c_str(), 0) != std::string::npos) { + UDA_LOG(UDA_LOG_DEBUG, "PATH ALLOWED\n"); good_path = true; break; } } if (!good_path) { UDA_LOG(UDA_LOG_DEBUG, "Bad Path Provided %s\n", expandedPath); - RAISE_PLUGIN_ERROR("Bad File Path Provided\n"); + RAISE_PLUGIN_ERROR("Bad File Path Provided"); } return 0; } + + int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) { DATA_SOURCE* data_source = idam_plugin_interface->data_source; @@ -238,7 +218,8 @@ int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) const char* path; FIND_REQUIRED_STRING_VALUE(idam_plugin_interface->request_data->nameValueList, path); - StringCopy(data_source->path, path, MAXPATH); + + StringCopy(data_source->path, path, MAXPATH); UDA_LOG(UDA_LOG_DEBUG, "expandEnvironmentvariables! \n"); expand_environment_variables(data_source->path); From d5a37ba13fddd94a00e41e5f24f17f6792ef2d9d Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Fri, 21 Jun 2024 16:46:43 +0100 Subject: [PATCH 10/54] Adding Boost, updating mast.l.cfg to populate the allowed paths --- source/etc/machine.d/mast.l.cfg | 2 + source/plugins/bytes/CMakeLists.txt | 11 +++++- source/plugins/bytes/bytesPlugin.cpp | 57 +++++++--------------------- 3 files changed, 25 insertions(+), 45 deletions(-) diff --git a/source/etc/machine.d/mast.l.cfg b/source/etc/machine.d/mast.l.cfg index 9882e812..1013e545 100644 --- a/source/etc/machine.d/mast.l.cfg +++ b/source/etc/machine.d/mast.l.cfg @@ -12,6 +12,8 @@ export UDA_PORT2=${UDA_PORT} DATA_ARCHIVE=/net/raidsrvr/data +export UDA_BYTES_PLUGIN_ALLOWED_PATHS="/net/raidsrvr/data,/common/uda-scratch,/projects/physics/omfit" + export MAST_DATA=${DATA_ARCHIVE}/MAST_Data export MAST_IMAGES=${DATA_ARCHIVE}/MAST_IMAGES export MAST_NEW=${DATA_ARCHIVE}/MAST_NEW diff --git a/source/plugins/bytes/CMakeLists.txt b/source/plugins/bytes/CMakeLists.txt index dfae148c..a33502e8 100644 --- a/source/plugins/bytes/CMakeLists.txt +++ b/source/plugins/bytes/CMakeLists.txt @@ -1,6 +1,7 @@ ######################################################################################################################## # Dependencies find_package( LibXml2 QUIET ) +find_package( Boost COMPONENTS system ) if( NOT LIBXML2_FOUND ) message( WARNING "Libxml2 not found - skipping template plugin" ) @@ -9,6 +10,13 @@ endif() include( plugins ) +set ( STDFS_VAR "" ) +if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9.1 ) + set ( STDFS_VAR "stdc++fs" ) +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9.0) + set ( STDFS_VAR "c++fs" ) +endif() + uda_plugin( NAME BYTES ENTRY_FUNC bytesPlugin @@ -20,5 +28,6 @@ uda_plugin( ${LIBXML2_INCLUDE_DIR} EXTRA_LINK_LIBS ${LIBXML2_LIBRARIES} - stdc++fs + Boost::system + ${STDFS_VAR} ) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index d055c1e2..1a521a46 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -6,6 +6,7 @@ #include "readBytesNonOptimally.h" #include +#include static int do_help(IDAM_PLUGIN_INTERFACE* idam_plugin_interface); @@ -148,61 +149,29 @@ int do_maxinterfaceversion(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Check if path starts with pre-approved file path // Raises Plugin Error if not - -std::vector split_string(const std::string& input_string, const std::string& delim) { - size_t pos = 0, prev_pos = 0, delim_len = delim.length(); - std::vector string_list = {}; - // Using for loop to make sure the loop ends, should cover all cases, - // including if the string made up of just the delim. - for (size_t i=0; i string_list, std::string delim) { - std::string str; - std::string tmp_delim = ""; - for (std::string element : string_list) { - str += tmp_delim + element; - tmp_delim = delim; - } - return str; -}*/ - - int check_allowed_path(char* expandedPath) { - UDA_LOG(UDA_LOG_DEBUG, "Entered CHECK ALLOWED PATH: %s\n", expandedPath); + std::string full_path; + try { + full_path = std::filesystem::canonical(expandedPath).string(); + } catch (std::filesystem::filesystem_error& e) { + UDA_LOG(UDA_LOG_DEBUG, "Filepath [%s] not found! Error: %s\n", full_path.c_str(), e.what()); + RAISE_PLUGIN_ERROR("Provided File Path Not Found!\n"); + } char* env_str = std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"); std::vector allowed_paths; if (env_str) { // gotta check if environment variable exists before using it - allowed_paths = split_string(env_str, ","); - } - UDA_LOG(UDA_LOG_DEBUG, "CHECKED UDA_BYTES_PLUGIN_ALLOWED_PATHS exists\n"); - std::string resolved_path; - try { - resolved_path = std::filesystem::canonical(expandedPath).string(); - } catch (std::filesystem::filesystem_error&) { - RAISE_PLUGIN_ERROR("File or Directory Not Found"); - } - UDA_LOG(UDA_LOG_DEBUG, "NOT ILLEGAL FILE PATH: %s\n", resolved_path.c_str()); + boost::algorithm::split(allowed_paths, std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"), boost::is_any_of(",")); + } bool good_path = false; for (std::string allowed_path : allowed_paths) { - if (resolved_path.rfind(allowed_path.c_str(), 0) != std::string::npos) { - UDA_LOG(UDA_LOG_DEBUG, "PATH ALLOWED\n"); + if (full_path.rfind(allowed_path.c_str(), 0) != std::string::npos) { good_path = true; break; } - } + } if (!good_path) { UDA_LOG(UDA_LOG_DEBUG, "Bad Path Provided %s\n", expandedPath); - RAISE_PLUGIN_ERROR("Bad File Path Provided"); + RAISE_PLUGIN_ERROR("Bad File Path Provided\n"); } return 0; } From a5165bcce9c91fb762572b2bf2500da2593287d5 Mon Sep 17 00:00:00 2001 From: Adam Parker <105722748+adam-parker1@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:59:18 +0100 Subject: [PATCH 11/54] Update cmake.yml to fix JM's mistakes --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3eb83e51..4c9c8217 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -52,6 +52,7 @@ jobs: git libboost-dev libboost-program-options-dev + libboost-system-dev libssl-dev cmake build-essential From 2b0fd5364b4b0a6786eb8ef4c5aaca9466ab8bb3 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Mon, 24 Jun 2024 09:07:36 +0100 Subject: [PATCH 12/54] Changing check_allowed_path arg to const char*, and allowed paths to use ';' instead of ',' --- source/etc/machine.d/mast.l.cfg | 4 ++-- source/plugins/bytes/bytesPlugin.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/etc/machine.d/mast.l.cfg b/source/etc/machine.d/mast.l.cfg index 1013e545..07623771 100644 --- a/source/etc/machine.d/mast.l.cfg +++ b/source/etc/machine.d/mast.l.cfg @@ -1,4 +1,4 @@ -export IDA3_ERR_MESS_FILE=/home/uda/ida3/etc/error_mess.dat +source/etc/machine.d/mast.l.cfgexport IDA3_ERR_MESS_FILE=/home/uda/ida3/etc/error_mess.dat export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/home/uda/ida3/lib" export PATH="/home/uda/ida3/bin:${PATH}" @@ -12,7 +12,7 @@ export UDA_PORT2=${UDA_PORT} DATA_ARCHIVE=/net/raidsrvr/data -export UDA_BYTES_PLUGIN_ALLOWED_PATHS="/net/raidsrvr/data,/common/uda-scratch,/projects/physics/omfit" +export UDA_BYTES_PLUGIN_ALLOWED_PATHS="/net/raidsrvr/data;/common/uda-scratch;/projects/physics/omfit" export MAST_DATA=${DATA_ARCHIVE}/MAST_Data export MAST_IMAGES=${DATA_ARCHIVE}/MAST_IMAGES diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 1a521a46..246d82da 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -149,7 +149,7 @@ int do_maxinterfaceversion(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Check if path starts with pre-approved file path // Raises Plugin Error if not -int check_allowed_path(char* expandedPath) { +int check_allowed_path(const char* expandedPath) { std::string full_path; try { full_path = std::filesystem::canonical(expandedPath).string(); @@ -160,7 +160,7 @@ int check_allowed_path(char* expandedPath) { char* env_str = std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"); std::vector allowed_paths; if (env_str) { // gotta check if environment variable exists before using it - boost::algorithm::split(allowed_paths, std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"), boost::is_any_of(",")); + boost::algorithm::split(allowed_paths, std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"), boost::is_any_of(";")); } bool good_path = false; for (std::string allowed_path : allowed_paths) { From 1d2b28edb7833de61f78a25ba465e5e1f59aeb47 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 27 Jun 2024 09:07:49 +0100 Subject: [PATCH 13/54] fixing typo in mast.l.cfg and changing boost::algorithm::split to boost:split in bytesPlugin --- source/etc/machine.d/mast.l.cfg | 2 +- source/plugins/bytes/bytesPlugin.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/etc/machine.d/mast.l.cfg b/source/etc/machine.d/mast.l.cfg index 07623771..7905d3b3 100644 --- a/source/etc/machine.d/mast.l.cfg +++ b/source/etc/machine.d/mast.l.cfg @@ -1,4 +1,4 @@ -source/etc/machine.d/mast.l.cfgexport IDA3_ERR_MESS_FILE=/home/uda/ida3/etc/error_mess.dat +export IDA3_ERR_MESS_FILE=/home/uda/ida3/etc/error_mess.dat export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/home/uda/ida3/lib" export PATH="/home/uda/ida3/bin:${PATH}" diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 246d82da..6e13bac8 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -160,7 +160,7 @@ int check_allowed_path(const char* expandedPath) { char* env_str = std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"); std::vector allowed_paths; if (env_str) { // gotta check if environment variable exists before using it - boost::algorithm::split(allowed_paths, std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"), boost::is_any_of(";")); + boost::split(allowed_paths, std::getenv("UDA_BYTES_PLUGIN_ALLOWED_PATHS"), boost::is_any_of(";")); } bool good_path = false; for (std::string allowed_path : allowed_paths) { From 8986f0e617b84d0e46033104bedf4d5524335429 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 27 Jun 2024 13:29:53 +0100 Subject: [PATCH 14/54] Fixing Code breaking bugs, adding a space, removing a blank line, and adding spaces into the Cmake to make it consistent --- source/plugins/bytes/CMakeLists.txt | 2 +- source/plugins/bytes/bytesPlugin.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/plugins/bytes/CMakeLists.txt b/source/plugins/bytes/CMakeLists.txt index a33502e8..d95aad9e 100644 --- a/source/plugins/bytes/CMakeLists.txt +++ b/source/plugins/bytes/CMakeLists.txt @@ -13,7 +13,7 @@ include( plugins ) set ( STDFS_VAR "" ) if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9.1 ) set ( STDFS_VAR "stdc++fs" ) -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9.0) +elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9.0 ) set ( STDFS_VAR "c++fs" ) endif() diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 6e13bac8..4b98478e 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -177,7 +177,6 @@ int check_allowed_path(const char* expandedPath) { } - int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) { DATA_SOURCE* data_source = idam_plugin_interface->data_source; @@ -186,9 +185,8 @@ int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) const char* path; FIND_REQUIRED_STRING_VALUE(idam_plugin_interface->request_data->nameValueList, path); - - StringCopy(data_source->path, path, MAXPATH); + StringCopy(data_source->path, path, MAXPATH); UDA_LOG(UDA_LOG_DEBUG, "expandEnvironmentvariables! \n"); expand_environment_variables(data_source->path); From 7c4176fc2141777a4f79cd51dc176106a0d924e7 Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 27 Jun 2024 13:31:20 +0100 Subject: [PATCH 15/54] Suprious space entered to blank line, the world can rest easy now it is gone --- source/plugins/bytes/bytesPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 4b98478e..0b1d50ee 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -185,7 +185,7 @@ int do_read(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) const char* path; FIND_REQUIRED_STRING_VALUE(idam_plugin_interface->request_data->nameValueList, path); - + StringCopy(data_source->path, path, MAXPATH); UDA_LOG(UDA_LOG_DEBUG, "expandEnvironmentvariables! \n"); expand_environment_variables(data_source->path); From a77ad39f8633ca003626f36dd0e2fb8ff35ecacd Mon Sep 17 00:00:00 2001 From: "Measures, Jimmy" Date: Thu, 27 Jun 2024 13:44:10 +0100 Subject: [PATCH 16/54] Removing boost sytstem dependency as we are only using the header --- .github/workflows/cmake.yml | 1 - source/plugins/bytes/CMakeLists.txt | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4c9c8217..3eb83e51 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -52,7 +52,6 @@ jobs: git libboost-dev libboost-program-options-dev - libboost-system-dev libssl-dev cmake build-essential diff --git a/source/plugins/bytes/CMakeLists.txt b/source/plugins/bytes/CMakeLists.txt index d95aad9e..ac1e9de0 100644 --- a/source/plugins/bytes/CMakeLists.txt +++ b/source/plugins/bytes/CMakeLists.txt @@ -1,7 +1,7 @@ ######################################################################################################################## # Dependencies find_package( LibXml2 QUIET ) -find_package( Boost COMPONENTS system ) +find_package( Boost COMPONENTS ) if( NOT LIBXML2_FOUND ) message( WARNING "Libxml2 not found - skipping template plugin" ) @@ -28,6 +28,6 @@ uda_plugin( ${LIBXML2_INCLUDE_DIR} EXTRA_LINK_LIBS ${LIBXML2_LIBRARIES} - Boost::system + Boost::boost ${STDFS_VAR} ) From 43a61f6a54a185db38ed2fe9f37ad25168eb1dec Mon Sep 17 00:00:00 2001 From: stephen-dixon <68229525+stephen-dixon@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:45:50 +0100 Subject: [PATCH 17/54] Feature/python wheels (#42) Adding github workflows to build and publish python wheels to the pypi "uda" repo when pushing new tags, and publishing to testpypi on pushes to release branches --- .github/workflows/build_test_wheels.yml | 179 ++++++++++++++++++++++++ .github/workflows/build_wheels.yml | 172 +++++++++++++++++++++++ source/wrappers/python/README.md | 1 + source/wrappers/python/pyproject.toml | 16 +++ source/wrappers/python/setup.py.in | 20 ++- 5 files changed, 381 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/build_test_wheels.yml create mode 100644 .github/workflows/build_wheels.yml create mode 100644 source/wrappers/python/README.md create mode 100644 source/wrappers/python/pyproject.toml diff --git a/.github/workflows/build_test_wheels.yml b/.github/workflows/build_test_wheels.yml new file mode 100644 index 00000000..27ff8c1e --- /dev/null +++ b/.github/workflows/build_test_wheels.yml @@ -0,0 +1,179 @@ +name: test building and upload wheels to testpypi + +on: + push: + branches: + - release/* + - main + +jobs: + build_wheels: + # name: build wheels on ${{matrix.os}} ${{matrix.arch}} + name: build wheels on ${{matrix.build-platform[0]}} ${{matrix.build-platform[1]}} + # runs-on: ${{matrix.os}} + runs-on: ${{matrix.build-platform[0]}} + strategy: + fail-fast: false + matrix: + build-platform: + # skip longer-running builds + # - [ubuntu-latest, x86_64, manylinux2014_x86_64] + - [ubuntu-latest, x86_64, manylinux_2_28_x86_64] + # - [ubuntu-latest,aarch64,manylinux_2_28_aarch64] + - [macos-13, x86_64, macosx_x86_64] + - [macos-14, arm64, macosx_arm64] + + steps: + - uses: actions/checkout@v3 + # need git tags available for setuptools_scm to grab tags? will lead to slower checkout + with: + fetch-depth: 0 + + - name: rename pyuda distribution name from uda to ukaea_pyuda_test for testpypi + - run: | + sed -i "s/name='uda'/name='ukaea_pyuda_test'/g" ./source/wrappers/python/setup.py.in + sed -i 's/name="uda"/name='ukaea_pyuda_test'/g' ./source/wrappers/python/pyproject.toml + + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: all + + - name: Build manylinux2014 wheels + if: startswith(matrix.build-platform[2], 'manylinux2014') + uses: pypa/cibuildwheel@v2.17.0 + with: + package-dir: ./source/wrappers/python + config-file: ./source/wrappers/python/pyproject.toml + env: + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 + CIBW_ARCHS: ${{matrix.build-platform[1]}} + CIBW_BUILD: cp*-manylinux* + # CIBW_SKIP: cp36* cp37* *-musllinux* + CIBW_SKIP: cp*-musllinux* *-musllinux* + CIBW_BEFORE_ALL: > + yum update -y && + yum install -y wget openssl-devel libxml2-devel libtirpc-devel && + cd /tmp && + wget https://github.com/fmtlib/fmt/archive/refs/tags/10.0.0.tar.gz && + tar xzf 10.0.0.tar.gz && + cd fmt-10.0.0 && + cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON && + cmake --build build -j --config Release --target install && + cd /tmp && + wget https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz && + tar xzf v1.11.0.tar.gz && + cd spdlog-1.11.0 && + cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON && + cmake --build build -j --config Release --target install && + cd /tmp && + wget https://github.com/capnproto/capnproto/archive/refs/tags/v0.10.4.tar.gz && + tar xzf v0.10.4.tar.gz && + cd capnproto-0.10.4 && + cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON && + cmake --build build && + cmake --install build && + cd /tmp && + wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz && + tar xzf boost_1_80_0.tar.gz && + cd boost_1_80_0 && + ./bootstrap.sh --prefix=/usr/local && + ./b2 --without-python --prefix=/usr/local install && + cd /project && + cmake -B build -DNO_JAVA_WRAPPER=ON -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=OFF -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && + cmake --build build -j --config Release --target install && + cp -r /usr/local/python_installer/* /project/source/wrappers/python/ + + - name: Build manylinux_2_28 wheels + if: startswith(matrix.build-platform[2], 'manylinux_2_28') + uses: pypa/cibuildwheel@v2.17.0 + with: + # package-dir: /usr/local/python_installer + package-dir: ./source/wrappers/python + config-file: ./source/wrappers/python/pyproject.toml + env: + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 + CIBW_ARCHS: ${{matrix.build-platform[1]}} + CIBW_BUILD: cp*-manylinux* + CIBW_SKIP: cp*-musllinux* *-musllinux* + CIBW_BEFORE_ALL: > + dnf update -y && + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && + dnf install -y boost-devel openssl-devel libxml2-devel libtirpc-devel + fmt fmt-devel spdlog spdlog-devel capnproto capnproto-devel && + cd /project && + cmake -B build + -DBUILD_SHARED_LIBS=ON + -DCMAKE_BUILD_TYPE=Release + -DSSLAUTHENTICATION=OFF + -DNO_JAVA_WRAPPER=ON + -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && + cmake --build build -j --config Release --target install && + cp -r /usr/local/python_installer/* /project/source/wrappers/python/ + + - name: build uda on macos + if: runner.os == 'macOS' + run: > + brew update-reset && brew install + git + boost + openssl + cmake + libxml2 + spdlog + capnp && + cd ${{github.workspace}} && + cmake -B build + -DBUILD_SHARED_LIBS=ON + -DCMAKE_BUILD_TYPE=Release + -DSSLAUTHENTICATION=OFF + -DENABLE_CAPNP=ON + -DNO_JAVA_WRAPPER=ON + -DCMAKE_INSTALL_PREFIX=$PWD/install + -DCLIENT_ONLY=ON && + cmake --build build -j --config Release --target install && + cp -r $PWD/install/python_installer/* ${{github.workspace}}/source/wrappers/python/ + + - name: Build macos wheels + if: runner.os == 'macOS' + uses: pypa/cibuildwheel@v2.17.0 + with: + package-dir: ./source/wrappers/python + config-file: ./source/wrappers/python/pyproject.toml + env: + CIBW_ARCHS: ${{matrix.build-platform[1]}} + CIBW_PLATFORM: macos + CIBW_BUILD: cp*-${{matrix.build-platform[2]}} + # CIBW_SKIP: cp36* cp37* + # CIBW_BEFORE_ALL: + # cat ./source/wrappers/python/setup.py + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + upload_pypi: + needs: build_wheels + runs-on: ubuntu-latest + environment: + name: testpypi + # url: https://test.pypi.org/project/ukaea_pyuda/ + permissions: + id-token: write + # if: github.event_name == 'release' && github.event.action == 'published' + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 00000000..12420979 --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,172 @@ +name: build and upload wheels + +on: + push: + # branches: + # - feature/python-wheels + tags: + - '*' + +jobs: + build_wheels: + # name: build wheels on ${{matrix.os}} ${{matrix.arch}} + name: build wheels on ${{matrix.build-platform[0]}} ${{matrix.build-platform[1]}} + # runs-on: ${{matrix.os}} + runs-on: ${{matrix.build-platform[0]}} + strategy: + fail-fast: false + matrix: + build-platform: + - [ubuntu-latest, x86_64, manylinux2014_x86_64] + - [ubuntu-latest, x86_64, manylinux_2_28_x86_64] + - [ubuntu-latest,aarch64,manylinux_2_28_aarch64] + - [macos-13, x86_64, macosx_x86_64] + - [macos-14, arm64, macosx_arm64] + + steps: + - uses: actions/checkout@v3 + # need git tags available for setuptools_scm to grab tags? will elad to slower checkout + with: + fetch-depth: 0 + + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: all + + - name: Build manylinux2014 wheels + if: startswith(matrix.build-platform[2], 'manylinux2014') + uses: pypa/cibuildwheel@v2.17.0 + with: + package-dir: ./source/wrappers/python + config-file: ./source/wrappers/python/pyproject.toml + env: + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 + CIBW_ARCHS: ${{matrix.build-platform[1]}} + CIBW_BUILD: cp*-manylinux* + # CIBW_SKIP: cp36* cp37* *-musllinux* + CIBW_SKIP: cp*-musllinux* *-musllinux* + CIBW_BEFORE_ALL: > + yum update -y && + yum install -y wget openssl-devel libxml2-devel libtirpc-devel && + cd /tmp && + wget https://github.com/fmtlib/fmt/archive/refs/tags/10.0.0.tar.gz && + tar xzf 10.0.0.tar.gz && + cd fmt-10.0.0 && + cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON && + cmake --build build -j --config Release --target install && + cd /tmp && + wget https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz && + tar xzf v1.11.0.tar.gz && + cd spdlog-1.11.0 && + cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON && + cmake --build build -j --config Release --target install && + cd /tmp && + wget https://github.com/capnproto/capnproto/archive/refs/tags/v0.10.4.tar.gz && + tar xzf v0.10.4.tar.gz && + cd capnproto-0.10.4 && + cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON && + cmake --build build && + cmake --install build && + cd /tmp && + wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz && + tar xzf boost_1_80_0.tar.gz && + cd boost_1_80_0 && + ./bootstrap.sh --prefix=/usr/local && + ./b2 --without-python --prefix=/usr/local install && + cd /project && + cmake -B build -DNO_JAVA_WRAPPER=ON -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=OFF -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && + cmake --build build -j --config Release --target install && + cp -r /usr/local/python_installer/* /project/source/wrappers/python/ + + - name: Build manylinux_2_28 wheels + if: startswith(matrix.build-platform[2], 'manylinux_2_28') + uses: pypa/cibuildwheel@v2.17.0 + with: + # package-dir: /usr/local/python_installer + package-dir: ./source/wrappers/python + config-file: ./source/wrappers/python/pyproject.toml + env: + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 + CIBW_ARCHS: ${{matrix.build-platform[1]}} + CIBW_BUILD: cp*-manylinux* + CIBW_SKIP: cp*-musllinux* *-musllinux* + CIBW_BEFORE_ALL: > + dnf update -y && + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && + dnf install -y boost-devel openssl-devel libxml2-devel libtirpc-devel + fmt fmt-devel spdlog spdlog-devel capnproto capnproto-devel && + cd /project && + cmake -B build + -DBUILD_SHARED_LIBS=ON + -DCMAKE_BUILD_TYPE=Release + -DSSLAUTHENTICATION=OFF + -DNO_JAVA_WRAPPER=ON + -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && + cmake --build build -j --config Release --target install && + cp -r /usr/local/python_installer/* /project/source/wrappers/python/ + + - name: build uda on macos + if: runner.os == 'macOS' + run: > + brew update-reset && brew install + git + boost + openssl + cmake + libxml2 + spdlog + capnp && + cd ${{github.workspace}} && + cmake -B build + -DBUILD_SHARED_LIBS=ON + -DCMAKE_BUILD_TYPE=Release + -DSSLAUTHENTICATION=OFF + -DENABLE_CAPNP=ON + -DNO_JAVA_WRAPPER=ON + -DCMAKE_INSTALL_PREFIX=$PWD/install + -DCLIENT_ONLY=ON && + cmake --build build -j --config Release --target install && + cp -r $PWD/install/python_installer/* ${{github.workspace}}/source/wrappers/python/ + + - name: Build macos wheels + if: runner.os == 'macOS' + uses: pypa/cibuildwheel@v2.17.0 + with: + package-dir: ./source/wrappers/python + config-file: ./source/wrappers/python/pyproject.toml + env: + CIBW_ARCHS: ${{matrix.build-platform[1]}} + CIBW_PLATFORM: macos + CIBW_BUILD: cp*-${{matrix.build-platform[2]}} + # CIBW_SKIP: cp36* cp37* + # CIBW_BEFORE_ALL: + # cat ./source/wrappers/python/setup.py + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + upload_pypi: + needs: build_wheels + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/uda + permissions: + id-token: write + # if: github.event_name == 'release' && github.event.action == 'published' + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/source/wrappers/python/README.md b/source/wrappers/python/README.md new file mode 100644 index 00000000..e0b60d36 --- /dev/null +++ b/source/wrappers/python/README.md @@ -0,0 +1 @@ +pyuda is the python interface to the uda client library. It is used for remote access to scientific and experimental data from a number of international labs hosting uda data servers. diff --git a/source/wrappers/python/pyproject.toml b/source/wrappers/python/pyproject.toml new file mode 100644 index 00000000..25d66a11 --- /dev/null +++ b/source/wrappers/python/pyproject.toml @@ -0,0 +1,16 @@ +[build-system] +requires = ["setuptools>=42", "numpy>=1.7, <2", "Cython>=0.29", "six"] +build-backend = "setuptools.build_meta" + + +[project] +name = "uda" +dynamic = ["version"] +readme = {file = 'README.md', content-type = "text/markdown"} +license = {text = "Apache-2.0 license"} +dependencies = ["numpy", "six"] +requires-python = ">= 3.5" + +[project.optional-dependencies] +plot = ["pyplot"] +full = ["pyplot", "rich"] diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index c94e793f..399f73a4 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -3,7 +3,7 @@ import os import sys import sysconfig -from distutils.core import setup, Extension +from setuptools import setup, Extension from Cython.Build import cythonize from Cython.Compiler.Main import default_options import numpy @@ -11,7 +11,7 @@ import numpy default_options['compile_time_env'] = {'CAPNP': @CAPNP_FLAG@} extra_link_args = [] -extra_compile_args = ['-std=c++11'] +extra_compile_args = ['-std=c++17'] root = os.environ.get('UDA_DIR', '@CMAKE_INSTALL_PREFIX@') @@ -78,15 +78,21 @@ ext = Extension( define_macros=extra_macros, ) + +def get_version(v): + if v.count('.') > 2: + v = ".Post".join(v.rsplit('.', 1)) + print("setup version = %s" % v) + return v + + setup( - name='@PROJECT_NAME@', - version='@PROJECT_VERSION@', + name='uda', + version=get_version('@PROJECT_VERSION@'), description='Unified Data Access (UDA)', author='Jonathan Hollocombe', author_email='jonathan.hollocombe@ukaea.uk', - url='https://github.com/ukaea/UDA', + url='https://github.com/stephen-dixon/uda', packages=['pyuda'], ext_modules=cythonize([ext]), - setup_requires=['numpy>=1.7', 'Cython>=0.29', 'six'], - install_requires=['numpy>=1.7', 'six'], ) From b72a6968b4c764d0a886cbd26c75c077b5d97126 Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 1 Jul 2024 10:51:55 +0100 Subject: [PATCH 18/54] fixing typo in github workflow --- .github/workflows/build_test_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test_wheels.yml b/.github/workflows/build_test_wheels.yml index 27ff8c1e..b1b38a89 100644 --- a/.github/workflows/build_test_wheels.yml +++ b/.github/workflows/build_test_wheels.yml @@ -30,9 +30,9 @@ jobs: fetch-depth: 0 - name: rename pyuda distribution name from uda to ukaea_pyuda_test for testpypi - - run: | + run: | sed -i "s/name='uda'/name='ukaea_pyuda_test'/g" ./source/wrappers/python/setup.py.in - sed -i 's/name="uda"/name='ukaea_pyuda_test'/g' ./source/wrappers/python/pyproject.toml + sed -i 's/name="uda"/name="ukaea_pyuda_test"/g' ./source/wrappers/python/pyproject.toml - name: Set up QEMU if: runner.os == 'Linux' From 0561259773f95624646e0ed5a28f84274e1c626c Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 1 Jul 2024 10:53:50 +0100 Subject: [PATCH 19/54] fixing typo in github workflow --- .github/workflows/build_test_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test_wheels.yml b/.github/workflows/build_test_wheels.yml index b1b38a89..de8dcd9c 100644 --- a/.github/workflows/build_test_wheels.yml +++ b/.github/workflows/build_test_wheels.yml @@ -31,8 +31,8 @@ jobs: - name: rename pyuda distribution name from uda to ukaea_pyuda_test for testpypi run: | - sed -i "s/name='uda'/name='ukaea_pyuda_test'/g" ./source/wrappers/python/setup.py.in - sed -i 's/name="uda"/name="ukaea_pyuda_test"/g' ./source/wrappers/python/pyproject.toml + sed -i "s/name='uda'/name='ukaea_pyuda_test'/g" ./source/wrappers/python/setup.py.in + sed -i 's/name="uda"/name="ukaea_pyuda_test"/g' ./source/wrappers/python/pyproject.toml - name: Set up QEMU if: runner.os == 'Linux' From 89519bcc5ce5f582663e113a85b0d5ea1c9b505a Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 1 Jul 2024 11:00:49 +0100 Subject: [PATCH 20/54] changing testpypi repo from 'ukaea_pyuda_test' to 'uda' --- .github/workflows/build_test_wheels.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build_test_wheels.yml b/.github/workflows/build_test_wheels.yml index de8dcd9c..eeda29e0 100644 --- a/.github/workflows/build_test_wheels.yml +++ b/.github/workflows/build_test_wheels.yml @@ -29,11 +29,6 @@ jobs: with: fetch-depth: 0 - - name: rename pyuda distribution name from uda to ukaea_pyuda_test for testpypi - run: | - sed -i "s/name='uda'/name='ukaea_pyuda_test'/g" ./source/wrappers/python/setup.py.in - sed -i 's/name="uda"/name="ukaea_pyuda_test"/g' ./source/wrappers/python/pyproject.toml - - name: Set up QEMU if: runner.os == 'Linux' uses: docker/setup-qemu-action@v3 @@ -161,7 +156,6 @@ jobs: runs-on: ubuntu-latest environment: name: testpypi - # url: https://test.pypi.org/project/ukaea_pyuda/ permissions: id-token: write # if: github.event_name == 'release' && github.event.action == 'published' From 199cefd602526c1afe09b3576e52532f50a98b0d Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 1 Jul 2024 11:19:07 +0100 Subject: [PATCH 21/54] correcting pypi project url --- source/wrappers/python/setup.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index 399f73a4..3be41803 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -92,7 +92,7 @@ setup( description='Unified Data Access (UDA)', author='Jonathan Hollocombe', author_email='jonathan.hollocombe@ukaea.uk', - url='https://github.com/stephen-dixon/uda', + url='https://github.com/ukaea/uda', packages=['pyuda'], ext_modules=cythonize([ext]), ) From e7a2c47d36d4ec5e01189f33118cab4d9ace8a44 Mon Sep 17 00:00:00 2001 From: sdixon Date: Thu, 4 Jul 2024 12:49:09 +0100 Subject: [PATCH 22/54] enabling ssl client authentication in pyuda wheel builds --- .github/workflows/build_test_wheels.yml | 6 +++--- .github/workflows/build_wheels.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_test_wheels.yml b/.github/workflows/build_test_wheels.yml index eeda29e0..c8347bc9 100644 --- a/.github/workflows/build_test_wheels.yml +++ b/.github/workflows/build_test_wheels.yml @@ -77,7 +77,7 @@ jobs: ./bootstrap.sh --prefix=/usr/local && ./b2 --without-python --prefix=/usr/local install && cd /project && - cmake -B build -DNO_JAVA_WRAPPER=ON -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=OFF -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && + cmake -B build -DNO_JAVA_WRAPPER=ON -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=ON -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && cmake --build build -j --config Release --target install && cp -r /usr/local/python_installer/* /project/source/wrappers/python/ @@ -103,7 +103,7 @@ jobs: cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release - -DSSLAUTHENTICATION=OFF + -DSSLAUTHENTICATION=ON -DNO_JAVA_WRAPPER=ON -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && cmake --build build -j --config Release --target install && @@ -124,7 +124,7 @@ jobs: cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release - -DSSLAUTHENTICATION=OFF + -DSSLAUTHENTICATION=ON -DENABLE_CAPNP=ON -DNO_JAVA_WRAPPER=ON -DCMAKE_INSTALL_PREFIX=$PWD/install diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 12420979..cc85d14b 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -77,7 +77,7 @@ jobs: ./bootstrap.sh --prefix=/usr/local && ./b2 --without-python --prefix=/usr/local install && cd /project && - cmake -B build -DNO_JAVA_WRAPPER=ON -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=OFF -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && + cmake -B build -DNO_JAVA_WRAPPER=ON -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=ON -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && cmake --build build -j --config Release --target install && cp -r /usr/local/python_installer/* /project/source/wrappers/python/ @@ -103,7 +103,7 @@ jobs: cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release - -DSSLAUTHENTICATION=OFF + -DSSLAUTHENTICATION=ON -DNO_JAVA_WRAPPER=ON -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON && cmake --build build -j --config Release --target install && @@ -124,7 +124,7 @@ jobs: cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release - -DSSLAUTHENTICATION=OFF + -DSSLAUTHENTICATION=ON -DENABLE_CAPNP=ON -DNO_JAVA_WRAPPER=ON -DCMAKE_INSTALL_PREFIX=$PWD/install From c59769dde9cb88b1b71fb489285b8b09a1767034 Mon Sep 17 00:00:00 2001 From: sdixon Date: Fri, 5 Jul 2024 14:29:02 +0100 Subject: [PATCH 23/54] updating project links in pyuda wheel --- source/wrappers/python/pyproject.toml | 14 ++++++++++++++ source/wrappers/python/setup.py.in | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/source/wrappers/python/pyproject.toml b/source/wrappers/python/pyproject.toml index 25d66a11..ce823d27 100644 --- a/source/wrappers/python/pyproject.toml +++ b/source/wrappers/python/pyproject.toml @@ -2,6 +2,11 @@ requires = ["setuptools>=42", "numpy>=1.7, <2", "Cython>=0.29", "six"] build-backend = "setuptools.build_meta" +[project.urls] +homepage = "https://ukaea.github.io/UDA/" +documentation = "https://ukaea.github.io/UDA/" +source = "https://github.com/ukaea/UDA" +tracker = "https://github.com/ukaea/UDA/issues" [project] name = "uda" @@ -11,6 +16,15 @@ license = {text = "Apache-2.0 license"} dependencies = ["numpy", "six"] requires-python = ">= 3.5" +classifiers = [ + 'Intended Audience :: Science/Research', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3 :: Only', + 'Operating System :: POSIX :: Linux', + 'Operating System :: MacOS :: MacOS X', +] + + [project.optional-dependencies] plot = ["pyplot"] full = ["pyplot", "rich"] diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index 3be41803..2f15ab4f 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -92,7 +92,6 @@ setup( description='Unified Data Access (UDA)', author='Jonathan Hollocombe', author_email='jonathan.hollocombe@ukaea.uk', - url='https://github.com/ukaea/uda', packages=['pyuda'], ext_modules=cythonize([ext]), ) From 579ee5430334e2389a9d9924c20c15e54ef1f328 Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 11:13:15 +0100 Subject: [PATCH 24/54] adding wrapper functions to revert breaking api changes --- source/client/accAPI.h | 1 + source/client/legacy_accAPI.h | 30 ++++++++++++++++++++++++++++++ source/client/legacy_client.h | 23 +++++++++++++++++++++++ source/client/udaClient.h | 2 ++ source/wrappers/python/README.md | 18 ++++++++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 source/client/legacy_accAPI.h create mode 100644 source/client/legacy_client.h diff --git a/source/client/accAPI.h b/source/client/accAPI.h index 53ce83af..15493b13 100755 --- a/source/client/accAPI.h +++ b/source/client/accAPI.h @@ -8,6 +8,7 @@ #include #include #include "udaClient.h" +#include "legacy_accAPI.h" #ifdef __cplusplus extern "C" { diff --git a/source/client/legacy_accAPI.h b/source/client/legacy_accAPI.h new file mode 100644 index 00000000..988e9651 --- /dev/null +++ b/source/client/legacy_accAPI.h @@ -0,0 +1,30 @@ +#ifndef LEGACY_ACCAPI_H +#define LEGACY_ACCAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define acc_getCurrentDataBlock() acc_getCurrentDataBlock(udaClientFlags()) +#define acc_getCurrentDataBlockIndex() acc_getCurrentDataBlockIndex(udaClientFlags()) +#define acc_growIdamDataBlocks() acc_growIdamDataBlocks(udaClientFlags()) +#define acc_getIdamNewDataHandle() acc_getIdamNewDataHandle(udaClientFlags()) +#define setIdamClientFlag(flag) setIdamClientFlag(udaClientFlags(), flag) +#define resetIdamClientFlag(flag) resetIdamClientFlag(udaClientFlags(), flag) +#define setIdamProperty(property) setIdamProperty(property, udaClientFlags()) +#define getIdamProperty(property) getIdamProperty(property, udaClientFlags()) +#define resetIdamProperty(property) resetIdamProperty(property, udaClientFlags()) +#define resetIdamProperties() resetIdamProperties(udaClientFlags()) +#define saveIdamProperties() saveIdamProperties(udaClientFlags()) +#define restoreIdamProperties(cb) restoreIdamProperties(cb, udaClientFlags()) +#define getIdamLastHandle() getIdamLastHandle(udaClientFlags()) +#define lockIdamThread() lockIdamThread(udaClientFlags()) +#define unlockUdaThread() unlockUdaThread(udaClientFlags()) +#define freeIdamThread() freeIdamThread(udaClientFlags()) + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/source/client/legacy_client.h b/source/client/legacy_client.h new file mode 100644 index 00000000..e850b772 --- /dev/null +++ b/source/client/legacy_client.h @@ -0,0 +1,23 @@ +#ifndef LEGACY_CLIENT_H +#define LEGACY_CLIENT_H + +#ifdef __cplusplus +extern "C" { +#endif + +LIBRARY_API inline void idamFree(int handle) +{ + udaFree(handle); +} + +LIBRARY_API inline void idamFreeAll() +{ + udaFreeAll(); +} + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/source/client/udaClient.h b/source/client/udaClient.h index 6ac0d939..4e7fae6b 100755 --- a/source/client/udaClient.h +++ b/source/client/udaClient.h @@ -7,6 +7,7 @@ #include #include #include +#include "legacy_client.h" #ifdef __cplusplus extern "C" { @@ -118,4 +119,5 @@ LIBRARY_API void setLogMallocList(LOGMALLOCLIST* logmalloclist_in); } #endif + #endif // UDA_CLIENT_UDACLIENT_H diff --git a/source/wrappers/python/README.md b/source/wrappers/python/README.md index e0b60d36..ac796c68 100644 --- a/source/wrappers/python/README.md +++ b/source/wrappers/python/README.md @@ -1 +1,19 @@ pyuda is the python interface to the uda client library. It is used for remote access to scientific and experimental data from a number of international labs hosting uda data servers. + +- **Website:** https://ukaea.github.io/UDA/ +- **Documentation:** https://ukaea.github.io/UDA/ +- **Source Code:** https://github.com/ukaea/UDA +- **Issue Tracker:** https://github.com/ukaea/UDA/issues + + +## Quick-start + +```py +import pyuda + +pyuda.Client.server = "" +pyuda.Client.port = +client = pyuda.Client() +signal_object = client.get(signal, source) + +``` From 49ff72539924b1b4f7ddc1ee57b92254333e3c9b Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 14:35:25 +0100 Subject: [PATCH 25/54] test pushing wheels to pypi --- .github/workflows/build_wheels.yml | 4 ++-- source/client/accAPI.h | 1 - source/client/legacy_accAPI.h | 30 ---------------------------- source/client/udaClient.h | 2 +- source/plugins/bytes/bytesPlugin.cpp | 9 +++++++++ 5 files changed, 12 insertions(+), 34 deletions(-) delete mode 100644 source/client/legacy_accAPI.h diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index cc85d14b..ed86f6ee 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -2,8 +2,8 @@ name: build and upload wheels on: push: - # branches: - # - feature/python-wheels + branches: + - release/* tags: - '*' diff --git a/source/client/accAPI.h b/source/client/accAPI.h index 15493b13..53ce83af 100755 --- a/source/client/accAPI.h +++ b/source/client/accAPI.h @@ -8,7 +8,6 @@ #include #include #include "udaClient.h" -#include "legacy_accAPI.h" #ifdef __cplusplus extern "C" { diff --git a/source/client/legacy_accAPI.h b/source/client/legacy_accAPI.h deleted file mode 100644 index 988e9651..00000000 --- a/source/client/legacy_accAPI.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef LEGACY_ACCAPI_H -#define LEGACY_ACCAPI_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define acc_getCurrentDataBlock() acc_getCurrentDataBlock(udaClientFlags()) -#define acc_getCurrentDataBlockIndex() acc_getCurrentDataBlockIndex(udaClientFlags()) -#define acc_growIdamDataBlocks() acc_growIdamDataBlocks(udaClientFlags()) -#define acc_getIdamNewDataHandle() acc_getIdamNewDataHandle(udaClientFlags()) -#define setIdamClientFlag(flag) setIdamClientFlag(udaClientFlags(), flag) -#define resetIdamClientFlag(flag) resetIdamClientFlag(udaClientFlags(), flag) -#define setIdamProperty(property) setIdamProperty(property, udaClientFlags()) -#define getIdamProperty(property) getIdamProperty(property, udaClientFlags()) -#define resetIdamProperty(property) resetIdamProperty(property, udaClientFlags()) -#define resetIdamProperties() resetIdamProperties(udaClientFlags()) -#define saveIdamProperties() saveIdamProperties(udaClientFlags()) -#define restoreIdamProperties(cb) restoreIdamProperties(cb, udaClientFlags()) -#define getIdamLastHandle() getIdamLastHandle(udaClientFlags()) -#define lockIdamThread() lockIdamThread(udaClientFlags()) -#define unlockUdaThread() unlockUdaThread(udaClientFlags()) -#define freeIdamThread() freeIdamThread(udaClientFlags()) - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/source/client/udaClient.h b/source/client/udaClient.h index 4e7fae6b..e1800a35 100755 --- a/source/client/udaClient.h +++ b/source/client/udaClient.h @@ -7,7 +7,6 @@ #include #include #include -#include "legacy_client.h" #ifdef __cplusplus extern "C" { @@ -119,5 +118,6 @@ LIBRARY_API void setLogMallocList(LOGMALLOCLIST* logmalloclist_in); } #endif +#include "legacy_client.h" #endif // UDA_CLIENT_UDACLIENT_H diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 0b1d50ee..f4b035c0 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -5,7 +5,16 @@ #include "readBytesNonOptimally.h" +#if defined __has_include +# if !__has_include() +#include +namespace filesystem = std::experimental::filesystem; +# endif +#else #include +namespace filesystem = std::filesystem; +#endif + #include static int do_help(IDAM_PLUGIN_INTERFACE* idam_plugin_interface); From 991b351aeb49d9c03216ca640ac364c5cd54dabb Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 14:53:07 +0100 Subject: [PATCH 26/54] test pushing wheels to pypi --- source/plugins/bytes/bytesPlugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index f4b035c0..69c632b3 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -161,8 +161,8 @@ int do_maxinterfaceversion(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) int check_allowed_path(const char* expandedPath) { std::string full_path; try { - full_path = std::filesystem::canonical(expandedPath).string(); - } catch (std::filesystem::filesystem_error& e) { + full_path = filesystem::canonical(expandedPath).string(); + } catch (filesystem::filesystem_error& e) { UDA_LOG(UDA_LOG_DEBUG, "Filepath [%s] not found! Error: %s\n", full_path.c_str(), e.what()); RAISE_PLUGIN_ERROR("Provided File Path Not Found!\n"); } From 0b03eaec8cffe99ede5ff370126c56e19812f117 Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 15:01:03 +0100 Subject: [PATCH 27/54] test pushing wheels to pypi --- source/plugins/bytes/bytesPlugin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 69c632b3..b6c2b232 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -9,6 +9,9 @@ # if !__has_include() #include namespace filesystem = std::experimental::filesystem; +# else +#include +namespace filesystem = std::filesystem; # endif #else #include From 6f75d06c9ddfdc81e5b3629219dd318e1370ff96 Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 15:46:57 +0100 Subject: [PATCH 28/54] updaing centos7 mirrorlist for manylinux2014 pyuda wheel --- .github/workflows/build_wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index ed86f6ee..895956e4 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -49,6 +49,8 @@ jobs: # CIBW_SKIP: cp36* cp37* *-musllinux* CIBW_SKIP: cp*-musllinux* *-musllinux* CIBW_BEFORE_ALL: > + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* yum update -y && yum install -y wget openssl-devel libxml2-devel libtirpc-devel && cd /tmp && From 3e7bb1a04eab52729b916ca3edc4677759941c71 Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 16:11:12 +0100 Subject: [PATCH 29/54] updaing centos7 mirrorlist for manylinux2014 pyuda wheel --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 895956e4..0f68420c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -49,8 +49,8 @@ jobs: # CIBW_SKIP: cp36* cp37* *-musllinux* CIBW_SKIP: cp*-musllinux* *-musllinux* CIBW_BEFORE_ALL: > - sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* - sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && yum update -y && yum install -y wget openssl-devel libxml2-devel libtirpc-devel && cd /tmp && From 9cb3bc45b7179d32d05eb2d50883fb1a58265c20 Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 16:49:50 +0100 Subject: [PATCH 30/54] testing pushing pyuda wheels to pypi --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 0f68420c..33d96cdf 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -19,7 +19,7 @@ jobs: build-platform: - [ubuntu-latest, x86_64, manylinux2014_x86_64] - [ubuntu-latest, x86_64, manylinux_2_28_x86_64] - - [ubuntu-latest,aarch64,manylinux_2_28_aarch64] + # - [ubuntu-latest,aarch64,manylinux_2_28_aarch64] - [macos-13, x86_64, macosx_x86_64] - [macos-14, arm64, macosx_arm64] @@ -162,7 +162,7 @@ jobs: permissions: id-token: write # if: github.event_name == 'release' && github.event.action == 'published' - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') steps: - uses: actions/download-artifact@v4 with: From bdce45c448b9466d571b8b2af465241e6771e815 Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 17:26:50 +0100 Subject: [PATCH 31/54] correcting numpy version range in pyuda pyproject.toml --- source/wrappers/python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wrappers/python/pyproject.toml b/source/wrappers/python/pyproject.toml index ce823d27..3da3444c 100644 --- a/source/wrappers/python/pyproject.toml +++ b/source/wrappers/python/pyproject.toml @@ -13,7 +13,7 @@ name = "uda" dynamic = ["version"] readme = {file = 'README.md', content-type = "text/markdown"} license = {text = "Apache-2.0 license"} -dependencies = ["numpy", "six"] +dependencies = ["numpy>1.7, <2", "six"] requires-python = ">= 3.5" classifiers = [ From ca9e978dc454522537517dcea49cb57c42a190ad Mon Sep 17 00:00:00 2001 From: sdixon Date: Mon, 8 Jul 2024 23:24:26 +0100 Subject: [PATCH 32/54] reverting pyuda pypi action to only run on tagged releases --- .github/workflows/build_wheels.yml | 10 +--------- source/wrappers/python/pyproject.toml | 1 + source/wrappers/python/setup.py.in | 1 + 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 33d96cdf..8ffc0799 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -2,16 +2,12 @@ name: build and upload wheels on: push: - branches: - - release/* tags: - '*' jobs: build_wheels: - # name: build wheels on ${{matrix.os}} ${{matrix.arch}} name: build wheels on ${{matrix.build-platform[0]}} ${{matrix.build-platform[1]}} - # runs-on: ${{matrix.os}} runs-on: ${{matrix.build-platform[0]}} strategy: fail-fast: false @@ -19,7 +15,7 @@ jobs: build-platform: - [ubuntu-latest, x86_64, manylinux2014_x86_64] - [ubuntu-latest, x86_64, manylinux_2_28_x86_64] - # - [ubuntu-latest,aarch64,manylinux_2_28_aarch64] + - [ubuntu-latest,aarch64,manylinux_2_28_aarch64] - [macos-13, x86_64, macosx_x86_64] - [macos-14, arm64, macosx_arm64] @@ -46,7 +42,6 @@ jobs: CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 CIBW_ARCHS: ${{matrix.build-platform[1]}} CIBW_BUILD: cp*-manylinux* - # CIBW_SKIP: cp36* cp37* *-musllinux* CIBW_SKIP: cp*-musllinux* *-musllinux* CIBW_BEFORE_ALL: > sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && @@ -144,9 +139,6 @@ jobs: CIBW_ARCHS: ${{matrix.build-platform[1]}} CIBW_PLATFORM: macos CIBW_BUILD: cp*-${{matrix.build-platform[2]}} - # CIBW_SKIP: cp36* cp37* - # CIBW_BEFORE_ALL: - # cat ./source/wrappers/python/setup.py - uses: actions/upload-artifact@v4 with: diff --git a/source/wrappers/python/pyproject.toml b/source/wrappers/python/pyproject.toml index 3da3444c..d3209e6d 100644 --- a/source/wrappers/python/pyproject.toml +++ b/source/wrappers/python/pyproject.toml @@ -18,6 +18,7 @@ requires-python = ">= 3.5" classifiers = [ 'Intended Audience :: Science/Research', + 'Programming Language :: C', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', 'Operating System :: POSIX :: Linux', diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index 2f15ab4f..60f5d0b8 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -90,6 +90,7 @@ setup( name='uda', version=get_version('@PROJECT_VERSION@'), description='Unified Data Access (UDA)', + long_description='Unified Data Access (UDA)', author='Jonathan Hollocombe', author_email='jonathan.hollocombe@ukaea.uk', packages=['pyuda'], From 8d849c066402047b1557351f52a17fe9c91ade39 Mon Sep 17 00:00:00 2001 From: sdixon Date: Thu, 25 Jul 2024 14:50:51 +0100 Subject: [PATCH 33/54] adding "uda" alias to pyuda --- source/wrappers/python/uda/__init__.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 source/wrappers/python/uda/__init__.py diff --git a/source/wrappers/python/uda/__init__.py b/source/wrappers/python/uda/__init__.py new file mode 100644 index 00000000..d16731cc --- /dev/null +++ b/source/wrappers/python/uda/__init__.py @@ -0,0 +1,24 @@ +from __future__ import (division, print_function, absolute_import) + +from logging import DEBUG, WARNING, INFO, ERROR + +from pyuda import cpyuda + +from pyuda._client import Client +from pyuda._signal import Signal +from pyuda._video import Video +from pyuda._dim import Dim +from pyuda._structured import StructuredData +from pyuda._json import SignalEncoder, SignalDecoder +from pyuda._version import __version__, __version_info__ + + +UDAException = cpyuda.UDAException +ProtocolException = cpyuda.ProtocolException +ServerException = cpyuda.ServerException +InvalidUseException = cpyuda.InvalidUseException +Properties = cpyuda.Properties + + +__all__ = (UDAException, ProtocolException, ServerException, InvalidUseException, + Client, Signal, Video, Dim, Properties, DEBUG, WARNING, INFO, ERROR) From 13a4b85d0673187048a0ed218d504155b736d289 Mon Sep 17 00:00:00 2001 From: sdixon Date: Thu, 25 Jul 2024 15:13:39 +0100 Subject: [PATCH 34/54] adding "uda" alias to pyuda --- source/wrappers/python/setup.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index 60f5d0b8..2c4da60c 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -93,6 +93,6 @@ setup( long_description='Unified Data Access (UDA)', author='Jonathan Hollocombe', author_email='jonathan.hollocombe@ukaea.uk', - packages=['pyuda'], + packages=['pyuda', 'uda'], ext_modules=cythonize([ext]), ) From e2fb5c85fa958348c5d1c27fac2f574c02531bb3 Mon Sep 17 00:00:00 2001 From: sdixon Date: Thu, 25 Jul 2024 16:06:05 +0100 Subject: [PATCH 35/54] adding "uda" alias to pyuda --- .github/workflows/cmake.yml | 2 +- source/wrappers/python/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3eb83e51..18785d58 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -192,7 +192,7 @@ jobs: python3 -m venv ${{github.workspace}}/venv && source ${{github.workspace}}/venv/bin/activate && pip3 install --upgrade pip && - pip3 install wheel Cython numpy six && + pip3 install wheel Cython "numpy<2" six && pip3 install ${{github.workspace}}/python_installer - name: Test pyuda import diff --git a/source/wrappers/python/CMakeLists.txt b/source/wrappers/python/CMakeLists.txt index 9cf44455..b4ae609a 100755 --- a/source/wrappers/python/CMakeLists.txt +++ b/source/wrappers/python/CMakeLists.txt @@ -5,6 +5,7 @@ install( FILES ${CYTHON_FILES} pyuda/cpyuda/uda.pxd DESTINATION python_installer file( GLOB INSTALL_FILES pyuda/*.py ) install( FILES ${INSTALL_FILES} DESTINATION python_installer/pyuda ) +install( FILES ${CMAKE_CURRENT_LIST_DIR}/uda/__init__.py DESTINATION python_installer/uda ) configure_file( ${CMAKE_CURRENT_LIST_DIR}/pyuda/_version.py.in ${CMAKE_CURRENT_BINARY_DIR}/pyuda/_version.py @ONLY ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/pyuda/_version.py DESTINATION python_installer/pyuda ) From 3c1011015aa0a25db24105dc9430ad6b3c536217 Mon Sep 17 00:00:00 2001 From: sdixon Date: Tue, 6 Aug 2024 13:57:27 +0100 Subject: [PATCH 36/54] adding git attributes to populate cmake version info in release tarballs --- .gitattributes | 1 + CMakeLists.txt | 39 ++++++++++++++------------ cmake/DetermineVersion.cmake | 53 ++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 17 deletions(-) create mode 100644 .gitattributes create mode 100644 cmake/DetermineVersion.cmake diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..2b663cc8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +CMakeLists.txt export-subst diff --git a/CMakeLists.txt b/CMakeLists.txt index deda2226..99587143 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,23 +45,28 @@ set( Boost_USE_MULTITHREADED OFF ) ######################################################################################################################## # Version and Machine information -include( GetGitRevisionDescription ) - -git_describe( GIT_TAG --tags ) - -if( "${GIT_TAG}" MATCHES "^.*NOTFOUND$" ) - message( WARNING "Failed to get git revision: ${GIT_TAG}" ) - set( GIT_VERSION "0.0.0" ) -elseif( "${GIT_TAG}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)$" ) - set( GIT_VERSION "${GIT_TAG}" ) -elseif( "${GIT_TAG}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-.*$" ) - set( GIT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" ) -else() - message( WARNING "invalid git tag for version parsing: ${GIT_TAG}" ) - set( GIT_VERSION "0.0.0" ) -endif() - -project( uda VERSION ${GIT_VERSION} ) +# include( GetGitRevisionDescription ) +# +# git_describe( GIT_TAG --tags ) +# +# if( "${GIT_TAG}" MATCHES "^.*NOTFOUND$" ) +# message( WARNING "Failed to get git revision: ${GIT_TAG}" ) +# set( GIT_VERSION "0.0.0" ) +# elseif( "${GIT_TAG}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)$" ) +# set( GIT_VERSION "${GIT_TAG}" ) +# elseif( "${GIT_TAG}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-.*$" ) +# set( GIT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" ) +# else() +# message( WARNING "invalid git tag for version parsing: ${GIT_TAG}" ) +# set( GIT_VERSION "0.0.0" ) +# endif() + +# Set VERSION and FULL_VERSION from `git describe` +# but use git export attribute for release tarballs +set( GIT_ARCHIVE_DESCRIBE [[$Format:%(describe)$]] ) +include( DetermineVersion ) + +project( uda VERSION ${VERSION} ) set( USER $ENV{USER} ) diff --git a/cmake/DetermineVersion.cmake b/cmake/DetermineVersion.cmake new file mode 100644 index 00000000..5c4399ee --- /dev/null +++ b/cmake/DetermineVersion.cmake @@ -0,0 +1,53 @@ +# Determine the version of the current AL component, based on git describe + +if( NOT GIT_ARCHIVE_DESCRIBE ) + message( FATAL_ERROR "GIT_ARCHIVE_DESCRIBE should be set before including ALDetermineVersion" ) +endif() + +if( NOT GIT_ARCHIVE_DESCRIBE MATCHES "^.Format:%.describe" ) + # We are part of an exported tarball and git-archive set the describe content: + set( _GIT_DESCRIBE_ERROR_CODE 0 ) + set( _GIT_DESCRIBE_OUTPUT "${GIT_ARCHIVE_DESCRIBE}" ) +else() + # Ask git for a describe: + find_package( Git ) + if( GIT_EXECUTABLE ) + # Generate a git-describe version string from Git repository tags + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tags --dirty + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE _GIT_DESCRIBE_OUTPUT + RESULT_VARIABLE _GIT_DESCRIBE_ERROR_CODE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endif() +endif() + +# Process git describe output: +if( _GIT_DESCRIBE_OUTPUT AND NOT _GIT_DESCRIBE_ERROR_CODE ) + # Git describe should return the version (MAJOR.MINOR.PATCH) and potentially + # a suffix "--g[-dirty]" + # Use a regex to extract all parts: + if( _GIT_DESCRIBE_OUTPUT MATCHES "([0-9]+)[.]([0-9]+)[.]*([0-9]+)(.*)" ) + set( VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}" ) + if( CMAKE_MATCH_4 MATCHES "-([0-9]+)-(.*)" ) + # Use ncommits as fourth version component for the CMAKE project version + set( VERSION "${VERSION}.${CMAKE_MATCH_1}" ) + endif() + else() + message( FATAL_ERROR "Unexpected output of git describe: '${_GIT_DESCRIBE_OUTPUT}'") + endif() + + # Generate a version string that conforms to the Python standards + # e.g. 5.1.0-3-g7c620eb5-dirty becomes 5.1.0+3-g7c620eb5-dirty + string( REGEX REPLACE "-(.*)$" "+\\1" FULL_VERSION ${_GIT_DESCRIBE_OUTPUT} ) + message( VERBOSE "Determined project version: ${VERSION}" ) +endif() + +# Fallback: git not found, or git describe fails +# Set version to 0.0.0 and report a warning +if( NOT DEFINED VERSION ) + set( VERSION "0.0.0" ) + set( FULL_VERSION "0.0.0+unknown" ) + message( WARNING "Failed to determine VERSION from git tags. Falling back to default version '${VERSION}'" ) +endif() From f585e8fd09c33af7b36c25ec490adb7590e2c641 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 10:37:43 +0100 Subject: [PATCH 37/54] adding legacy headers --- source/client/CMakeLists.txt | 4 + source/client/accAPI.cpp | 52 +++--- source/client/accAPI.h | 49 +++-- source/client/legacy_accAPI.cpp | 169 ++++++++++++++++++ source/client/legacy_accAPI.h | 58 ++++++ source/client/legacy_client.cpp | 12 ++ source/client/legacy_client.h | 14 +- source/client/udaClient.cpp | 18 +- source/client/udaClient.h | 2 +- source/client/udaGetAPI.cpp | 16 +- source/wrappers/c++/client.cpp | 46 ++--- source/wrappers/python/CMakeLists.txt | 2 + .../wrappers/python/pyuda/cpyuda/client.pyx | 10 +- source/wrappers/python/pyuda/cpyuda/uda.pxd | 6 +- 14 files changed, 364 insertions(+), 94 deletions(-) create mode 100644 source/client/legacy_accAPI.cpp create mode 100644 source/client/legacy_accAPI.h create mode 100644 source/client/legacy_client.cpp diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index ee5b83b2..cbaccd81 100755 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -48,6 +48,8 @@ set( SRC_FILES udaPutAPI.cpp udaClient.cpp udaClientHostList.cpp + legacy_accAPI.cpp + legacy_client.cpp ) set( HEADER_FILES @@ -66,6 +68,8 @@ set( HEADER_FILES udaPutAPI.h updateSelectParms.h udaClientHostList.h + legacy_accAPI.h + legacy_client.h ) include_directories( diff --git a/source/client/accAPI.cpp b/source/client/accAPI.cpp index 982a06bc..4b49772b 100755 --- a/source/client/accAPI.cpp +++ b/source/client/accAPI.cpp @@ -96,8 +96,9 @@ int getThreadId(thread_t id) } // Lock the thread and set the previous STATE -void lockIdamThread(CLIENT_FLAGS* client_flags) +void udaLockThread() { + CLIENT_FLAGS* client_flags = udaClientFlags(); static unsigned int mutex_initialised = 0; if (!mutex_initialised) { @@ -162,8 +163,9 @@ void lockIdamThread(CLIENT_FLAGS* client_flags) /** * Unlock the thread and save the current STATE */ -void unlockUdaThread(CLIENT_FLAGS* client_flags) +void udaUnlockThread() { + CLIENT_FLAGS* client_flags = udaClientFlags(); #ifdef __GNUC__ thread_t threadId = pthread_self(); #else @@ -188,9 +190,9 @@ void unlockUdaThread(CLIENT_FLAGS* client_flags) /** * Free thread resources */ -void freeIdamThread(CLIENT_FLAGS* client_flags) +void udaFreeThread() { - lockIdamThread(client_flags); + udaLockThread(); #ifdef __GNUC__ thread_t threadId = pthread_self(); #else @@ -212,13 +214,13 @@ void freeIdamThread(CLIENT_FLAGS* client_flags) initServerBlock(&(idamState[threadCount].server_block), 0); threadList[threadCount] = 0; } - unlockUdaThread(client_flags); + udaUnlockThread(); } #else -void lockIdamThread() {} -void unlockIdamThread() {} -void freeIdamThread() {} +void udaLockThread() {} +void udaUnlockThread() {} +void udaFreeThread() {} #endif // NOPTHREADS int getIdamThreadLastHandle() @@ -240,8 +242,9 @@ void acc_freeDataBlocks() putIdamThreadLastHandle(-1); } -DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags) +DATA_BLOCK* udaGetCurrentDataBlock() { + CLIENT_FLAGS* client_flags = udaClientFlags(); if ((client_flags->flags & CLIENTFLAG_REUSELASTHANDLE || client_flags->flags & CLIENTFLAG_FREEREUSELASTHANDLE) && getIdamThreadLastHandle() >= 0) { return &data_blocks[getIdamThreadLastHandle()]; @@ -249,8 +252,9 @@ DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags) return &data_blocks.back(); } -int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags) +int udaGetCurrentDataBlockIndex() { + CLIENT_FLAGS* client_flags = udaClientFlags(); if ((client_flags->flags & CLIENTFLAG_REUSELASTHANDLE || client_flags->flags & CLIENTFLAG_FREEREUSELASTHANDLE) && getIdamThreadLastHandle() >= 0) { return getIdamThreadLastHandle(); @@ -258,8 +262,9 @@ int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags) return data_blocks.size() - 1; } -int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags) +int udaGrowDataBlocks() { + CLIENT_FLAGS* client_flags = udaClientFlags(); if ((client_flags->flags & CLIENTFLAG_REUSELASTHANDLE || client_flags->flags & CLIENTFLAG_FREEREUSELASTHANDLE) && getIdamThreadLastHandle() >= 0) { return 0; @@ -284,8 +289,9 @@ static int findNewHandleIndex() return -1; } -int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags) +int udaGetNewDataHandle() { + CLIENT_FLAGS* client_flags = udaClientFlags(); int newHandleIndex = -1; if ((client_flags->flags & CLIENTFLAG_REUSELASTHANDLE || client_flags->flags & CLIENTFLAG_FREEREUSELASTHANDLE) && @@ -372,8 +378,9 @@ void resetIdamPrivateFlag(unsigned int flag) * @return Void. */ -void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) +void udaSetClientFlag(unsigned int flag) { + CLIENT_FLAGS* client_flags = udaClientFlags(); client_flags->flags = client_flags->flags | flag; } @@ -384,8 +391,9 @@ void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) * @return Void. */ -void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) +void udaResetClientFlag(unsigned int flag) { + CLIENT_FLAGS* client_flags = udaClientFlags(); client_flags->flags &= !flag; } @@ -417,9 +425,10 @@ void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) * @param property the name of the property to set true or a name value pair. * @return Void. */ -void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags) +void udaSetProperty(const char* property) { // User settings for Client and Server behaviour + CLIENT_FLAGS* client_flags = udaClientFlags(); char name[56]; char* value; @@ -477,9 +486,10 @@ void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags) * @param property the name of the property. * @return Void. */ -int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags) +int udaGetProperty(const char* property) { // User settings for Client and Server behaviour + CLIENT_FLAGS* client_flags = udaClientFlags(); if (property[0] == 'g') { if (STR_IEQUALS(property, "get_datadble")) return client_flags->get_datadble; @@ -513,9 +523,10 @@ int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags) * @return Void. */ -void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags) +void udaResetProperty(const char* property) { // User settings for Client and Server behaviour + CLIENT_FLAGS* client_flags = udaClientFlags(); if (property[0] == 'g') { if (STR_IEQUALS(property, "get_datadble")) client_flags->get_datadble = 0; @@ -547,9 +558,10 @@ void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags) /** * @return Void. */ -void resetIdamProperties(CLIENT_FLAGS* client_flags) +void udaResetProperties() { // Reset on Both Client and Server + CLIENT_FLAGS* client_flags = udaClientFlags(); client_flags->get_datadble = 0; client_flags->get_dimdble = 0; @@ -851,9 +863,9 @@ int getIdamDataStatus(int handle) /** \return handle. */ -int getIdamLastHandle(CLIENT_FLAGS* client_flags) +int udaGetLastHandle() { - return acc_getCurrentDataBlockIndex(client_flags); + return acc_getCurrentDataBlockIndex(); } //! returns the number of data items in the data object diff --git a/source/client/accAPI.h b/source/client/accAPI.h index 53ce83af..1be37aa2 100755 --- a/source/client/accAPI.h +++ b/source/client/accAPI.h @@ -8,6 +8,7 @@ #include #include #include "udaClient.h" +#include "legacy_accAPI.h" #ifdef __cplusplus extern "C" { @@ -15,13 +16,17 @@ extern "C" { #define UDA_NUM_CLIENT_THREADS 30 -LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags); +LIBRARY_API DATA_BLOCK* udaGetCurrentDataBlock(); +// LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags); -LIBRARY_API int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags); +LIBRARY_API int udaGetCurrentDataBlockIndex(); +// LIBRARY_API int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags); -LIBRARY_API int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags); +LIBRARY_API int udaGrowDataBlocks(); +// LIBRARY_API int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags); -LIBRARY_API int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags); +LIBRARY_API int udaGetNewDataHandle(); +// LIBRARY_API int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags); LIBRARY_API void acc_freeDataBlocks(); @@ -29,21 +34,29 @@ LIBRARY_API void setIdamPrivateFlag(unsigned int flag); LIBRARY_API void resetIdamPrivateFlag(unsigned int flag); -LIBRARY_API void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); +LIBRARY_API void udaSetClientFlag(unsigned int flag); +// LIBRARY_API void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); -LIBRARY_API void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); +LIBRARY_API void udaResetClientFlag(unsigned int flag); +// LIBRARY_API void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); -LIBRARY_API void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags); +LIBRARY_API void udaSetProperty(const char* property); +// LIBRARY_API void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags); -LIBRARY_API int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags); +LIBRARY_API int udaGetProperty(const char* property); +// LIBRARY_API int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags); -LIBRARY_API void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags); +LIBRARY_API void udaResetProperty(const char* property); +// LIBRARY_API void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags); -LIBRARY_API void resetIdamProperties(CLIENT_FLAGS* client_flags); +LIBRARY_API void udaResetProperties(); +// LIBRARY_API void resetIdamProperties(CLIENT_FLAGS* client_flags); -LIBRARY_API CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags); +LIBRARY_API CLIENT_BLOCK udaSaveProperties(); +// LIBRARY_API CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags); -LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags); +LIBRARY_API void udaRestoreProperties(CLIENT_BLOCK cb); +// LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags); LIBRARY_API CLIENT_BLOCK* getIdamProperties(int handle); @@ -83,7 +96,8 @@ LIBRARY_API int getIdamSignalStatus(int handle); LIBRARY_API int getIdamDataStatus(int handle); -LIBRARY_API int getIdamLastHandle(CLIENT_FLAGS* client_flags); +LIBRARY_API int udaGetLastHandle(); +// LIBRARY_API int getIdamLastHandle(CLIENT_FLAGS* client_flags); LIBRARY_API int getIdamDataNum(int handle); @@ -245,11 +259,14 @@ LIBRARY_API int getIdamDataCheckSum(int handle); LIBRARY_API int getIdamDimDataCheckSum(int handle, int ndim); -LIBRARY_API void lockIdamThread(CLIENT_FLAGS* client_flags); +LIBRARY_API void udaLockThread(); +// LIBRARY_API void lockIdamThread(CLIENT_FLAGS* client_flags); -LIBRARY_API void unlockUdaThread(CLIENT_FLAGS* client_flags); +LIBRARY_API void udaUnlockThread(); +// LIBRARY_API void unlockIdamThread(CLIENT_FLAGS* client_flags); -LIBRARY_API void freeIdamThread(CLIENT_FLAGS* client_flags); +LIBRARY_API void udaFreeThread(); +// LIBRARY_API void freeIdamThread(CLIENT_FLAGS* client_flags); LIBRARY_API int getIdamThreadLastHandle(); diff --git a/source/client/legacy_accAPI.cpp b/source/client/legacy_accAPI.cpp new file mode 100644 index 00000000..04fd1e58 --- /dev/null +++ b/source/client/legacy_accAPI.cpp @@ -0,0 +1,169 @@ +#include "legacy_accAPI.h" +#include "accAPI.h" + +#ifdef UDA_CLIENT_FLAGS_API + + DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags) + { + return udaGetCurrentDataBlock(); + } + + int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags) + { + return udaGetCurrentDataBlockIndex(); + } + + int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags) + { + return udaGrowDataBlocks(); + } + + int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags) + { + return udaGetNewDataHandle(); + } + + void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) + { + udaSetClientFlag(flag); + } + + void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) + { + udaResetClientFlag(flag); + } + + void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags) + { + udaSetProperty(property); + } + + int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags) + { + return udaGetProperty(property); + } + + void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags) + { + udaResetProperty(property); + } + + void resetIdamProperties(CLIENT_FLAGS* client_flags) + { + udaResetProperties(); + } + + CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags) + { + return udaSaveProperties(); + } + + void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags) + { + udaRestoreProperties(cb); + } + + int getIdamLastHandle(CLIENT_FLAGS* client_flags) + { + return udaGetLastHandle(); + } + + void lockIdamThread(CLIENT_FLAGS* client_flags) + { + udaLockThread(); + } + + void unlockUdaThread(CLIENT_FLAGS* client_flags) + { + udaUnlockThread(); + } + + void freeIdamThread(CLIENT_FLAGS* client_flags) + { + udaFreeThread(); + } + +#else + + DATA_BLOCK* acc_getCurrentDataBlock() + { + return udaGetCurrentDataBlock(); + } + + int acc_getCurrentDataBlockIndex() + { + return udaGetCurrentDataBlockIndex(); + } + + int acc_growIdamDataBlocks() + { + return udaGrowDataBlocks(); + } + + int acc_getIdamNewDataHandle() + { + return udaGetNewDataHandle(); + } + + void setIdamClientFlag(unsigned int flag) + { + udaSetClientFlag(flag); + } + + void resetIdamClientFlag(unsigned int flag) + { + udaResetClientFlag(flag); + } + + void setIdamProperty(const char* property) + { + udaSetProperty(property); + } + + int getIdamProperty(const char* property) + { + return udaGetProperty(property); + } + + void resetIdamProperty(const char* property) + { + udaResetProperty(property); + } + + void resetIdamProperties() + { + udaResetProperties(); + } + + CLIENT_BLOCK saveIdamProperties() + { + return udaSaveProperties(); + } + + void restoreIdamProperties(CLIENT_BLOCK cb) + { + udaRestoreProperties(cb); + } + + int getIdamLastHandle() + { + return udaGetLastHandle(); + } + + void lockIdamThread() + { + udaLockThread(); + } + + void unlockUdaThread() + { + udaUnlockThread(); + } + + void freeIdamThread() + { + udaFreeThread(); + } + +#endif // UDA_LEGACY_API + diff --git a/source/client/legacy_accAPI.h b/source/client/legacy_accAPI.h new file mode 100644 index 00000000..f7c0fa02 --- /dev/null +++ b/source/client/legacy_accAPI.h @@ -0,0 +1,58 @@ +#ifndef LEGACY_ACCAPI_H +#define LEGACY_ACCAPI_H + +#include +#include "udaClient.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef UDA_CLIENT_FLAGS_API +// #warning "Using legacy API names with redundant \"client_flags\" arguments, these will be deprecated in future" + + LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags); + LIBRARY_API int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags); + LIBRARY_API int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags); + LIBRARY_API int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags); + LIBRARY_API void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); + LIBRARY_API void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); + LIBRARY_API void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags); + LIBRARY_API int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags); + LIBRARY_API void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags); + LIBRARY_API void resetIdamProperties(CLIENT_FLAGS* client_flags); + LIBRARY_API CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags); + LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags); + LIBRARY_API int getIdamLastHandle(CLIENT_FLAGS* client_flags); + LIBRARY_API void lockIdamThread(CLIENT_FLAGS* client_flags); + LIBRARY_API void unlockUdaThread(CLIENT_FLAGS* client_flags); + LIBRARY_API void freeIdamThread(CLIENT_FLAGS* client_flags); +#else + + LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(); + LIBRARY_API int acc_getCurrentDataBlockIndex(); + LIBRARY_API int acc_growIdamDataBlocks(); + LIBRARY_API int acc_getIdamNewDataHandle(); + 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(); + LIBRARY_API CLIENT_BLOCK saveIdamProperties(); + LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb); + LIBRARY_API int getIdamLastHandle(); + LIBRARY_API void lockIdamThread(); + LIBRARY_API void unlockUdaThread(); + LIBRARY_API void freeIdamThread(); + +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif // LEGACY_ACCAPI_H diff --git a/source/client/legacy_client.cpp b/source/client/legacy_client.cpp new file mode 100644 index 00000000..a3c61cba --- /dev/null +++ b/source/client/legacy_client.cpp @@ -0,0 +1,12 @@ +#include "legacy_client.h" + +void idamFree(int handle) +{ + udaFree(handle); +} + +void idamFreeAll() +{ + udaFreeAll(); +} + diff --git a/source/client/legacy_client.h b/source/client/legacy_client.h index e850b772..be621308 100644 --- a/source/client/legacy_client.h +++ b/source/client/legacy_client.h @@ -1,19 +1,15 @@ #ifndef LEGACY_CLIENT_H #define LEGACY_CLIENT_H +#include +#include "udaClient.h" + #ifdef __cplusplus extern "C" { #endif -LIBRARY_API inline void idamFree(int handle) -{ - udaFree(handle); -} - -LIBRARY_API inline void idamFreeAll() -{ - udaFreeAll(); -} +LIBRARY_API inline void idamFree(int handle); +LIBRARY_API inline void idamFreeAll(); #ifdef __cplusplus } diff --git a/source/client/udaClient.cpp b/source/client/udaClient.cpp index 82b350f7..78f4d5b5 100755 --- a/source/client/udaClient.cpp +++ b/source/client/udaClient.cpp @@ -930,7 +930,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) //------------------------------------------------------------------------------ // Allocate memory for the Data Block Structure // Re-use existing stale Data Blocks - int data_block_idx = acc_getIdamNewDataHandle(client_flags); + int data_block_idx = acc_getIdamNewDataHandle(); if (data_block_idx < 0) { // Error data_block_indices[i] = -data_block_idx; @@ -1426,9 +1426,7 @@ void udaFreeAll() uda::cache::free_cache(); #endif - CLIENT_FLAGS* client_flags = udaClientFlags(); - - for (int i = 0; i < acc_getCurrentDataBlockIndex(client_flags); ++i) { + for (int i = 0; i < acc_getCurrentDataBlockIndex(); ++i) { #ifndef FATCLIENT freeDataBlock(getIdamDataBlock(i)); #else @@ -1493,9 +1491,11 @@ void putIdamThreadClientBlock(CLIENT_BLOCK* str) client_block = *str; } -CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags) -{ // save current state of properties for future rollback +CLIENT_BLOCK udaSaveProperties() +{ + // save current state of properties for future rollback CLIENT_BLOCK cb = client_block; // Copy of Global Structure (maybe not initialised! i.e. idam API not called) + CLIENT_FLAGS* client_flags = udaClientFlags(); cb.get_datadble = client_flags->get_datadble; // Copy individual properties only cb.get_dimdble = client_flags->get_dimdble; cb.get_timedble = client_flags->get_timedble; @@ -1513,8 +1513,9 @@ CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags) return cb; } -void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags) -{ // Restore Properties to a prior saved state +void udaRestoreProperties(CLIENT_BLOCK cb) +{ + // Restore Properties to a prior saved state client_block.get_datadble = cb.get_datadble; // Overwrite Individual Global Structure Components client_block.get_dimdble = cb.get_dimdble; client_block.get_timedble = cb.get_timedble; @@ -1528,6 +1529,7 @@ void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags) client_block.clientFlags = cb.clientFlags; client_block.altRank = cb.altRank; + CLIENT_FLAGS* client_flags = udaClientFlags(); client_flags->get_datadble = client_block.get_datadble; client_flags->get_dimdble = client_block.get_dimdble; client_flags->get_timedble = client_block.get_timedble; diff --git a/source/client/udaClient.h b/source/client/udaClient.h index e1800a35..4e7fae6b 100755 --- a/source/client/udaClient.h +++ b/source/client/udaClient.h @@ -7,6 +7,7 @@ #include #include #include +#include "legacy_client.h" #ifdef __cplusplus extern "C" { @@ -118,6 +119,5 @@ LIBRARY_API void setLogMallocList(LOGMALLOCLIST* logmalloclist_in); } #endif -#include "legacy_client.h" #endif // UDA_CLIENT_UDACLIENT_H diff --git a/source/client/udaGetAPI.cpp b/source/client/udaGetAPI.cpp index 3c1fd02d..0c4c02ce 100755 --- a/source/client/udaGetAPI.cpp +++ b/source/client/udaGetAPI.cpp @@ -148,7 +148,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c CLIENT_FLAGS* client_flags = udaClientFlags(); // Lock the thread - lockIdamThread(client_flags); + lockIdamThread(); if (host != nullptr) { putIdamServerHost(host); @@ -176,7 +176,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c static bool reopen_logs = true; if (udaStartup(0, client_flags, &reopen_logs) != 0) { - unlockUdaThread(client_flags); + unlockUdaThread(); return PROBLEM_OPENING_LOGS; } @@ -217,7 +217,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c UDA_LOG(UDA_LOG_ERROR, "Error identifying the Data Source [%s]\n", data_source); addIdamError(UDA_CODE_ERROR_TYPE, __func__, 999, "Error identifying the Data Source"); } - unlockUdaThread(client_flags); + unlockUdaThread(); return -err; } @@ -246,7 +246,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c freeClientRequestBlock(&request_block); // Unlock the thread - unlockUdaThread(client_flags); + unlockUdaThread(); return handle; } @@ -260,7 +260,7 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun CLIENT_FLAGS* client_flags = udaClientFlags(); // Lock the thread - lockIdamThread(client_flags); + lockIdamThread(); if (host != nullptr) { putIdamServerHost(host); @@ -287,7 +287,7 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun static bool reopen_logs = true; if (udaStartup(0, client_flags, &reopen_logs) != 0) { - unlockUdaThread(client_flags); + unlockUdaThread(); return PROBLEM_OPENING_LOGS; } @@ -328,7 +328,7 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun if (udaNumErrors() == 0) { addIdamError(UDA_CODE_ERROR_TYPE, __func__, 999, "Error identifying the Data Source"); } - unlockUdaThread(client_flags); + unlockUdaThread(); return -err; } @@ -353,6 +353,6 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun #endif // Unlock the thread - unlockUdaThread(client_flags); + unlockUdaThread(); return err; } diff --git a/source/wrappers/c++/client.cpp b/source/wrappers/c++/client.cpp index 56433b2d..f55b5c08 100755 --- a/source/wrappers/c++/client.cpp +++ b/source/wrappers/c++/client.cpp @@ -44,10 +44,10 @@ void uda::Client::setProperty(Property prop, bool value) throw UDAException("Unknown property"); } - CLIENT_FLAGS* client_flags = udaClientFlags(); + // CLIENT_FLAGS* client_flags = udaClientFlags(); value - ? setIdamProperty(name.c_str(), client_flags) - : resetIdamProperty(name.c_str(), client_flags); + ? setIdamProperty(name.c_str()) + : resetIdamProperty(name.c_str()); } void uda::Client::setProperty(Property prop, int value) @@ -74,11 +74,11 @@ void uda::Client::setProperty(Property prop, int value) case PROP_TIMEOUT: name = (boost::format("timeout=%1%") % value).str(); - setIdamProperty(name.c_str(), udaClientFlags()); + setIdamProperty(name.c_str()); break; case PROP_ALTRANK: name = (boost::format("altrank=%1%") % value).str(); - setIdamProperty(name.c_str(), udaClientFlags()); + setIdamProperty(name.c_str()); break; default: @@ -93,25 +93,25 @@ void uda::Client::close() int uda::Client::property(Property prop) { - auto client_flags = udaClientFlags(); + // auto client_flags = udaClientFlags(); switch (prop) { - case PROP_DATADBLE: return getIdamProperty("get_datadble", client_flags); - case PROP_DIMDBLE: return getIdamProperty("get_dimdble", client_flags); - case PROP_TIMEDBLE: return getIdamProperty("get_timedble", client_flags); - case PROP_BYTES: return getIdamProperty("get_bytes", client_flags); - case PROP_BAD: return getIdamProperty("get_bad", client_flags); - case PROP_META: return getIdamProperty("get_meta", client_flags); - case PROP_ASIS: return getIdamProperty("get_asis", client_flags); - case PROP_UNCAL: return getIdamProperty("get_uncal", client_flags); - case PROP_NOTOFF: return getIdamProperty("get_notoff", client_flags); - case PROP_SYNTHETIC: return getIdamProperty("get_synthetic", client_flags); - case PROP_SCALAR: return getIdamProperty("get_scalar", client_flags); - case PROP_NODIMDATA: return getIdamProperty("get_nodimdata", client_flags); - case PROP_VERBOSE: return getIdamProperty("verbose", client_flags); - case PROP_DEBUG: return getIdamProperty("debug", client_flags); - case PROP_ALTDATA: return getIdamProperty("altdata", client_flags); - case PROP_TIMEOUT: return getIdamProperty("timeout", client_flags); - case PROP_ALTRANK: return getIdamProperty("altrank", client_flags); + case PROP_DATADBLE: return getIdamProperty("get_datadble"); + case PROP_DIMDBLE: return getIdamProperty("get_dimdble"); + case PROP_TIMEDBLE: return getIdamProperty("get_timedble"); + case PROP_BYTES: return getIdamProperty("get_bytes"); + case PROP_BAD: return getIdamProperty("get_bad"); + case PROP_META: return getIdamProperty("get_meta"); + case PROP_ASIS: return getIdamProperty("get_asis"); + case PROP_UNCAL: return getIdamProperty("get_uncal"); + case PROP_NOTOFF: return getIdamProperty("get_notoff"); + case PROP_SYNTHETIC: return getIdamProperty("get_synthetic"); + case PROP_SCALAR: return getIdamProperty("get_scalar"); + case PROP_NODIMDATA: return getIdamProperty("get_nodimdata"); + case PROP_VERBOSE: return getIdamProperty("verbose"); + case PROP_DEBUG: return getIdamProperty("debug"); + case PROP_ALTDATA: return getIdamProperty("altdata"); + case PROP_TIMEOUT: return getIdamProperty("timeout"); + case PROP_ALTRANK: return getIdamProperty("altrank"); default: throw UDAException("Unknown property"); diff --git a/source/wrappers/python/CMakeLists.txt b/source/wrappers/python/CMakeLists.txt index b4ae609a..acbed12f 100755 --- a/source/wrappers/python/CMakeLists.txt +++ b/source/wrappers/python/CMakeLists.txt @@ -55,3 +55,5 @@ endif() configure_file( ${CMAKE_CURRENT_LIST_DIR}/setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py @ONLY ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.py DESTINATION python_installer ) +install( FILES ${CMAKE_CURRENT_LIST_DIR}/pyproject.toml DESTINATION python_installer ) +install( FILES ${CMAKE_CURRENT_LIST_DIR}/README.md DESTINATION python_installer ) diff --git a/source/wrappers/python/pyuda/cpyuda/client.pyx b/source/wrappers/python/pyuda/cpyuda/client.pyx index 0dc57b7c..d45b8727 100644 --- a/source/wrappers/python/pyuda/cpyuda/client.pyx +++ b/source/wrappers/python/pyuda/cpyuda/client.pyx @@ -40,21 +40,19 @@ else: def set_property(prop_name, value): if prop_name.lower() not in _properties: raise ValueError('invalid property ' + prop_name) - cdef uda.CLIENT_FLAGS* client_flags = uda.udaClientFlags() if _properties[prop_name][1]: prop_string = prop_name + '=' + str(value) - uda.setIdamProperty(prop_string.encode(), client_flags) + uda.setIdamProperty(prop_string.encode()) elif value: - uda.setIdamProperty(prop_name.encode(), client_flags) + uda.setIdamProperty(prop_name.encode()) else: - uda.resetIdamProperty(prop_name.encode(), client_flags) + uda.resetIdamProperty(prop_name.encode()) def get_property(prop_name): if prop_name.lower() not in _properties: raise ValueError('invalid property ' + prop_name) - cdef uda.CLIENT_FLAGS* client_flags = uda.udaClientFlags() - prop = uda.getIdamProperty(prop_name.encode(), client_flags) + prop = uda.getIdamProperty(prop_name.encode()) if _properties[prop_name][1]: return prop else: diff --git a/source/wrappers/python/pyuda/cpyuda/uda.pxd b/source/wrappers/python/pyuda/cpyuda/uda.pxd index edbc188a..988ed258 100644 --- a/source/wrappers/python/pyuda/cpyuda/uda.pxd +++ b/source/wrappers/python/pyuda/cpyuda/uda.pxd @@ -112,9 +112,9 @@ cdef extern from "client/accAPI.h": int getIdamErrorType(int handle); void putIdamServerHost(const char* host); void putIdamServerPort(int port); - int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags) - void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags); - void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags); + int getIdamProperty(const char* property) + void setIdamProperty(const char* property); + void resetIdamProperty(const char* property); const char* getIdamDataLabel(int handle); const char* getIdamDataUnits(int handle); const char* getIdamDataDesc(int handle); From 7f13f6ee0d5b01cedfecbea2ccbfecff0f27d0f7 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 11:11:45 +0100 Subject: [PATCH 38/54] removing client flags from api functions --- source/client/udaClient.cpp | 6 +- source/wrappers/idl/idam_dlm.c | 290 ++++++++++++++++----------------- 2 files changed, 141 insertions(+), 155 deletions(-) diff --git a/source/client/udaClient.cpp b/source/client/udaClient.cpp index 78f4d5b5..f6fbd3f1 100755 --- a/source/client/udaClient.cpp +++ b/source/client/udaClient.cpp @@ -125,7 +125,7 @@ int check_file_cache(const REQUEST_DATA* request_data, DATA_BLOCK** p_data_block if (data != nullptr) { // Success - int data_block_idx = acc_getIdamNewDataHandle(client_flags); + int data_block_idx = acc_getIdamNewDataHandle(); if (data_block_idx < 0) { // Error return -data_block_idx; @@ -163,7 +163,7 @@ int check_mem_cache(uda::cache::UdaCache* cache, REQUEST_DATA* request_data, DAT if (data != nullptr) { // Success - int data_block_idx = acc_getIdamNewDataHandle(client_flags); + int data_block_idx = acc_getIdamNewDataHandle(); if (data_block_idx < 0) { // Error return -data_block_idx; @@ -1008,7 +1008,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) for (int i = 0; i < data_block_list0.count; ++i) { DATA_BLOCK* data_block0 = &data_block_list0.data[i]; - int data_block_idx = acc_getIdamNewDataHandle(client_flags); + int data_block_idx = acc_getIdamNewDataHandle(); DATA_BLOCK* data_block = getIdamDataBlock(data_block_idx); // data blocks may have been realloc'ed copyDataBlock(data_block, data_block0); diff --git a/source/wrappers/idl/idam_dlm.c b/source/wrappers/idl/idam_dlm.c index 149f5d60..a5e9247c 100755 --- a/source/wrappers/idl/idam_dlm.c +++ b/source/wrappers/idl/idam_dlm.c @@ -1186,18 +1186,17 @@ IDL_VPTR IDL_CDECL idamputapi(int argc, IDL_VPTR argv[], char* argk) sout->status = (IDL_LONG)status; sout->error_code = (IDL_LONG)error_code; - CLIENT_FLAGS* client_flags = udaClientFlags(); - sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble", client_flags); // (IDL_LONG) kw.get_datadble; - sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble", client_flags); // (IDL_LONG) kw.get_dimdble; - sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble", client_flags); // (IDL_LONG) kw.get_timedble; - sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar", client_flags); // (IDL_LONG) kw.get_scalar; - sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes", client_flags); // (IDL_LONG) kw.get_bytes; - sout->get_asis = (IDL_LONG)getIdamProperty("get_asis", client_flags); // (IDL_LONG) kw.get_asis; - sout->get_bad = (IDL_LONG)getIdamProperty("get_bad", client_flags); // (IDL_LONG) kw.get_bad; - sout->get_meta = (IDL_LONG)getIdamProperty("get_meta", client_flags); // (IDL_LONG) kw.get_meta; - sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal", client_flags); // (IDL_LONG) kw.get_uncal; - sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff", client_flags); // (IDL_LONG) kw.get_notoff; - sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata", client_flags); // (IDL_LONG) kw.get_nodimdata; + sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; + sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; + sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; + sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; + sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; + sout->get_asis = (IDL_LONG)getIdamProperty("get_asis"); // (IDL_LONG) kw.get_asis; + sout->get_bad = (IDL_LONG)getIdamProperty("get_bad"); // (IDL_LONG) kw.get_bad; + sout->get_meta = (IDL_LONG)getIdamProperty("get_meta"); // (IDL_LONG) kw.get_meta; + sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; + sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; + sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; IDL_StrStore(&(sout->signal), ""); IDL_StrStore(&(sout->source), ""); @@ -1296,8 +1295,7 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) char source[STRING_LENGTH]; int exp_number = 0; - CLIENT_FLAGS* client_flags = udaClientFlags(); - CLIENT_BLOCK cblock = saveIdamProperties(client_flags); // preserve the current set of client properties + CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties int handle, status, error_code; char* error_msg; @@ -1544,55 +1542,55 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) // Process Keywords (take Priority over Passed Arguments) if (kw.debug) { - setIdamProperty("debug", client_flags); // Cannot be reset (currently!) + setIdamProperty("debug"); // Cannot be reset (currently!) } if (kw.verbose) { - setIdamProperty("verbose", client_flags); + setIdamProperty("verbose"); } if (kw.get_datadble) { - setIdamProperty("get_datadble", client_flags); // Properties passed by Keyword must be reset to the prior state + setIdamProperty("get_datadble"); // Properties passed by Keyword must be reset to the prior state } if (kw.get_dimdble) { - setIdamProperty("get_dimdble", client_flags); + setIdamProperty("get_dimdble"); } if (kw.get_timedble) { - setIdamProperty("get_timedble", client_flags); + setIdamProperty("get_timedble"); } if (kw.get_scalar) { - setIdamProperty("get_scalar", client_flags); + setIdamProperty("get_scalar"); } if (kw.get_bytes) { - setIdamProperty("get_bytes", client_flags); + setIdamProperty("get_bytes"); } if (kw.get_asis) { - setIdamProperty("get_asis", client_flags); + setIdamProperty("get_asis"); } if (kw.get_bad) { - setIdamProperty("get_bad", client_flags); + setIdamProperty("get_bad"); } if (kw.get_meta) { - setIdamProperty("get_meta", client_flags); + setIdamProperty("get_meta"); } if (kw.get_uncal) { - setIdamProperty("get_uncal", client_flags); + setIdamProperty("get_uncal"); } if (kw.get_notoff) { - setIdamProperty("get_notoff", client_flags); + setIdamProperty("get_notoff"); } if (kw.get_nodimdata) { - setIdamProperty("get_nodimdata", client_flags); + setIdamProperty("get_nodimdata"); } //-------------------------------------------------------------------------- @@ -1623,7 +1621,7 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_BAD_HANDLE)); } @@ -1637,7 +1635,7 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_HEAP_ALLOC_ERROR)); } @@ -1651,17 +1649,17 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) sout->status = (IDL_LONG)status; sout->error_code = (IDL_LONG)error_code; - sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble", client_flags); // (IDL_LONG) kw.get_datadble; - sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble", client_flags); // (IDL_LONG) kw.get_dimdble; - sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble", client_flags); // (IDL_LONG) kw.get_timedble; - sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar", client_flags); // (IDL_LONG) kw.get_scalar; - sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes", client_flags); // (IDL_LONG) kw.get_bytes; - sout->get_asis = (IDL_LONG)getIdamProperty("get_asis", client_flags); // (IDL_LONG) kw.get_asis; - sout->get_bad = (IDL_LONG)getIdamProperty("get_bad", client_flags); // (IDL_LONG) kw.get_bad; - sout->get_meta = (IDL_LONG)getIdamProperty("get_meta", client_flags); // (IDL_LONG) kw.get_meta; - sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal", client_flags); // (IDL_LONG) kw.get_uncal; - sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff", client_flags); // (IDL_LONG) kw.get_notoff; - sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata", client_flags); // (IDL_LONG) kw.get_nodimdata; + sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; + sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; + sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; + sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; + sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; + sout->get_asis = (IDL_LONG)getIdamProperty("get_asis"); // (IDL_LONG) kw.get_asis; + sout->get_bad = (IDL_LONG)getIdamProperty("get_bad"); // (IDL_LONG) kw.get_bad; + sout->get_meta = (IDL_LONG)getIdamProperty("get_meta"); // (IDL_LONG) kw.get_meta; + sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; + sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; + sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; IDL_StrStore(&(sout->signal), signal); IDL_StrStore(&(sout->source), source); @@ -1704,7 +1702,7 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (ivReturn); } @@ -1726,8 +1724,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) int useIdamGetAPI = 0; static IDL_LONG exp_number, pass = -1, mdstreenum; - CLIENT_FLAGS* client_flags = udaClientFlags(); - CLIENT_BLOCK cblock = saveIdamProperties(client_flags); // preserve the current set of client properties + CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties int handle, rank, order, status, error_code; char* error_msg; @@ -1952,7 +1949,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_ARGUMENTS)); } @@ -1968,7 +1965,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NOT_IMPLEMENTED)); } @@ -2002,47 +1999,47 @@ callidam(int argc, IDL_VPTR argv[], char* argk) if ((int)asin->get_datadble) { setIdamProperty( - "get_datadble", client_flags); // Properties passed by Structure must be reset to the prior state + "get_datadble"); // Properties passed by Structure must be reset to the prior state } if ((int)asin->get_dimdble) { - setIdamProperty("get_dimdble", client_flags); + setIdamProperty("get_dimdble"); } if ((int)asin->get_timedble) { - setIdamProperty("get_timedble", client_flags); + setIdamProperty("get_timedble"); } if ((int)asin->get_scalar) { - setIdamProperty("get_scalar", client_flags); + setIdamProperty("get_scalar"); } if ((int)asin->get_bytes) { - setIdamProperty("get_bytes", client_flags); + setIdamProperty("get_bytes"); } if ((int)asin->get_asis) { - setIdamProperty("get_asis", client_flags); + setIdamProperty("get_asis"); } if ((int)asin->get_bad) { - setIdamProperty("get_bad", client_flags); + setIdamProperty("get_bad"); } if ((int)asin->get_meta) { - setIdamProperty("get_meta", client_flags); + setIdamProperty("get_meta"); } if ((int)asin->get_uncal) { - setIdamProperty("get_uncal", client_flags); + setIdamProperty("get_uncal"); } if ((int)asin->get_notoff) { - setIdamProperty("get_notoff", client_flags); + setIdamProperty("get_notoff"); } if ((int)asin->get_nodimdata) { - setIdamProperty("get_nodimdata", client_flags); + setIdamProperty("get_nodimdata"); } if (strlen(signal) > 0 && strlen(source) > 0) { @@ -2062,7 +2059,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_EXP_NUMBER)); } @@ -2081,7 +2078,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NOT_IMPLEMENTED)); } @@ -2110,7 +2107,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_EXP_NUMBER)); } } @@ -2133,7 +2130,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_SIGNAL_ARGUMENT)); } @@ -2152,7 +2149,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NOT_IMPLEMENTED)); } @@ -2172,7 +2169,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_SIGNAL_ARGUMENT)); } @@ -2365,55 +2362,55 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } if (kw.debug) { - setIdamProperty("debug", client_flags); // Cannot be reset (currently!) + setIdamProperty("debug"); // Cannot be reset (currently!) } if (kw.verbose) { - setIdamProperty("verbose", client_flags); + setIdamProperty("verbose"); } if (kw.get_datadble) { - setIdamProperty("get_datadble", client_flags); // Properties passed by Keyword must be reset to the prior state + setIdamProperty("get_datadble"); // Properties passed by Keyword must be reset to the prior state } if (kw.get_dimdble) { - setIdamProperty("get_dimdble", client_flags); + setIdamProperty("get_dimdble"); } if (kw.get_timedble) { - setIdamProperty("get_timedble", client_flags); + setIdamProperty("get_timedble"); } if (kw.get_scalar) { - setIdamProperty("get_scalar", client_flags); + setIdamProperty("get_scalar"); } if (kw.get_bytes) { - setIdamProperty("get_bytes", client_flags); + setIdamProperty("get_bytes"); } if (kw.get_asis) { - setIdamProperty("get_asis", client_flags); + setIdamProperty("get_asis"); } if (kw.get_bad) { - setIdamProperty("get_bad", client_flags); + setIdamProperty("get_bad"); } if (kw.get_meta) { - setIdamProperty("get_meta", client_flags); + setIdamProperty("get_meta"); } if (kw.get_uncal) { - setIdamProperty("get_uncal", client_flags); + setIdamProperty("get_uncal"); } if (kw.get_notoff) { - setIdamProperty("get_notoff", client_flags); + setIdamProperty("get_notoff"); } if (kw.get_nodimdata) { - setIdamProperty("get_nodimdata", client_flags); + setIdamProperty("get_nodimdata"); } //-------------------------------------------------------------------------- @@ -2422,7 +2419,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) if (kw.help) { userhelp(stdout, "getidam"); IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(0)); } @@ -2515,7 +2512,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_API_IDENTIFIED)); } } @@ -2540,7 +2537,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_BAD_HANDLE)); } @@ -2557,7 +2554,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_HEAP_ALLOC_ERROR)); } @@ -2573,17 +2570,17 @@ callidam(int argc, IDL_VPTR argv[], char* argk) sout->status = (IDL_LONG)status; sout->error_code = (IDL_LONG)error_code; - sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble", client_flags); // (IDL_LONG) kw.get_datadble; - sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble", client_flags); // (IDL_LONG) kw.get_dimdble; - sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble", client_flags); // (IDL_LONG) kw.get_timedble; - sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar", client_flags); // (IDL_LONG) kw.get_scalar; - sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes", client_flags); // (IDL_LONG) kw.get_bytes; - sout->get_asis = (IDL_LONG)getIdamProperty("get_asis", client_flags); // (IDL_LONG) kw.get_asis; - sout->get_bad = (IDL_LONG)getIdamProperty("get_bad", client_flags); // (IDL_LONG) kw.get_bad; - sout->get_meta = (IDL_LONG)getIdamProperty("get_meta", client_flags); // (IDL_LONG) kw.get_meta; - sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal", client_flags); // (IDL_LONG) kw.get_uncal; - sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff", client_flags); // (IDL_LONG) kw.get_notoff; - sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata", client_flags); // (IDL_LONG) kw.get_nodimdata; + sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; + sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; + sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; + sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; + sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; + sout->get_asis = (IDL_LONG)getIdamProperty("get_asis"); // (IDL_LONG) kw.get_asis; + sout->get_bad = (IDL_LONG)getIdamProperty("get_bad"); // (IDL_LONG) kw.get_bad; + sout->get_meta = (IDL_LONG)getIdamProperty("get_meta"); // (IDL_LONG) kw.get_meta; + sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; + sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; + sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; IDL_StrStore(&(sout->signal), signal); IDL_StrStore(&(sout->source), source); @@ -2627,7 +2624,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (ivReturn); } @@ -2640,11 +2637,10 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) int data_n, rank, ndata, errtype; - CLIENT_FLAGS* client_flags = udaClientFlags(); - CLIENT_BLOCK cblock = saveIdamProperties(client_flags); // preserve the current set of client properties + CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad", client_flags); // Current client get_bad property + int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property IDAM_SIN* sin = NULL; // Input Structure IDAM_DOUT* sout = NULL; // Returned Structure @@ -2845,7 +2841,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad", client_flags); + setIdamProperty("get_bad"); client_get_bad = 1; } @@ -2871,7 +2867,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -2889,7 +2885,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -2907,7 +2903,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -2917,7 +2913,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -2927,7 +2923,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_RANK_TOO_HIGH)); } @@ -3134,7 +3130,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_UNKNOWN_DATA_TYPE)); } @@ -3144,7 +3140,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_HEAP_ALLOC_ERROR)); } @@ -3174,7 +3170,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords and IDAM Heap IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (ivReturn); } @@ -3199,11 +3195,10 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) IDAM_SIN* sin; // Returned Structure - CLIENT_FLAGS* client_flags = udaClientFlags(); - CLIENT_BLOCK cblock = saveIdamProperties(client_flags); // preserve the current set of client properties + CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad", client_flags); // Current client get_bad property + int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property char* dvec; IDL_VPTR idlArray = NULL; @@ -3259,7 +3254,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) sin = (IDAM_SIN*)argv[0]->value.s.arr->data; // Input Structure if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad", client_flags); + setIdamProperty("get_bad"); client_get_bad = 1; } @@ -3289,7 +3284,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -3303,7 +3298,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -3402,7 +3397,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_UNKNOWN_DATA_TYPE)); } @@ -3411,7 +3406,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (idlArray); } @@ -3437,11 +3432,10 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) IDAM_SIN* sin; // Returned Structure - CLIENT_FLAGS* client_flags = udaClientFlags(); - CLIENT_BLOCK cblock = saveIdamProperties(client_flags); //preserve the current set of client properties + CLIENT_BLOCK cblock = saveIdamProperties(); //preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad", client_flags); // Current client get_bad property + int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property char* dvec; IDL_VPTR idlArray = NULL; @@ -3497,7 +3491,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) sin = (IDAM_SIN*)argv[0]->value.s.arr->data; // Input Structure if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad", client_flags); + setIdamProperty("get_bad"); client_get_bad = 1; } @@ -3507,7 +3501,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_VALID_HANDLE)); } @@ -3528,7 +3522,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -3542,7 +3536,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -3643,7 +3637,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_UNKNOWN_DATA_TYPE)); } @@ -3652,7 +3646,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (idlArray); } @@ -3681,11 +3675,10 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) IDAM_SIN* sin = NULL; // Input Structure IDAM_DIMOUT* sout = NULL; // Returned Structure - CLIENT_FLAGS* client_flags = udaClientFlags(); - CLIENT_BLOCK cblock = saveIdamProperties(client_flags); // preserve the current set of client properties + CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad", client_flags); // Current client get_bad property + int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property IDL_VPTR ivReturn = NULL; @@ -3888,7 +3881,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) dimid = IDL_LongScalar(argv[1]); if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad", client_flags); + setIdamProperty("get_bad"); client_get_bad = 1; } @@ -3898,7 +3891,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_VALID_HANDLE)); } @@ -3919,7 +3912,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -3933,7 +3926,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -3946,7 +3939,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_SUCH_DIMENSION)); } @@ -4119,7 +4112,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_HEAP_ALLOC_ERROR)); } @@ -4141,7 +4134,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (ivReturn); } @@ -4165,11 +4158,10 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) IDAM_SIN* sin; // Returned Structure - CLIENT_FLAGS* client_flags = udaClientFlags(); - CLIENT_BLOCK cblock = saveIdamProperties(client_flags); // preserve the current set of client properties + CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad", client_flags); // Current client get_bad property + int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property char* dvec; IDL_VPTR idlArray = NULL; @@ -4228,7 +4220,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) dimid = IDL_LongScalar(argv[1]); if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad", client_flags); + setIdamProperty("get_bad"); client_get_bad = 1; } @@ -4238,7 +4230,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_VALID_HANDLE)); } @@ -4259,7 +4251,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -4273,7 +4265,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -4286,7 +4278,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_NO_SUCH_DIMENSION)); } @@ -4403,7 +4395,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (IDL_GettmpLong(GDE_UNKNOWN_DATA_TYPE)); } @@ -4412,7 +4404,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock, client_flags); + restoreIdamProperties(cblock); return (idlArray); } @@ -6865,8 +6857,7 @@ setproperty(int argc, IDL_VPTR argv[], char* argk) { IDL_ENSURE_STRING(argv[0]); // Single String IDL_ENSURE_SCALAR(argv[0]); - CLIENT_FLAGS* client_flags = udaClientFlags(); - setIdamProperty((char*)IDL_STRING_STR(&argv[0]->value.str), client_flags); + setIdamProperty((char*)IDL_STRING_STR(&argv[0]->value.str)); return (IDL_GettmpLong(0)); } @@ -6876,8 +6867,7 @@ resetproperty(int argc, IDL_VPTR argv[], char* argk) { IDL_ENSURE_STRING(argv[0]); // Single String IDL_ENSURE_SCALAR(argv[0]); - CLIENT_FLAGS* client_flags = udaClientFlags(); - resetIdamProperty((char*)IDL_STRING_STR(&argv[0]->value.str), client_flags); + resetIdamProperty((char*)IDL_STRING_STR(&argv[0]->value.str)); return (IDL_GettmpLong(0)); } @@ -6885,8 +6875,7 @@ IDL_VPTR IDL_CDECL resetproperties(int argc, IDL_VPTR argv[], char* argk) { - CLIENT_FLAGS* client_flags = udaClientFlags(); - resetIdamProperties(client_flags); + resetIdamProperties(); return (IDL_GettmpLong(0)); } @@ -6895,8 +6884,7 @@ IDL_VPTR IDL_CDECL setidamclientflag(int argc, IDL_VPTR argv[], char* argk) { IDL_ENSURE_SCALAR(argv[0]); - CLIENT_FLAGS* client_flags = udaClientFlags(); - setIdamClientFlag(client_flags, (unsigned int)IDL_ULongScalar(argv[0])); + setIdamClientFlag((unsigned int)IDL_ULongScalar(argv[0])); return (IDL_GettmpLong(0)); } @@ -6905,8 +6893,7 @@ IDL_VPTR IDL_CDECL resetidamclientflag(int argc, IDL_VPTR argv[], char* argk) { IDL_ENSURE_SCALAR(argv[0]); - CLIENT_FLAGS* client_flags = udaClientFlags(); - resetIdamClientFlag(client_flags, (unsigned int)IDL_ULongScalar(argv[0])); + resetIdamClientFlag((unsigned int)IDL_ULongScalar(argv[0])); return (IDL_GettmpLong(0)); } @@ -7392,8 +7379,7 @@ IDL_VPTR IDL_CDECL getlasthandle(int argc, IDL_VPTR argv[], char* argk) { - CLIENT_FLAGS* client_flags = udaClientFlags(); - return (IDL_GettmpLong(getIdamLastHandle(client_flags))); + return (IDL_GettmpLong(getIdamLastHandle())); } //==================================================================================== From 72938a4a5508eab6e3d9094c0fbd0c557c0b2381 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 12:38:23 +0100 Subject: [PATCH 39/54] removing client flags from api calls in java wrapper --- source/wrappers/java/idam_jni.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/wrappers/java/idam_jni.c b/source/wrappers/java/idam_jni.c index 0efaa344..8f1036b8 100755 --- a/source/wrappers/java/idam_jni.c +++ b/source/wrappers/java/idam_jni.c @@ -95,12 +95,12 @@ JNIEXPORT void JNICALL Java_jIdam_Idam_resetIdamPrivateFlag(JNIEnv* env, jobject JNIEXPORT void JNICALL Java_jIdam_Idam_setIdamClientFlag(JNIEnv* env, jobject obj, jint flag) { - setIdamClientFlag(udaClientFlags(), (unsigned int)flag); + setIdamClientFlag((unsigned int)flag); } JNIEXPORT void JNICALL Java_jIdam_Idam_resetIdamClientFlag(JNIEnv* env, jobject obj, jint flag) { - resetIdamClientFlag(udaClientFlags(), (unsigned int)flag); + resetIdamClientFlag((unsigned int)flag); } //-------------------------------------------------------------- @@ -110,7 +110,7 @@ JNIEXPORT void JNICALL Java_jIdam_Idam_setIdamProperty(JNIEnv* env, jobject obj, { const char* property = (*env)->GetStringUTFChars(env, _property, NULL); if (property == NULL) return; - setIdamProperty(property, udaClientFlags()); + setIdamProperty(property); (*env)->ReleaseStringUTFChars(env, _property, property); } @@ -118,7 +118,7 @@ JNIEXPORT jint JNICALL Java_jIdam_Idam_getIdamProperty(JNIEnv* env, jobject obj, { const char* property = (*env)->GetStringUTFChars(env, _property, NULL); if (property == NULL) return 0; - jint value = (jint)getIdamProperty(property, udaClientFlags()); + jint value = (jint)getIdamProperty(property); (*env)->ReleaseStringUTFChars(env, _property, property); return (value); } @@ -127,13 +127,13 @@ JNIEXPORT void JNICALL Java_jIdam_Idam_resetIdamProperty(JNIEnv* env, jobject ob { const char* property = (*env)->GetStringUTFChars(env, _property, NULL); if (property == NULL) return; - resetIdamProperty(property, udaClientFlags()); + resetIdamProperty(property); (*env)->ReleaseStringUTFChars(env, _property, property); } JNIEXPORT void JNICALL Java_jIdam_Idam_resetIdamProperties(JNIEnv* env, jobject obj) { - resetIdamProperties(udaClientFlags()); + resetIdamProperties(); } //-------------------------------------------------------------- @@ -257,7 +257,7 @@ JNIEXPORT jint JNICALL Java_jIdam_Idam_getIdamDataStatus(JNIEnv* env, jobject ob JNIEXPORT jint JNICALL Java_jIdam_Idam_getIdamLastHandle(JNIEnv* env, jobject obj) { - return (jint)getIdamLastHandle(udaClientFlags()); + return (jint)getIdamLastHandle(); } From fc7970bbae84101d43377ed0044f16cd650fb66f Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 13:05:16 +0100 Subject: [PATCH 40/54] removing client flags from api functions in uda plugin --- source/plugins/uda/uda_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/plugins/uda/uda_plugin.cpp b/source/plugins/uda/uda_plugin.cpp index 3f06b736..6d47e667 100755 --- a/source/plugins/uda/uda_plugin.cpp +++ b/source/plugins/uda/uda_plugin.cpp @@ -57,7 +57,7 @@ extern int UDAPlugin(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Resetting all UDA client properties - resetIdamProperties(udaClientFlags()); + resetIdamProperties(); udaFreeAll(); putIdamServerHost(oldServerHost); // Original Host @@ -82,7 +82,7 @@ extern int UDAPlugin(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Resetting all UDA client properties - resetIdamProperties(udaClientFlags()); + resetIdamProperties(); // Hand over Server IO File Handles to UDA Client library From 3ad2165b03f74c8dcc6a2f5a25602c9414401e06 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 13:42:34 +0100 Subject: [PATCH 41/54] removing client flags from api functions in uda plugin --- source/plugins/uda/uda_plugin.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/source/plugins/uda/uda_plugin.cpp b/source/plugins/uda/uda_plugin.cpp index 6d47e667..18f43cee 100755 --- a/source/plugins/uda/uda_plugin.cpp +++ b/source/plugins/uda/uda_plugin.cpp @@ -309,20 +309,19 @@ Notes: there are three pathways depending on the request pattern // Set Properties CLIENT_BLOCK* client_block = idam_plugin_interface->client_block; - auto client_flags = udaClientFlags(); - if (client_block->get_nodimdata) setIdamProperty("get_nodimdata", client_flags); - if (client_block->get_timedble) setIdamProperty("get_timedble", client_flags); - if (client_block->get_dimdble) setIdamProperty("get_dimdble", client_flags); - if (client_block->get_datadble) setIdamProperty("get_datadble", client_flags); + if (client_block->get_nodimdata) setIdamProperty("get_nodimdata"); + if (client_block->get_timedble) setIdamProperty("get_timedble"); + if (client_block->get_dimdble) setIdamProperty("get_dimdble"); + if (client_block->get_datadble) setIdamProperty("get_datadble"); - if (client_block->get_bad) setIdamProperty("get_bad", client_flags); - if (client_block->get_meta) setIdamProperty("get_meta", client_flags); - if (client_block->get_asis) setIdamProperty("get_asis", client_flags); - if (client_block->get_uncal) setIdamProperty("get_uncal", client_flags); - if (client_block->get_notoff) setIdamProperty("get_notoff", client_flags); - if (client_block->get_scalar) setIdamProperty("get_scalar", client_flags); - if (client_block->get_bytes) setIdamProperty("get_bytes", client_flags); + if (client_block->get_bad) setIdamProperty("get_bad"); + if (client_block->get_meta) setIdamProperty("get_meta"); + if (client_block->get_asis) setIdamProperty("get_asis"); + if (client_block->get_uncal) setIdamProperty("get_uncal"); + if (client_block->get_notoff) setIdamProperty("get_notoff"); + if (client_block->get_scalar) setIdamProperty("get_scalar"); + if (client_block->get_bytes) setIdamProperty("get_bytes"); // Timeout ... @@ -330,8 +329,8 @@ Notes: there are three pathways depending on the request pattern // Client Flags ... - resetIdamClientFlag(client_flags, (unsigned int)CLIENTFLAG_FULLRESET); - setIdamClientFlag(client_flags, client_block->clientFlags); + resetIdamClientFlag((unsigned int)CLIENTFLAG_FULLRESET); + setIdamClientFlag(client_block->clientFlags); // Client application provenance @@ -575,7 +574,7 @@ Notes: there are three pathways depending on the request pattern } resetIdamPrivateFlag(PRIVATEFLAG_FULLRESET); - resetIdamClientFlag(client_flags, (unsigned int)CLIENTFLAG_FULLRESET); + resetIdamClientFlag((unsigned int)CLIENTFLAG_FULLRESET); //---------------------------------------------------------------------- // Test for Errors: Close Socket and Free heap From 9d0b10d0746a8e2b39abff5a90fcb45850922d30 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 13:50:52 +0100 Subject: [PATCH 42/54] removing erroneous inline keyword in legacy_client.h declarations --- source/client/legacy_client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/client/legacy_client.h b/source/client/legacy_client.h index be621308..761dd1b7 100644 --- a/source/client/legacy_client.h +++ b/source/client/legacy_client.h @@ -8,8 +8,8 @@ extern "C" { #endif -LIBRARY_API inline void idamFree(int handle); -LIBRARY_API inline void idamFreeAll(); +LIBRARY_API void idamFree(int handle); +LIBRARY_API void idamFreeAll(); #ifdef __cplusplus } From 7925cd7cc65f6d94529fa7bf2ab308a7c5c5ee22 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 15:44:01 +0100 Subject: [PATCH 43/54] renaming internal uses of api functions previously using the client_falgs argument --- source/client/accAPI.cpp | 2 +- source/client/udaClient.cpp | 10 +- source/client/udaGetAPI.cpp | 8 +- source/plugins/uda/uda_plugin.cpp | 32 +- source/wrappers/c++/client.cpp | 42 +-- source/wrappers/fortran/accAPI_F.c | 10 +- source/wrappers/idl/idam_dlm.c | 278 +++++++++--------- source/wrappers/java/idam_jni.c | 14 +- source/wrappers/java/idam_jni.h | 14 +- source/wrappers/java/jIdam/Idam.java | 14 +- .../wrappers/python/pyuda/cpyuda/client.pyx | 8 +- source/wrappers/python/pyuda/cpyuda/uda.pxd | 6 +- 12 files changed, 219 insertions(+), 219 deletions(-) diff --git a/source/client/accAPI.cpp b/source/client/accAPI.cpp index 4b49772b..fdbb97d1 100755 --- a/source/client/accAPI.cpp +++ b/source/client/accAPI.cpp @@ -865,7 +865,7 @@ int getIdamDataStatus(int handle) */ int udaGetLastHandle() { - return acc_getCurrentDataBlockIndex(); + return udaGetCurrentDataBlockIndex(); } //! returns the number of data items in the data object diff --git a/source/client/udaClient.cpp b/source/client/udaClient.cpp index f6fbd3f1..93699792 100755 --- a/source/client/udaClient.cpp +++ b/source/client/udaClient.cpp @@ -125,7 +125,7 @@ int check_file_cache(const REQUEST_DATA* request_data, DATA_BLOCK** p_data_block if (data != nullptr) { // Success - int data_block_idx = acc_getIdamNewDataHandle(); + int data_block_idx = udaGetNewDataHandle(); if (data_block_idx < 0) { // Error return -data_block_idx; @@ -163,7 +163,7 @@ int check_mem_cache(uda::cache::UdaCache* cache, REQUEST_DATA* request_data, DAT if (data != nullptr) { // Success - int data_block_idx = acc_getIdamNewDataHandle(); + int data_block_idx = udaGetNewDataHandle(); if (data_block_idx < 0) { // Error return -data_block_idx; @@ -930,7 +930,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) //------------------------------------------------------------------------------ // Allocate memory for the Data Block Structure // Re-use existing stale Data Blocks - int data_block_idx = acc_getIdamNewDataHandle(); + int data_block_idx = udaGetNewDataHandle(); if (data_block_idx < 0) { // Error data_block_indices[i] = -data_block_idx; @@ -1008,7 +1008,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices) for (int i = 0; i < data_block_list0.count; ++i) { DATA_BLOCK* data_block0 = &data_block_list0.data[i]; - int data_block_idx = acc_getIdamNewDataHandle(); + int data_block_idx = udaGetNewDataHandle(); DATA_BLOCK* data_block = getIdamDataBlock(data_block_idx); // data blocks may have been realloc'ed copyDataBlock(data_block, data_block0); @@ -1426,7 +1426,7 @@ void udaFreeAll() uda::cache::free_cache(); #endif - for (int i = 0; i < acc_getCurrentDataBlockIndex(); ++i) { + for (int i = 0; i < udaGetCurrentDataBlockIndex(); ++i) { #ifndef FATCLIENT freeDataBlock(getIdamDataBlock(i)); #else diff --git a/source/client/udaGetAPI.cpp b/source/client/udaGetAPI.cpp index 0c4c02ce..f55ad14e 100755 --- a/source/client/udaGetAPI.cpp +++ b/source/client/udaGetAPI.cpp @@ -148,7 +148,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c CLIENT_FLAGS* client_flags = udaClientFlags(); // Lock the thread - lockIdamThread(); + udaLockThread(); if (host != nullptr) { putIdamServerHost(host); @@ -227,7 +227,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c // Fetch Data #ifdef TESTSERVERCLIENT - unlockIdamThread(); + udaUnlockThread(); return -1; #endif @@ -260,7 +260,7 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun CLIENT_FLAGS* client_flags = udaClientFlags(); // Lock the thread - lockIdamThread(); + udaLockThread(); if (host != nullptr) { putIdamServerHost(host); @@ -339,7 +339,7 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun // Fetch Data #ifdef TESTSERVERCLIENT - unlockIdamThread(); + udaUnlockThread(); return -1; #endif diff --git a/source/plugins/uda/uda_plugin.cpp b/source/plugins/uda/uda_plugin.cpp index 18f43cee..f71028c6 100755 --- a/source/plugins/uda/uda_plugin.cpp +++ b/source/plugins/uda/uda_plugin.cpp @@ -57,7 +57,7 @@ extern int UDAPlugin(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Resetting all UDA client properties - resetIdamProperties(); + udaResetProperties(); udaFreeAll(); putIdamServerHost(oldServerHost); // Original Host @@ -82,7 +82,7 @@ extern int UDAPlugin(IDAM_PLUGIN_INTERFACE* idam_plugin_interface) // Resetting all UDA client properties - resetIdamProperties(); + udaResetProperties(); // Hand over Server IO File Handles to UDA Client library @@ -310,18 +310,18 @@ Notes: there are three pathways depending on the request pattern CLIENT_BLOCK* client_block = idam_plugin_interface->client_block; - if (client_block->get_nodimdata) setIdamProperty("get_nodimdata"); - if (client_block->get_timedble) setIdamProperty("get_timedble"); - if (client_block->get_dimdble) setIdamProperty("get_dimdble"); - if (client_block->get_datadble) setIdamProperty("get_datadble"); + if (client_block->get_nodimdata) udaSetProperty("get_nodimdata"); + if (client_block->get_timedble) udaSetProperty("get_timedble"); + if (client_block->get_dimdble) udaSetProperty("get_dimdble"); + if (client_block->get_datadble) udaSetProperty("get_datadble"); - if (client_block->get_bad) setIdamProperty("get_bad"); - if (client_block->get_meta) setIdamProperty("get_meta"); - if (client_block->get_asis) setIdamProperty("get_asis"); - if (client_block->get_uncal) setIdamProperty("get_uncal"); - if (client_block->get_notoff) setIdamProperty("get_notoff"); - if (client_block->get_scalar) setIdamProperty("get_scalar"); - if (client_block->get_bytes) setIdamProperty("get_bytes"); + if (client_block->get_bad) udaSetProperty("get_bad"); + if (client_block->get_meta) udaSetProperty("get_meta"); + if (client_block->get_asis) udaSetProperty("get_asis"); + if (client_block->get_uncal) udaSetProperty("get_uncal"); + if (client_block->get_notoff) udaSetProperty("get_notoff"); + if (client_block->get_scalar) udaSetProperty("get_scalar"); + if (client_block->get_bytes) udaSetProperty("get_bytes"); // Timeout ... @@ -329,8 +329,8 @@ Notes: there are three pathways depending on the request pattern // Client Flags ... - resetIdamClientFlag((unsigned int)CLIENTFLAG_FULLRESET); - setIdamClientFlag(client_block->clientFlags); + udaResetClientFlag((unsigned int)CLIENTFLAG_FULLRESET); + udaSetClientFlag(client_block->clientFlags); // Client application provenance @@ -574,7 +574,7 @@ Notes: there are three pathways depending on the request pattern } resetIdamPrivateFlag(PRIVATEFLAG_FULLRESET); - resetIdamClientFlag((unsigned int)CLIENTFLAG_FULLRESET); + udaResetClientFlag((unsigned int)CLIENTFLAG_FULLRESET); //---------------------------------------------------------------------- // Test for Errors: Close Socket and Free heap diff --git a/source/wrappers/c++/client.cpp b/source/wrappers/c++/client.cpp index f55b5c08..2f00165f 100755 --- a/source/wrappers/c++/client.cpp +++ b/source/wrappers/c++/client.cpp @@ -46,8 +46,8 @@ void uda::Client::setProperty(Property prop, bool value) // CLIENT_FLAGS* client_flags = udaClientFlags(); value - ? setIdamProperty(name.c_str()) - : resetIdamProperty(name.c_str()); + ? udaSetProperty(name.c_str()) + : udaResetProperty(name.c_str()); } void uda::Client::setProperty(Property prop, int value) @@ -74,11 +74,11 @@ void uda::Client::setProperty(Property prop, int value) case PROP_TIMEOUT: name = (boost::format("timeout=%1%") % value).str(); - setIdamProperty(name.c_str()); + udaSetProperty(name.c_str()); break; case PROP_ALTRANK: name = (boost::format("altrank=%1%") % value).str(); - setIdamProperty(name.c_str()); + udaSetProperty(name.c_str()); break; default: @@ -95,23 +95,23 @@ int uda::Client::property(Property prop) { // auto client_flags = udaClientFlags(); switch (prop) { - case PROP_DATADBLE: return getIdamProperty("get_datadble"); - case PROP_DIMDBLE: return getIdamProperty("get_dimdble"); - case PROP_TIMEDBLE: return getIdamProperty("get_timedble"); - case PROP_BYTES: return getIdamProperty("get_bytes"); - case PROP_BAD: return getIdamProperty("get_bad"); - case PROP_META: return getIdamProperty("get_meta"); - case PROP_ASIS: return getIdamProperty("get_asis"); - case PROP_UNCAL: return getIdamProperty("get_uncal"); - case PROP_NOTOFF: return getIdamProperty("get_notoff"); - case PROP_SYNTHETIC: return getIdamProperty("get_synthetic"); - case PROP_SCALAR: return getIdamProperty("get_scalar"); - case PROP_NODIMDATA: return getIdamProperty("get_nodimdata"); - case PROP_VERBOSE: return getIdamProperty("verbose"); - case PROP_DEBUG: return getIdamProperty("debug"); - case PROP_ALTDATA: return getIdamProperty("altdata"); - case PROP_TIMEOUT: return getIdamProperty("timeout"); - case PROP_ALTRANK: return getIdamProperty("altrank"); + case PROP_DATADBLE: return udaGetProperty("get_datadble"); + case PROP_DIMDBLE: return udaGetProperty("get_dimdble"); + case PROP_TIMEDBLE: return udaGetProperty("get_timedble"); + case PROP_BYTES: return udaGetProperty("get_bytes"); + case PROP_BAD: return udaGetProperty("get_bad"); + case PROP_META: return udaGetProperty("get_meta"); + case PROP_ASIS: return udaGetProperty("get_asis"); + case PROP_UNCAL: return udaGetProperty("get_uncal"); + case PROP_NOTOFF: return udaGetProperty("get_notoff"); + case PROP_SYNTHETIC: return udaGetProperty("get_synthetic"); + case PROP_SCALAR: return udaGetProperty("get_scalar"); + case PROP_NODIMDATA: return udaGetProperty("get_nodimdata"); + case PROP_VERBOSE: return udaGetProperty("verbose"); + case PROP_DEBUG: return udaGetProperty("debug"); + case PROP_ALTDATA: return udaGetProperty("altdata"); + case PROP_TIMEOUT: return udaGetProperty("timeout"); + case PROP_ALTRANK: return udaGetProperty("altrank"); default: throw UDAException("Unknown property"); diff --git a/source/wrappers/fortran/accAPI_F.c b/source/wrappers/fortran/accAPI_F.c index e3d81470..4c8b1634 100755 --- a/source/wrappers/fortran/accAPI_F.c +++ b/source/wrappers/fortran/accAPI_F.c @@ -409,7 +409,7 @@ extern void setidamproperty_(char* property, int lproperty) strncpy(s, property, lproperty); s[lproperty] = '\0'; s = TrimString(s); - setIdamProperty(s); + udaSetProperty(s); free( s); } @@ -419,7 +419,7 @@ extern void getidamproperty_(const char* property, int* value, int lproperty) strncpy(s, property, lproperty); s[lproperty] = '\0'; s = TrimString(s); - *value = getIdamProperty(s); + *value = udaGetProperty(s); } extern void resetidamproperty_(char* property, int lproperty) @@ -428,13 +428,13 @@ extern void resetidamproperty_(char* property, int lproperty) strncpy(s, property, lproperty); s[lproperty] = '\0'; s = TrimString(s); - resetIdamProperty(s); + udaResetProperty(s); free( s); } extern void resetidamproperties_() { - resetIdamProperties(); + udaResetProperties(); return; } @@ -612,7 +612,7 @@ extern void getidamdatastatus_(int* handle, int* status) extern void getidamlasthandle_(int* handle) { - *handle = getIdamLastHandle(); + *handle = udaGetLastHandle(); } extern void getidamdatanum_(int* hd, int* datanum) diff --git a/source/wrappers/idl/idam_dlm.c b/source/wrappers/idl/idam_dlm.c index a5e9247c..935a2660 100755 --- a/source/wrappers/idl/idam_dlm.c +++ b/source/wrappers/idl/idam_dlm.c @@ -1186,17 +1186,17 @@ IDL_VPTR IDL_CDECL idamputapi(int argc, IDL_VPTR argv[], char* argk) sout->status = (IDL_LONG)status; sout->error_code = (IDL_LONG)error_code; - sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; - sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; - sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; - sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; - sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; - sout->get_asis = (IDL_LONG)getIdamProperty("get_asis"); // (IDL_LONG) kw.get_asis; - sout->get_bad = (IDL_LONG)getIdamProperty("get_bad"); // (IDL_LONG) kw.get_bad; - sout->get_meta = (IDL_LONG)getIdamProperty("get_meta"); // (IDL_LONG) kw.get_meta; - sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; - sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; - sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; + sout->get_datadble = (IDL_LONG)udaGetProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; + sout->get_dimdble = (IDL_LONG)udaGetProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; + sout->get_timedble = (IDL_LONG)udaGetProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; + sout->get_scalar = (IDL_LONG)udaGetProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; + sout->get_bytes = (IDL_LONG)udaGetProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; + sout->get_asis = (IDL_LONG)udaGetProperty("get_asis"); // (IDL_LONG) kw.get_asis; + sout->get_bad = (IDL_LONG)udaGetProperty("get_bad"); // (IDL_LONG) kw.get_bad; + sout->get_meta = (IDL_LONG)udaGetProperty("get_meta"); // (IDL_LONG) kw.get_meta; + sout->get_uncal = (IDL_LONG)udaGetProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; + sout->get_notoff = (IDL_LONG)udaGetProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; + sout->get_nodimdata = (IDL_LONG)udaGetProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; IDL_StrStore(&(sout->signal), ""); IDL_StrStore(&(sout->source), ""); @@ -1276,7 +1276,7 @@ IDL_VPTR IDL_CDECL idamputapi(int argc, IDL_VPTR argv[], char* argk) //-------------------------------------------------------------------------- // Cleanup Keywords IDL_KW_FREE; - // restoreIdamProperties(cblock); + // udaRestoreProperties(cblock); return (ivReturn); } @@ -1295,7 +1295,7 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) char source[STRING_LENGTH]; int exp_number = 0; - CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties + CLIENT_BLOCK cblock = udaSaveProperties(); // preserve the current set of client properties int handle, status, error_code; char* error_msg; @@ -1542,55 +1542,55 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) // Process Keywords (take Priority over Passed Arguments) if (kw.debug) { - setIdamProperty("debug"); // Cannot be reset (currently!) + udaSetProperty("debug"); // Cannot be reset (currently!) } if (kw.verbose) { - setIdamProperty("verbose"); + udaSetProperty("verbose"); } if (kw.get_datadble) { - setIdamProperty("get_datadble"); // Properties passed by Keyword must be reset to the prior state + udaSetProperty("get_datadble"); // Properties passed by Keyword must be reset to the prior state } if (kw.get_dimdble) { - setIdamProperty("get_dimdble"); + udaSetProperty("get_dimdble"); } if (kw.get_timedble) { - setIdamProperty("get_timedble"); + udaSetProperty("get_timedble"); } if (kw.get_scalar) { - setIdamProperty("get_scalar"); + udaSetProperty("get_scalar"); } if (kw.get_bytes) { - setIdamProperty("get_bytes"); + udaSetProperty("get_bytes"); } if (kw.get_asis) { - setIdamProperty("get_asis"); + udaSetProperty("get_asis"); } if (kw.get_bad) { - setIdamProperty("get_bad"); + udaSetProperty("get_bad"); } if (kw.get_meta) { - setIdamProperty("get_meta"); + udaSetProperty("get_meta"); } if (kw.get_uncal) { - setIdamProperty("get_uncal"); + udaSetProperty("get_uncal"); } if (kw.get_notoff) { - setIdamProperty("get_notoff"); + udaSetProperty("get_notoff"); } if (kw.get_nodimdata) { - setIdamProperty("get_nodimdata"); + udaSetProperty("get_nodimdata"); } //-------------------------------------------------------------------------- @@ -1621,7 +1621,7 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_BAD_HANDLE)); } @@ -1635,7 +1635,7 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_HEAP_ALLOC_ERROR)); } @@ -1649,17 +1649,17 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) sout->status = (IDL_LONG)status; sout->error_code = (IDL_LONG)error_code; - sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; - sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; - sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; - sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; - sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; - sout->get_asis = (IDL_LONG)getIdamProperty("get_asis"); // (IDL_LONG) kw.get_asis; - sout->get_bad = (IDL_LONG)getIdamProperty("get_bad"); // (IDL_LONG) kw.get_bad; - sout->get_meta = (IDL_LONG)getIdamProperty("get_meta"); // (IDL_LONG) kw.get_meta; - sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; - sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; - sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; + sout->get_datadble = (IDL_LONG)udaGetProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; + sout->get_dimdble = (IDL_LONG)udaGetProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; + sout->get_timedble = (IDL_LONG)udaGetProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; + sout->get_scalar = (IDL_LONG)udaGetProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; + sout->get_bytes = (IDL_LONG)udaGetProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; + sout->get_asis = (IDL_LONG)udaGetProperty("get_asis"); // (IDL_LONG) kw.get_asis; + sout->get_bad = (IDL_LONG)udaGetProperty("get_bad"); // (IDL_LONG) kw.get_bad; + sout->get_meta = (IDL_LONG)udaGetProperty("get_meta"); // (IDL_LONG) kw.get_meta; + sout->get_uncal = (IDL_LONG)udaGetProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; + sout->get_notoff = (IDL_LONG)udaGetProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; + sout->get_nodimdata = (IDL_LONG)udaGetProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; IDL_StrStore(&(sout->signal), signal); IDL_StrStore(&(sout->source), source); @@ -1702,7 +1702,7 @@ IDL_VPTR IDL_CDECL callidam2(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (ivReturn); } @@ -1724,7 +1724,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) int useIdamGetAPI = 0; static IDL_LONG exp_number, pass = -1, mdstreenum; - CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties + CLIENT_BLOCK cblock = udaSaveProperties(); // preserve the current set of client properties int handle, rank, order, status, error_code; char* error_msg; @@ -1949,7 +1949,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_ARGUMENTS)); } @@ -1965,7 +1965,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NOT_IMPLEMENTED)); } @@ -1998,48 +1998,48 @@ callidam(int argc, IDL_VPTR argv[], char* argk) mdsnode = IDL_STRING_STR(&(asin->mdsnode)); if ((int)asin->get_datadble) { - setIdamProperty( + udaSetProperty( "get_datadble"); // Properties passed by Structure must be reset to the prior state } if ((int)asin->get_dimdble) { - setIdamProperty("get_dimdble"); + udaSetProperty("get_dimdble"); } if ((int)asin->get_timedble) { - setIdamProperty("get_timedble"); + udaSetProperty("get_timedble"); } if ((int)asin->get_scalar) { - setIdamProperty("get_scalar"); + udaSetProperty("get_scalar"); } if ((int)asin->get_bytes) { - setIdamProperty("get_bytes"); + udaSetProperty("get_bytes"); } if ((int)asin->get_asis) { - setIdamProperty("get_asis"); + udaSetProperty("get_asis"); } if ((int)asin->get_bad) { - setIdamProperty("get_bad"); + udaSetProperty("get_bad"); } if ((int)asin->get_meta) { - setIdamProperty("get_meta"); + udaSetProperty("get_meta"); } if ((int)asin->get_uncal) { - setIdamProperty("get_uncal"); + udaSetProperty("get_uncal"); } if ((int)asin->get_notoff) { - setIdamProperty("get_notoff"); + udaSetProperty("get_notoff"); } if ((int)asin->get_nodimdata) { - setIdamProperty("get_nodimdata"); + udaSetProperty("get_nodimdata"); } if (strlen(signal) > 0 && strlen(source) > 0) { @@ -2059,7 +2059,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_EXP_NUMBER)); } @@ -2078,7 +2078,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NOT_IMPLEMENTED)); } @@ -2107,7 +2107,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_EXP_NUMBER)); } } @@ -2130,7 +2130,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_SIGNAL_ARGUMENT)); } @@ -2149,7 +2149,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NOT_IMPLEMENTED)); } @@ -2169,7 +2169,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_SIGNAL_ARGUMENT)); } @@ -2362,55 +2362,55 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } if (kw.debug) { - setIdamProperty("debug"); // Cannot be reset (currently!) + udaSetProperty("debug"); // Cannot be reset (currently!) } if (kw.verbose) { - setIdamProperty("verbose"); + udaSetProperty("verbose"); } if (kw.get_datadble) { - setIdamProperty("get_datadble"); // Properties passed by Keyword must be reset to the prior state + udaSetProperty("get_datadble"); // Properties passed by Keyword must be reset to the prior state } if (kw.get_dimdble) { - setIdamProperty("get_dimdble"); + udaSetProperty("get_dimdble"); } if (kw.get_timedble) { - setIdamProperty("get_timedble"); + udaSetProperty("get_timedble"); } if (kw.get_scalar) { - setIdamProperty("get_scalar"); + udaSetProperty("get_scalar"); } if (kw.get_bytes) { - setIdamProperty("get_bytes"); + udaSetProperty("get_bytes"); } if (kw.get_asis) { - setIdamProperty("get_asis"); + udaSetProperty("get_asis"); } if (kw.get_bad) { - setIdamProperty("get_bad"); + udaSetProperty("get_bad"); } if (kw.get_meta) { - setIdamProperty("get_meta"); + udaSetProperty("get_meta"); } if (kw.get_uncal) { - setIdamProperty("get_uncal"); + udaSetProperty("get_uncal"); } if (kw.get_notoff) { - setIdamProperty("get_notoff"); + udaSetProperty("get_notoff"); } if (kw.get_nodimdata) { - setIdamProperty("get_nodimdata"); + udaSetProperty("get_nodimdata"); } //-------------------------------------------------------------------------- @@ -2419,7 +2419,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) if (kw.help) { userhelp(stdout, "getidam"); IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(0)); } @@ -2512,7 +2512,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_API_IDENTIFIED)); } } @@ -2537,7 +2537,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_BAD_HANDLE)); } @@ -2554,7 +2554,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_HEAP_ALLOC_ERROR)); } @@ -2570,17 +2570,17 @@ callidam(int argc, IDL_VPTR argv[], char* argk) sout->status = (IDL_LONG)status; sout->error_code = (IDL_LONG)error_code; - sout->get_datadble = (IDL_LONG)getIdamProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; - sout->get_dimdble = (IDL_LONG)getIdamProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; - sout->get_timedble = (IDL_LONG)getIdamProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; - sout->get_scalar = (IDL_LONG)getIdamProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; - sout->get_bytes = (IDL_LONG)getIdamProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; - sout->get_asis = (IDL_LONG)getIdamProperty("get_asis"); // (IDL_LONG) kw.get_asis; - sout->get_bad = (IDL_LONG)getIdamProperty("get_bad"); // (IDL_LONG) kw.get_bad; - sout->get_meta = (IDL_LONG)getIdamProperty("get_meta"); // (IDL_LONG) kw.get_meta; - sout->get_uncal = (IDL_LONG)getIdamProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; - sout->get_notoff = (IDL_LONG)getIdamProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; - sout->get_nodimdata = (IDL_LONG)getIdamProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; + sout->get_datadble = (IDL_LONG)udaGetProperty("get_datadble"); // (IDL_LONG) kw.get_datadble; + sout->get_dimdble = (IDL_LONG)udaGetProperty("get_dimdble"); // (IDL_LONG) kw.get_dimdble; + sout->get_timedble = (IDL_LONG)udaGetProperty("get_timedble"); // (IDL_LONG) kw.get_timedble; + sout->get_scalar = (IDL_LONG)udaGetProperty("get_scalar"); // (IDL_LONG) kw.get_scalar; + sout->get_bytes = (IDL_LONG)udaGetProperty("get_bytes"); // (IDL_LONG) kw.get_bytes; + sout->get_asis = (IDL_LONG)udaGetProperty("get_asis"); // (IDL_LONG) kw.get_asis; + sout->get_bad = (IDL_LONG)udaGetProperty("get_bad"); // (IDL_LONG) kw.get_bad; + sout->get_meta = (IDL_LONG)udaGetProperty("get_meta"); // (IDL_LONG) kw.get_meta; + sout->get_uncal = (IDL_LONG)udaGetProperty("get_uncal"); // (IDL_LONG) kw.get_uncal; + sout->get_notoff = (IDL_LONG)udaGetProperty("get_notoff"); // (IDL_LONG) kw.get_notoff; + sout->get_nodimdata = (IDL_LONG)udaGetProperty("get_nodimdata"); // (IDL_LONG) kw.get_nodimdata; IDL_StrStore(&(sout->signal), signal); IDL_StrStore(&(sout->source), source); @@ -2624,7 +2624,7 @@ callidam(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (ivReturn); } @@ -2637,10 +2637,10 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) int data_n, rank, ndata, errtype; - CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties + CLIENT_BLOCK cblock = udaSaveProperties(); // preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property + int client_get_bad = udaGetProperty("get_bad"); // Current client get_bad property IDAM_SIN* sin = NULL; // Input Structure IDAM_DOUT* sout = NULL; // Returned Structure @@ -2841,7 +2841,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad"); + udaSetProperty("get_bad"); client_get_bad = 1; } @@ -2867,7 +2867,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -2885,7 +2885,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -2903,7 +2903,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -2913,7 +2913,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -2923,7 +2923,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_RANK_TOO_HIGH)); } @@ -3130,7 +3130,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_UNKNOWN_DATA_TYPE)); } @@ -3140,7 +3140,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_HEAP_ALLOC_ERROR)); } @@ -3170,7 +3170,7 @@ getidamdata(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords and IDAM Heap IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (ivReturn); } @@ -3195,10 +3195,10 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) IDAM_SIN* sin; // Returned Structure - CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties + CLIENT_BLOCK cblock = udaSaveProperties(); // preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property + int client_get_bad = udaGetProperty("get_bad"); // Current client get_bad property char* dvec; IDL_VPTR idlArray = NULL; @@ -3254,7 +3254,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) sin = (IDAM_SIN*)argv[0]->value.s.arr->data; // Input Structure if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad"); + udaSetProperty("get_bad"); client_get_bad = 1; } @@ -3284,7 +3284,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -3298,7 +3298,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -3397,7 +3397,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_UNKNOWN_DATA_TYPE)); } @@ -3406,7 +3406,7 @@ getdataarray(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (idlArray); } @@ -3432,10 +3432,10 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) IDAM_SIN* sin; // Returned Structure - CLIENT_BLOCK cblock = saveIdamProperties(); //preserve the current set of client properties + CLIENT_BLOCK cblock = udaSaveProperties(); //preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property + int client_get_bad = udaGetProperty("get_bad"); // Current client get_bad property char* dvec; IDL_VPTR idlArray = NULL; @@ -3491,7 +3491,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) sin = (IDAM_SIN*)argv[0]->value.s.arr->data; // Input Structure if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad"); + udaSetProperty("get_bad"); client_get_bad = 1; } @@ -3501,7 +3501,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_VALID_HANDLE)); } @@ -3522,7 +3522,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -3536,7 +3536,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -3637,7 +3637,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_UNKNOWN_DATA_TYPE)); } @@ -3646,7 +3646,7 @@ geterrorarray(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (idlArray); } @@ -3675,10 +3675,10 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) IDAM_SIN* sin = NULL; // Input Structure IDAM_DIMOUT* sout = NULL; // Returned Structure - CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties + CLIENT_BLOCK cblock = udaSaveProperties(); // preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property + int client_get_bad = udaGetProperty("get_bad"); // Current client get_bad property IDL_VPTR ivReturn = NULL; @@ -3881,7 +3881,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) dimid = IDL_LongScalar(argv[1]); if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad"); + udaSetProperty("get_bad"); client_get_bad = 1; } @@ -3891,7 +3891,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_VALID_HANDLE)); } @@ -3912,7 +3912,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -3926,7 +3926,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -3939,7 +3939,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_SUCH_DIMENSION)); } @@ -4112,7 +4112,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_HEAP_ALLOC_ERROR)); } @@ -4134,7 +4134,7 @@ getidamdimdata(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (ivReturn); } @@ -4158,10 +4158,10 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) IDAM_SIN* sin; // Returned Structure - CLIENT_BLOCK cblock = saveIdamProperties(); // preserve the current set of client properties + CLIENT_BLOCK cblock = udaSaveProperties(); // preserve the current set of client properties CLIENT_BLOCK* idamcblock = NULL; int data_get_bad = 0; - int client_get_bad = getIdamProperty("get_bad"); // Current client get_bad property + int client_get_bad = udaGetProperty("get_bad"); // Current client get_bad property char* dvec; IDL_VPTR idlArray = NULL; @@ -4220,7 +4220,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) dimid = IDL_LongScalar(argv[1]); if ((int)sin->get_bad) { // Reset on exit - setIdamProperty("get_bad"); + udaSetProperty("get_bad"); client_get_bad = 1; } @@ -4230,7 +4230,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_VALID_HANDLE)); } @@ -4251,7 +4251,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_DATA_HAS_ERROR)); } @@ -4265,7 +4265,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_DATA_TO_RETURN)); } @@ -4278,7 +4278,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_NO_SUCH_DIMENSION)); } @@ -4395,7 +4395,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) } IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (IDL_GettmpLong(GDE_UNKNOWN_DATA_TYPE)); } @@ -4404,7 +4404,7 @@ getdimdataarray(int argc, IDL_VPTR argv[], char* argk) // Cleanup Keywords IDL_KW_FREE; - restoreIdamProperties(cblock); + udaRestoreProperties(cblock); return (idlArray); } @@ -6857,7 +6857,7 @@ setproperty(int argc, IDL_VPTR argv[], char* argk) { IDL_ENSURE_STRING(argv[0]); // Single String IDL_ENSURE_SCALAR(argv[0]); - setIdamProperty((char*)IDL_STRING_STR(&argv[0]->value.str)); + udaSetProperty((char*)IDL_STRING_STR(&argv[0]->value.str)); return (IDL_GettmpLong(0)); } @@ -6867,7 +6867,7 @@ resetproperty(int argc, IDL_VPTR argv[], char* argk) { IDL_ENSURE_STRING(argv[0]); // Single String IDL_ENSURE_SCALAR(argv[0]); - resetIdamProperty((char*)IDL_STRING_STR(&argv[0]->value.str)); + udaResetProperty((char*)IDL_STRING_STR(&argv[0]->value.str)); return (IDL_GettmpLong(0)); } @@ -6875,7 +6875,7 @@ IDL_VPTR IDL_CDECL resetproperties(int argc, IDL_VPTR argv[], char* argk) { - resetIdamProperties(); + udaResetProperties(); return (IDL_GettmpLong(0)); } @@ -6884,7 +6884,7 @@ IDL_VPTR IDL_CDECL setidamclientflag(int argc, IDL_VPTR argv[], char* argk) { IDL_ENSURE_SCALAR(argv[0]); - setIdamClientFlag((unsigned int)IDL_ULongScalar(argv[0])); + udaSetClientFlag((unsigned int)IDL_ULongScalar(argv[0])); return (IDL_GettmpLong(0)); } @@ -6893,7 +6893,7 @@ IDL_VPTR IDL_CDECL resetidamclientflag(int argc, IDL_VPTR argv[], char* argk) { IDL_ENSURE_SCALAR(argv[0]); - resetIdamClientFlag((unsigned int)IDL_ULongScalar(argv[0])); + udaResetClientFlag((unsigned int)IDL_ULongScalar(argv[0])); return (IDL_GettmpLong(0)); } @@ -7379,7 +7379,7 @@ IDL_VPTR IDL_CDECL getlasthandle(int argc, IDL_VPTR argv[], char* argk) { - return (IDL_GettmpLong(getIdamLastHandle())); + return (IDL_GettmpLong(udaGetLastHandle())); } //==================================================================================== diff --git a/source/wrappers/java/idam_jni.c b/source/wrappers/java/idam_jni.c index 8f1036b8..14e81dc7 100755 --- a/source/wrappers/java/idam_jni.c +++ b/source/wrappers/java/idam_jni.c @@ -95,12 +95,12 @@ JNIEXPORT void JNICALL Java_jIdam_Idam_resetIdamPrivateFlag(JNIEnv* env, jobject JNIEXPORT void JNICALL Java_jIdam_Idam_setIdamClientFlag(JNIEnv* env, jobject obj, jint flag) { - setIdamClientFlag((unsigned int)flag); + udaSetClientFlag((unsigned int)flag); } JNIEXPORT void JNICALL Java_jIdam_Idam_resetIdamClientFlag(JNIEnv* env, jobject obj, jint flag) { - resetIdamClientFlag((unsigned int)flag); + udaResetClientFlag((unsigned int)flag); } //-------------------------------------------------------------- @@ -110,7 +110,7 @@ JNIEXPORT void JNICALL Java_jIdam_Idam_setIdamProperty(JNIEnv* env, jobject obj, { const char* property = (*env)->GetStringUTFChars(env, _property, NULL); if (property == NULL) return; - setIdamProperty(property); + udaSetProperty(property); (*env)->ReleaseStringUTFChars(env, _property, property); } @@ -118,7 +118,7 @@ JNIEXPORT jint JNICALL Java_jIdam_Idam_getIdamProperty(JNIEnv* env, jobject obj, { const char* property = (*env)->GetStringUTFChars(env, _property, NULL); if (property == NULL) return 0; - jint value = (jint)getIdamProperty(property); + jint value = (jint)udaGetProperty(property); (*env)->ReleaseStringUTFChars(env, _property, property); return (value); } @@ -127,13 +127,13 @@ JNIEXPORT void JNICALL Java_jIdam_Idam_resetIdamProperty(JNIEnv* env, jobject ob { const char* property = (*env)->GetStringUTFChars(env, _property, NULL); if (property == NULL) return; - resetIdamProperty(property); + udaResetProperty(property); (*env)->ReleaseStringUTFChars(env, _property, property); } JNIEXPORT void JNICALL Java_jIdam_Idam_resetIdamProperties(JNIEnv* env, jobject obj) { - resetIdamProperties(); + udaResetProperties(); } //-------------------------------------------------------------- @@ -257,7 +257,7 @@ JNIEXPORT jint JNICALL Java_jIdam_Idam_getIdamDataStatus(JNIEnv* env, jobject ob JNIEXPORT jint JNICALL Java_jIdam_Idam_getIdamLastHandle(JNIEnv* env, jobject obj) { - return (jint)getIdamLastHandle(); + return (jint)udaGetLastHandle(); } diff --git a/source/wrappers/java/idam_jni.h b/source/wrappers/java/idam_jni.h index 18f9163b..40014d7b 100755 --- a/source/wrappers/java/idam_jni.h +++ b/source/wrappers/java/idam_jni.h @@ -44,7 +44,7 @@ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_setIdamPrivateFlag /* * Class: Idam - * Method: setIdamClientFlag + * Method: udaSetClientFlag * Signature: (I)V */ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_setIdamClientFlag @@ -52,7 +52,7 @@ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_setIdamClientFlag /* * Class: Idam - * Method: setIdamProperty + * Method: udaSetProperty * Signature: (Ljava/lang/String;)V */ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_setIdamProperty @@ -60,7 +60,7 @@ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_setIdamProperty /* * Class: Idam - * Method: getIdamProperty + * Method: udaGetProperty * Signature: (Ljava/lang/String;)I */ LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamProperty @@ -76,7 +76,7 @@ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamPrivateFlag /* * Class: Idam - * Method: resetIdamClientFlag + * Method: udaResetClientFlag * Signature: (I)V */ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamClientFlag @@ -84,7 +84,7 @@ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamClientFlag /* * Class: Idam - * Method: resetIdamProperty + * Method: udaResetProperty * Signature: (Ljava/lang/String;)V */ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamProperty @@ -92,7 +92,7 @@ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamProperty /* * Class: Idam - * Method: resetIdamProperties + * Method: udaResetProperties * Signature: ()V */ LIBRARY_API JNIEXPORT void JNICALL Java_Idam_resetIdamProperties @@ -268,7 +268,7 @@ LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamDataStatus /* * Class: Idam - * Method: getIdamLastHandle + * Method: udaGetLastHandle * Signature: (I)I */ LIBRARY_API JNIEXPORT jint JNICALL Java_Idam_getIdamLastHandle diff --git a/source/wrappers/java/jIdam/Idam.java b/source/wrappers/java/jIdam/Idam.java index dee74a69..c4a91564 100755 --- a/source/wrappers/java/jIdam/Idam.java +++ b/source/wrappers/java/jIdam/Idam.java @@ -31,14 +31,14 @@ public class Idam { // Set Server Properties public static native void setIdamPrivateFlag(int flag); - public static native void setIdamClientFlag(int flag); - public static native void setIdamProperty(String property); - public static native int getIdamProperty(String property); + public static native void udaSetClientFlag(int flag); + public static native void udaSetProperty(String property); + public static native int udaGetProperty(String property); public static native void resetIdamPrivateFlag(int flag); - public static native void resetIdamClientFlag(int flag); - public static native void resetIdamProperty(String property); - public static native void resetIdamProperties(); + public static native void udaResetClientFlag(int flag); + public static native void udaResetProperty(String property); + public static native void udaResetProperties(); // Server Identification @@ -77,7 +77,7 @@ public class Idam { // Last Data Access structure handle - public static native int getIdamLastHandle(int handle); + public static native int udaGetLastHandle(int handle); // Data properties diff --git a/source/wrappers/python/pyuda/cpyuda/client.pyx b/source/wrappers/python/pyuda/cpyuda/client.pyx index d45b8727..122a706c 100644 --- a/source/wrappers/python/pyuda/cpyuda/client.pyx +++ b/source/wrappers/python/pyuda/cpyuda/client.pyx @@ -42,17 +42,17 @@ def set_property(prop_name, value): raise ValueError('invalid property ' + prop_name) if _properties[prop_name][1]: prop_string = prop_name + '=' + str(value) - uda.setIdamProperty(prop_string.encode()) + uda.udaSetProperty(prop_string.encode()) elif value: - uda.setIdamProperty(prop_name.encode()) + uda.udaSetProperty(prop_name.encode()) else: - uda.resetIdamProperty(prop_name.encode()) + uda.udaResetProperty(prop_name.encode()) def get_property(prop_name): if prop_name.lower() not in _properties: raise ValueError('invalid property ' + prop_name) - prop = uda.getIdamProperty(prop_name.encode()) + prop = uda.udaGetProperty(prop_name.encode()) if _properties[prop_name][1]: return prop else: diff --git a/source/wrappers/python/pyuda/cpyuda/uda.pxd b/source/wrappers/python/pyuda/cpyuda/uda.pxd index 988ed258..5a1b447c 100644 --- a/source/wrappers/python/pyuda/cpyuda/uda.pxd +++ b/source/wrappers/python/pyuda/cpyuda/uda.pxd @@ -112,9 +112,9 @@ cdef extern from "client/accAPI.h": int getIdamErrorType(int handle); void putIdamServerHost(const char* host); void putIdamServerPort(int port); - int getIdamProperty(const char* property) - void setIdamProperty(const char* property); - void resetIdamProperty(const char* property); + int udaGetProperty(const char* property) + void udaSetProperty(const char* property); + void udaResetProperty(const char* property); const char* getIdamDataLabel(int handle); const char* getIdamDataUnits(int handle); const char* getIdamDataDesc(int handle); From b0bae6cfdfe3e3a614da54463f690ae3428d017e Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 16:09:21 +0100 Subject: [PATCH 44/54] tidying up legacy headers --- source/client/CMakeLists.txt | 2 - source/client/legacy_accAPI.cpp | 169 --------------------------- source/client/legacy_accAPI.h | 197 ++++++++++++++++++++++++++------ source/client/legacy_client.cpp | 12 -- source/client/legacy_client.h | 15 ++- 5 files changed, 173 insertions(+), 222 deletions(-) delete mode 100644 source/client/legacy_accAPI.cpp delete mode 100644 source/client/legacy_client.cpp diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index cbaccd81..a648bc06 100755 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -48,8 +48,6 @@ set( SRC_FILES udaPutAPI.cpp udaClient.cpp udaClientHostList.cpp - legacy_accAPI.cpp - legacy_client.cpp ) set( HEADER_FILES diff --git a/source/client/legacy_accAPI.cpp b/source/client/legacy_accAPI.cpp deleted file mode 100644 index 04fd1e58..00000000 --- a/source/client/legacy_accAPI.cpp +++ /dev/null @@ -1,169 +0,0 @@ -#include "legacy_accAPI.h" -#include "accAPI.h" - -#ifdef UDA_CLIENT_FLAGS_API - - DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags) - { - return udaGetCurrentDataBlock(); - } - - int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags) - { - return udaGetCurrentDataBlockIndex(); - } - - int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags) - { - return udaGrowDataBlocks(); - } - - int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags) - { - return udaGetNewDataHandle(); - } - - void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) - { - udaSetClientFlag(flag); - } - - void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) - { - udaResetClientFlag(flag); - } - - void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags) - { - udaSetProperty(property); - } - - int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags) - { - return udaGetProperty(property); - } - - void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags) - { - udaResetProperty(property); - } - - void resetIdamProperties(CLIENT_FLAGS* client_flags) - { - udaResetProperties(); - } - - CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags) - { - return udaSaveProperties(); - } - - void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags) - { - udaRestoreProperties(cb); - } - - int getIdamLastHandle(CLIENT_FLAGS* client_flags) - { - return udaGetLastHandle(); - } - - void lockIdamThread(CLIENT_FLAGS* client_flags) - { - udaLockThread(); - } - - void unlockUdaThread(CLIENT_FLAGS* client_flags) - { - udaUnlockThread(); - } - - void freeIdamThread(CLIENT_FLAGS* client_flags) - { - udaFreeThread(); - } - -#else - - DATA_BLOCK* acc_getCurrentDataBlock() - { - return udaGetCurrentDataBlock(); - } - - int acc_getCurrentDataBlockIndex() - { - return udaGetCurrentDataBlockIndex(); - } - - int acc_growIdamDataBlocks() - { - return udaGrowDataBlocks(); - } - - int acc_getIdamNewDataHandle() - { - return udaGetNewDataHandle(); - } - - void setIdamClientFlag(unsigned int flag) - { - udaSetClientFlag(flag); - } - - void resetIdamClientFlag(unsigned int flag) - { - udaResetClientFlag(flag); - } - - void setIdamProperty(const char* property) - { - udaSetProperty(property); - } - - int getIdamProperty(const char* property) - { - return udaGetProperty(property); - } - - void resetIdamProperty(const char* property) - { - udaResetProperty(property); - } - - void resetIdamProperties() - { - udaResetProperties(); - } - - CLIENT_BLOCK saveIdamProperties() - { - return udaSaveProperties(); - } - - void restoreIdamProperties(CLIENT_BLOCK cb) - { - udaRestoreProperties(cb); - } - - int getIdamLastHandle() - { - return udaGetLastHandle(); - } - - void lockIdamThread() - { - udaLockThread(); - } - - void unlockUdaThread() - { - udaUnlockThread(); - } - - void freeIdamThread() - { - udaFreeThread(); - } - -#endif // UDA_LEGACY_API - diff --git a/source/client/legacy_accAPI.h b/source/client/legacy_accAPI.h index f7c0fa02..0e285133 100644 --- a/source/client/legacy_accAPI.h +++ b/source/client/legacy_accAPI.h @@ -1,5 +1,5 @@ -#ifndef LEGACY_ACCAPI_H -#define LEGACY_ACCAPI_H +#ifndef UDA_LEGACY_ACCAPI_H +#define UDA_LEGACY_ACCAPI_H #include #include "udaClient.h" @@ -12,40 +12,167 @@ extern "C" { #ifdef UDA_CLIENT_FLAGS_API // #warning "Using legacy API names with redundant \"client_flags\" arguments, these will be deprecated in future" - LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags); - LIBRARY_API int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags); - LIBRARY_API int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags); - LIBRARY_API int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags); - LIBRARY_API void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); - LIBRARY_API void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); - LIBRARY_API void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags); - LIBRARY_API int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags); - LIBRARY_API void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags); - LIBRARY_API void resetIdamProperties(CLIENT_FLAGS* client_flags); - LIBRARY_API CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags); - LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags); - LIBRARY_API int getIdamLastHandle(CLIENT_FLAGS* client_flags); - LIBRARY_API void lockIdamThread(CLIENT_FLAGS* client_flags); - LIBRARY_API void unlockUdaThread(CLIENT_FLAGS* client_flags); - LIBRARY_API void freeIdamThread(CLIENT_FLAGS* client_flags); + LIBRARY_API inline DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags) + { + return udaGetCurrentDataBlock(); + } + + LIBRARY_API inline int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags) + { + return udaGetCurrentDataBlockIndex(); + } + + LIBRARY_API inline int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags) + { + return udaGrowDataBlocks(); + } + + LIBRARY_API inline int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags) + { + return udaGetNewDataHandle(); + } + + LIBRARY_API inline void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) + { + udaSetClientFlag(flag); + } + + LIBRARY_API inline void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) + { + udaResetClientFlag(flag); + } + + LIBRARY_API inline void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags) + { + udaSetProperty(property); + } + + LIBRARY_API inline int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags) + { + return udaGetProperty(property); + } + + LIBRARY_API inline void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags) + { + udaResetProperty(property); + } + + LIBRARY_API inline void resetIdamProperties(CLIENT_FLAGS* client_flags) + { + udaResetProperties(); + } + + CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags) + { + return udaSaveProperties(); + } + + LIBRARY_API inline void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags) + { + udaRestoreProperties(cb); + } + + LIBRARY_API inline int getIdamLastHandle(CLIENT_FLAGS* client_flags) + { + return udaGetLastHandle(); + } + + LIBRARY_API inline void lockIdamThread(CLIENT_FLAGS* client_flags) + { + udaLockThread(); + } + + LIBRARY_API inline void unlockUdaThread(CLIENT_FLAGS* client_flags) + { + udaUnlockThread(); + } + + LIBRARY_API inline void freeIdamThread(CLIENT_FLAGS* client_flags) + { + udaFreeThread(); + } + #else - LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(); - LIBRARY_API int acc_getCurrentDataBlockIndex(); - LIBRARY_API int acc_growIdamDataBlocks(); - LIBRARY_API int acc_getIdamNewDataHandle(); - 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(); - LIBRARY_API CLIENT_BLOCK saveIdamProperties(); - LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb); - LIBRARY_API int getIdamLastHandle(); - LIBRARY_API void lockIdamThread(); - LIBRARY_API void unlockUdaThread(); - LIBRARY_API void freeIdamThread(); + LIBRARY_API inline DATA_BLOCK* acc_getCurrentDataBlock() + { + return udaGetCurrentDataBlock(); + } + + LIBRARY_API inline int acc_getCurrentDataBlockIndex() + { + return udaGetCurrentDataBlockIndex(); + } + + LIBRARY_API inline int acc_growIdamDataBlocks() + { + return udaGrowDataBlocks(); + } + + LIBRARY_API inline int acc_getIdamNewDataHandle() + { + return udaGetNewDataHandle(); + } + + LIBRARY_API inline void setIdamClientFlag(unsigned int flag) + { + udaSetClientFlag(flag); + } + + LIBRARY_API inline void resetIdamClientFlag(unsigned int flag) + { + udaResetClientFlag(flag); + } + + LIBRARY_API inline void setIdamProperty(const char* property) + { + udaSetProperty(property); + } + + LIBRARY_API inline int getIdamProperty(const char* property) + { + return udaGetProperty(property); + } + + LIBRARY_API inline void resetIdamProperty(const char* property) + { + udaResetProperty(property); + } + + LIBRARY_API inline void resetIdamProperties() + { + udaResetProperties(); + } + + LIBRARY_API inline CLIENT_BLOCK saveIdamProperties() + { + return udaSaveProperties(); + } + + LIBRARY_API inline void restoreIdamProperties(CLIENT_BLOCK cb) + { + udaRestoreProperties(cb); + } + + LIBRARY_API inline int getIdamLastHandle() + { + return udaGetLastHandle(); + } + + LIBRARY_API inline void lockIdamThread() + { + udaLockThread(); + } + + LIBRARY_API inline void unlockUdaThread() + { + udaUnlockThread(); + } + + LIBRARY_API inline void freeIdamThread() + { + udaFreeThread(); + } #endif @@ -55,4 +182,4 @@ extern "C" { #endif -#endif // LEGACY_ACCAPI_H +#endif // UDA_LEGACY_ACCAPI_H diff --git a/source/client/legacy_client.cpp b/source/client/legacy_client.cpp deleted file mode 100644 index a3c61cba..00000000 --- a/source/client/legacy_client.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "legacy_client.h" - -void idamFree(int handle) -{ - udaFree(handle); -} - -void idamFreeAll() -{ - udaFreeAll(); -} - diff --git a/source/client/legacy_client.h b/source/client/legacy_client.h index 761dd1b7..9c557c21 100644 --- a/source/client/legacy_client.h +++ b/source/client/legacy_client.h @@ -1,5 +1,5 @@ -#ifndef LEGACY_CLIENT_H -#define LEGACY_CLIENT_H +#ifndef UDA_LEGACY_CLIENT_H +#define UDA_LEGACY_CLIENT_H #include #include "udaClient.h" @@ -8,8 +8,15 @@ extern "C" { #endif -LIBRARY_API void idamFree(int handle); -LIBRARY_API void idamFreeAll(); +LIBRARY_API inline void idamFree(int handle) +{ + udaFree(handle); +} + +LIBRARY_API inline void idamFreeAll() +{ + udaFreeAll() +} #ifdef __cplusplus } From 6053ce14a28624d4ef05481e99cce10b7f71b5bc Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 16:17:09 +0100 Subject: [PATCH 45/54] tidying up legacy headers --- source/client/legacy_client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/client/legacy_client.h b/source/client/legacy_client.h index 9c557c21..b91280e7 100644 --- a/source/client/legacy_client.h +++ b/source/client/legacy_client.h @@ -15,7 +15,7 @@ LIBRARY_API inline void idamFree(int handle) LIBRARY_API inline void idamFreeAll() { - udaFreeAll() + udaFreeAll(); } #ifdef __cplusplus From 33a3056bb44e408da4d3e88cd97e046ab8c861c0 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 16:48:50 +0100 Subject: [PATCH 46/54] tidying up legacy headers --- source/client/accAPI.h | 1 - source/client/udaClient.h | 2 -- source/uda.h | 2 ++ 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/client/accAPI.h b/source/client/accAPI.h index 1be37aa2..e74ae6fe 100755 --- a/source/client/accAPI.h +++ b/source/client/accAPI.h @@ -8,7 +8,6 @@ #include #include #include "udaClient.h" -#include "legacy_accAPI.h" #ifdef __cplusplus extern "C" { diff --git a/source/client/udaClient.h b/source/client/udaClient.h index 4e7fae6b..6ac0d939 100755 --- a/source/client/udaClient.h +++ b/source/client/udaClient.h @@ -7,7 +7,6 @@ #include #include #include -#include "legacy_client.h" #ifdef __cplusplus extern "C" { @@ -119,5 +118,4 @@ LIBRARY_API void setLogMallocList(LOGMALLOCLIST* logmalloclist_in); } #endif - #endif // UDA_CLIENT_UDACLIENT_H diff --git a/source/uda.h b/source/uda.h index 1b46d94a..43f76bd3 100755 --- a/source/uda.h +++ b/source/uda.h @@ -13,6 +13,8 @@ # include # include # include +# include +# include #endif #endif // UDA_H From a30d89f6ab0661c080080f0d50973ea2941e8f5c Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 16:57:34 +0100 Subject: [PATCH 47/54] tidying up legacy headers --- source/client/udaGetAPI.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/client/udaGetAPI.cpp b/source/client/udaGetAPI.cpp index f55ad14e..fc43ed4e 100755 --- a/source/client/udaGetAPI.cpp +++ b/source/client/udaGetAPI.cpp @@ -176,7 +176,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c static bool reopen_logs = true; if (udaStartup(0, client_flags, &reopen_logs) != 0) { - unlockUdaThread(); + udaUnlockThread(); return PROBLEM_OPENING_LOGS; } @@ -217,7 +217,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c UDA_LOG(UDA_LOG_ERROR, "Error identifying the Data Source [%s]\n", data_source); addIdamError(UDA_CODE_ERROR_TYPE, __func__, 999, "Error identifying the Data Source"); } - unlockUdaThread(); + udaUnlockThread(); return -err; } @@ -246,7 +246,7 @@ int idamGetAPIWithHost(const char* data_object, const char* data_source, const c freeClientRequestBlock(&request_block); // Unlock the thread - unlockUdaThread(); + udaUnlockThread(); return handle; } @@ -287,7 +287,7 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun static bool reopen_logs = true; if (udaStartup(0, client_flags, &reopen_logs) != 0) { - unlockUdaThread(); + udaUnlockThread(); return PROBLEM_OPENING_LOGS; } @@ -328,7 +328,7 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun if (udaNumErrors() == 0) { addIdamError(UDA_CODE_ERROR_TYPE, __func__, 999, "Error identifying the Data Source"); } - unlockUdaThread(); + udaUnlockThread(); return -err; } @@ -353,6 +353,6 @@ int idamGetBatchAPIWithHost(const char** signals, const char** sources, int coun #endif // Unlock the thread - unlockUdaThread(); + udaUnlockThread(); return err; } From 1f5202a38f6cb6480869a9625a23d13c54ff6850 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 17:56:11 +0100 Subject: [PATCH 48/54] installing pkgconfig files for client only build --- source/CMakeLists.txt | 6 ++++++ source/server/CMakeLists.txt | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 5a0867c3..1ae6917a 100755 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -133,6 +133,12 @@ foreach( PKGCONFIG_FILE ${PKGCONFIG_FILES} ) ) endforeach() +install( + DIRECTORY + ${CMAKE_BINARY_DIR}/lib/pkgconfig + DESTINATION lib +) + find_program( XINETD_EXE xinetd PATHS /usr/sbin/ /usr/local/sbin/ ) configure_file( diff --git a/source/server/CMakeLists.txt b/source/server/CMakeLists.txt index 3d7b09ca..617597b7 100755 --- a/source/server/CMakeLists.txt +++ b/source/server/CMakeLists.txt @@ -289,12 +289,6 @@ install( DESTINATION etc ) -install( - DIRECTORY - ${CMAKE_BINARY_DIR}/lib/pkgconfig - DESTINATION lib -) - install( DIRECTORY ${CMAKE_SOURCE_DIR}/source/etc/machine.d From 283ee57ce0e82f74eaf007f820a0718cf01bd304 Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 22:47:22 +0100 Subject: [PATCH 49/54] using oldest-supported-numpy for build dependencies in pyuda pyproject.toml --- source/wrappers/python/pyproject.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/wrappers/python/pyproject.toml b/source/wrappers/python/pyproject.toml index d3209e6d..4e80980c 100644 --- a/source/wrappers/python/pyproject.toml +++ b/source/wrappers/python/pyproject.toml @@ -1,5 +1,11 @@ [build-system] -requires = ["setuptools>=42", "numpy>=1.7, <2", "Cython>=0.29", "six"] +requires = [ + "setuptools>=42", + "oldest-supported-numpy; python_version < '3.13'", + "numpy >=1.7, <2; python_versoin >= '3.13'", + "Cython>=0.29", + "six" +] build-backend = "setuptools.build_meta" [project.urls] From 5a51c6276dddc824a0bed428dcaa9670504c807a Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 22:52:52 +0100 Subject: [PATCH 50/54] using oldest-supported-numpy for build dependencies in pyuda pyproject.toml --- source/wrappers/python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wrappers/python/pyproject.toml b/source/wrappers/python/pyproject.toml index 4e80980c..b2ab0a42 100644 --- a/source/wrappers/python/pyproject.toml +++ b/source/wrappers/python/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools>=42", "oldest-supported-numpy; python_version < '3.13'", - "numpy >=1.7, <2; python_versoin >= '3.13'", + "numpy >=1.7, <2; python_version >= '3.13'", "Cython>=0.29", "six" ] From 88f600da7a8b376e629fead78983986db9bfe725 Mon Sep 17 00:00:00 2001 From: sdixon Date: Thu, 8 Aug 2024 10:07:07 +0100 Subject: [PATCH 51/54] removing some dead code --- .github/workflows/build_test_wheels.yml | 7 ------- .github/workflows/build_wheels.yml | 3 --- CMakeLists.txt | 16 ---------------- source/client/accAPI.h | 15 --------------- 4 files changed, 41 deletions(-) diff --git a/.github/workflows/build_test_wheels.yml b/.github/workflows/build_test_wheels.yml index c8347bc9..e34de4e0 100644 --- a/.github/workflows/build_test_wheels.yml +++ b/.github/workflows/build_test_wheels.yml @@ -46,7 +46,6 @@ jobs: CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 CIBW_ARCHS: ${{matrix.build-platform[1]}} CIBW_BUILD: cp*-manylinux* - # CIBW_SKIP: cp36* cp37* *-musllinux* CIBW_SKIP: cp*-musllinux* *-musllinux* CIBW_BEFORE_ALL: > yum update -y && @@ -85,7 +84,6 @@ jobs: if: startswith(matrix.build-platform[2], 'manylinux_2_28') uses: pypa/cibuildwheel@v2.17.0 with: - # package-dir: /usr/local/python_installer package-dir: ./source/wrappers/python config-file: ./source/wrappers/python/pyproject.toml env: @@ -142,9 +140,6 @@ jobs: CIBW_ARCHS: ${{matrix.build-platform[1]}} CIBW_PLATFORM: macos CIBW_BUILD: cp*-${{matrix.build-platform[2]}} - # CIBW_SKIP: cp36* cp37* - # CIBW_BEFORE_ALL: - # cat ./source/wrappers/python/setup.py - uses: actions/upload-artifact@v4 with: @@ -158,8 +153,6 @@ jobs: name: testpypi permissions: id-token: write - # if: github.event_name == 'release' && github.event.action == 'published' - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 8ffc0799..17b8357f 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -82,7 +82,6 @@ jobs: if: startswith(matrix.build-platform[2], 'manylinux_2_28') uses: pypa/cibuildwheel@v2.17.0 with: - # package-dir: /usr/local/python_installer package-dir: ./source/wrappers/python config-file: ./source/wrappers/python/pyproject.toml env: @@ -153,8 +152,6 @@ jobs: url: https://pypi.org/p/uda permissions: id-token: write - # if: github.event_name == 'release' && github.event.action == 'published' - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') steps: - uses: actions/download-artifact@v4 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 99587143..2db7a74e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,22 +45,6 @@ set( Boost_USE_MULTITHREADED OFF ) ######################################################################################################################## # Version and Machine information -# include( GetGitRevisionDescription ) -# -# git_describe( GIT_TAG --tags ) -# -# if( "${GIT_TAG}" MATCHES "^.*NOTFOUND$" ) -# message( WARNING "Failed to get git revision: ${GIT_TAG}" ) -# set( GIT_VERSION "0.0.0" ) -# elseif( "${GIT_TAG}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)$" ) -# set( GIT_VERSION "${GIT_TAG}" ) -# elseif( "${GIT_TAG}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-.*$" ) -# set( GIT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" ) -# else() -# message( WARNING "invalid git tag for version parsing: ${GIT_TAG}" ) -# set( GIT_VERSION "0.0.0" ) -# endif() - # Set VERSION and FULL_VERSION from `git describe` # but use git export attribute for release tarballs set( GIT_ARCHIVE_DESCRIBE [[$Format:%(describe)$]] ) diff --git a/source/client/accAPI.h b/source/client/accAPI.h index e74ae6fe..70cfdf39 100755 --- a/source/client/accAPI.h +++ b/source/client/accAPI.h @@ -16,16 +16,12 @@ extern "C" { #define UDA_NUM_CLIENT_THREADS 30 LIBRARY_API DATA_BLOCK* udaGetCurrentDataBlock(); -// LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags); LIBRARY_API int udaGetCurrentDataBlockIndex(); -// LIBRARY_API int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags); LIBRARY_API int udaGrowDataBlocks(); -// LIBRARY_API int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags); LIBRARY_API int udaGetNewDataHandle(); -// LIBRARY_API int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags); LIBRARY_API void acc_freeDataBlocks(); @@ -34,25 +30,18 @@ LIBRARY_API void setIdamPrivateFlag(unsigned int flag); LIBRARY_API void resetIdamPrivateFlag(unsigned int flag); LIBRARY_API void udaSetClientFlag(unsigned int flag); -// LIBRARY_API void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); LIBRARY_API void udaResetClientFlag(unsigned int flag); -// LIBRARY_API void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); LIBRARY_API void udaSetProperty(const char* property); -// LIBRARY_API void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags); LIBRARY_API int udaGetProperty(const char* property); -// LIBRARY_API int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags); LIBRARY_API void udaResetProperty(const char* property); -// LIBRARY_API void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags); LIBRARY_API void udaResetProperties(); -// LIBRARY_API void resetIdamProperties(CLIENT_FLAGS* client_flags); LIBRARY_API CLIENT_BLOCK udaSaveProperties(); -// LIBRARY_API CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags); LIBRARY_API void udaRestoreProperties(CLIENT_BLOCK cb); // LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags); @@ -96,7 +85,6 @@ LIBRARY_API int getIdamSignalStatus(int handle); LIBRARY_API int getIdamDataStatus(int handle); LIBRARY_API int udaGetLastHandle(); -// LIBRARY_API int getIdamLastHandle(CLIENT_FLAGS* client_flags); LIBRARY_API int getIdamDataNum(int handle); @@ -259,13 +247,10 @@ LIBRARY_API int getIdamDataCheckSum(int handle); LIBRARY_API int getIdamDimDataCheckSum(int handle, int ndim); LIBRARY_API void udaLockThread(); -// LIBRARY_API void lockIdamThread(CLIENT_FLAGS* client_flags); LIBRARY_API void udaUnlockThread(); -// LIBRARY_API void unlockIdamThread(CLIENT_FLAGS* client_flags); LIBRARY_API void udaFreeThread(); -// LIBRARY_API void freeIdamThread(CLIENT_FLAGS* client_flags); LIBRARY_API int getIdamThreadLastHandle(); From 13596f18a321c25cc24a4fc8f5ede86dfef14034 Mon Sep 17 00:00:00 2001 From: Jonathan Hollocombe Date: Tue, 13 Aug 2024 13:39:52 +0100 Subject: [PATCH 52/54] Fixing client segfault when data is returned with non-zero rank but no data. --- source/clientserver/protocol2.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/clientserver/protocol2.cpp b/source/clientserver/protocol2.cpp index 1ddbe7a9..b0d71d92 100755 --- a/source/clientserver/protocol2.cpp +++ b/source/clientserver/protocol2.cpp @@ -709,7 +709,11 @@ static int handle_data_block(XDR* xdrs, int direction, const void* str, int prot break; } - if (data_block->data_n == 0) break; // No Data to Receive! + if (data_block->data_n == 0) { + data_block->data_type = UDA_TYPE_UNKNOWN; + data_block->rank = 0; + break; // No Data to Receive! + } if ((err = allocData(data_block)) != 0) break; // Allocate Heap Memory From f9dfc71e22652a6f416872e5ff1e8059b57fc2d5 Mon Sep 17 00:00:00 2001 From: sdixon Date: Thu, 22 Aug 2024 15:43:24 +0100 Subject: [PATCH 53/54] reverting openSSL v3 syntax to v1.1 compatible syntax for udaServerSSL authentication --- source/authentication/udaServerSSL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/authentication/udaServerSSL.cpp b/source/authentication/udaServerSSL.cpp index 8354091c..62ba90ac 100644 --- a/source/authentication/udaServerSSL.cpp +++ b/source/authentication/udaServerSSL.cpp @@ -322,7 +322,7 @@ int startUdaServerSSL() } // Get the Client's certificate and verify - X509* peer = SSL_get1_peer_certificate(g_ssl); + X509* peer = SSL_get_peer_certificate(g_ssl); if (peer != nullptr) { if ((rc = (int)SSL_get_verify_result(g_ssl)) != X509_V_OK) { @@ -557,4 +557,4 @@ int readUdaServerSSL(void* iohandle, char* buf, int count) return rc; } -#endif // SERVERBUILD \ No newline at end of file +#endif // SERVERBUILD From d8378c3ff13c723570a34fdf069742eb0dbadf94 Mon Sep 17 00:00:00 2001 From: sdixon Date: Thu, 22 Aug 2024 15:55:28 +0100 Subject: [PATCH 54/54] updating c++11 flag to c++17 in pkgconfig files for the cpp wrapper --- source/etc/uda-cpp.pc.in | 2 +- source/etc/uda-fat-cpp.pc.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/etc/uda-cpp.pc.in b/source/etc/uda-cpp.pc.in index 1bc14774..744bf6a3 100755 --- a/source/etc/uda-cpp.pc.in +++ b/source/etc/uda-cpp.pc.in @@ -8,6 +8,6 @@ Name: UDA Description: The Universal Data Access library URL: https://ukaea.github.io/UDA/ Version: @PROJECT_VERSION@ -Cflags: -std=c++11 -I${includedir} -I${includedir}/c++ @PKGCONFIG_INCLUDES@ +Cflags: -std=c++17 -I${includedir} -I${includedir}/c++ @PKGCONFIG_INCLUDES@ Libs: -L${libdir} -luda_cpp @PKGCONFIG_LIBRARIES@ Requires: @PKGCONFIG_REQUIRES@ diff --git a/source/etc/uda-fat-cpp.pc.in b/source/etc/uda-fat-cpp.pc.in index 24012f85..2ac8a375 100755 --- a/source/etc/uda-fat-cpp.pc.in +++ b/source/etc/uda-fat-cpp.pc.in @@ -8,6 +8,6 @@ Name: UDA Description: The Universal Data Access library URL: https://ukaea.github.io/UDA/ Version: @PROJECT_VERSION@ -Cflags: -DFATCLIENT -std=c++11 -I${includedir} -I${includedir}/c++ @PKGCONFIG_INCLUDES@ +Cflags: -DFATCLIENT -std=c++17 -I${includedir} -I${includedir}/c++ @PKGCONFIG_INCLUDES@ Libs: -L${libdir} -lfatuda_cpp @PKGCONFIG_LIBRARIES@ Requires: @PKGCONFIG_REQUIRES@