Skip to content

Commit

Permalink
fixing pyuda build and renaming missed init struct api functions
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-dixon committed Jan 26, 2024
1 parent a3f5a5c commit 4af76f7
Show file tree
Hide file tree
Showing 45 changed files with 334 additions and 334 deletions.
32 changes: 16 additions & 16 deletions source/c_api/accAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ void udaLockThread()
idamState[i].socket = -1;
idamState[i].lastHandle = -1;
// initEnvironment(&(idamState[i].environment));
initClientBlock(&(idamState[i].client_block), 0, "");
initServerBlock(&(idamState[i].server_block), 0);
udaInitClientBlock(&(idamState[i].client_block), 0, "");
udaInitServerBlock(&(idamState[i].server_block), 0);
threadList[i] = 0; // and the thread identifiers
}
}
Expand Down Expand Up @@ -212,8 +212,8 @@ void udaFreeThread()
idamState[threadCount].socket = -1;
idamState[threadCount].lastHandle = -1;
// initEnvironment(&(idamState[threadCount].environment));
initClientBlock(&(idamState[threadCount].client_block), 0, "");
initServerBlock(&(idamState[threadCount].server_block), 0);
udaInitClientBlock(&(idamState[threadCount].client_block), 0, "");
udaInitServerBlock(&(idamState[threadCount].server_block), 0);
threadList[threadCount] = 0;
}
udaUnlockThread();
Expand Down Expand Up @@ -273,7 +273,7 @@ int udaGrowDataBlocks()
}

data_blocks.push_back({});
initDataBlock(&data_blocks.back());
udaInitDataBlock(&data_blocks.back());
data_blocks.back().handle = data_blocks.size() - 1;

udaPutThreadLastHandle(data_blocks.size() - 1);
Expand Down Expand Up @@ -302,7 +302,7 @@ int udaGetNewDataHandle()
udaFree(newHandleIndex);
} else {
// Application has responsibility for freeing heap in the Data Block
initDataBlock(&data_blocks[newHandleIndex]);
udaInitDataBlock(&data_blocks[newHandleIndex]);
}
data_blocks[newHandleIndex].handle = newHandleIndex;
return newHandleIndex;
Expand All @@ -311,10 +311,10 @@ int udaGetNewDataHandle()
if ((newHandleIndex = findNewHandleIndex()) < 0) { // Search for an unused handle or issue a new one
newHandleIndex = data_blocks.size();
data_blocks.push_back({});
initDataBlock(&data_blocks[newHandleIndex]);
udaInitDataBlock(&data_blocks[newHandleIndex]);
data_blocks[newHandleIndex].handle = newHandleIndex;
} else {
initDataBlock(&data_blocks[newHandleIndex]);
udaInitDataBlock(&data_blocks[newHandleIndex]);
data_blocks[newHandleIndex].handle = newHandleIndex;
}

Expand Down Expand Up @@ -3650,15 +3650,15 @@ const char* udaGetFileFormat(int handle)
//-----------------------------------------------------------------------------------------------------------
// Various Utilities

void udaInitDataBlock(DATA_BLOCK* str)
{
initDataBlock(str);
}
// void udaInitDataBlock(DATA_BLOCK* str)
// {
// udaInitDataBlock(str);
// }

void udaInitRequestBlock(REQUEST_BLOCK* str)
{
initRequestBlock(str);
}
// void udaInitRequestBlock(REQUEST_BLOCK* str)
// {
// udaInitRequestBlock(str);
// }

int udaDataCheckSum(void* data, int data_n, int type)
{
Expand Down
4 changes: 2 additions & 2 deletions source/c_api/clientAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int udaClientAPI(const char* file, const char* signal, int pass, int exp_number)
//-------------------------------------------------------------------------
// Initialise the Client Data Request Structure

initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

//------------------------------------------------------------------------------
// Build the Request Data Block (Version and API dependent)
Expand Down Expand Up @@ -107,7 +107,7 @@ int udaClientFileAPI(const char* file, const char* signal, const char* format)
//-------------------------------------------------------------------------
// Initialise the Client Data Request Structure

initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

//------------------------------------------------------------------------------
// Build the Request Data Block (Version and API dependent)
Expand Down
4 changes: 2 additions & 2 deletions source/c_api/clientMDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ int udaClientMDS(const char* server, const char* tree, const char* node, int tre
// Passed Args

REQUEST_BLOCK request_block;
initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

request_block.num_requests = 1;
request_block.requests = (REQUEST_DATA*)malloc(sizeof(REQUEST_DATA));
auto request = &request_block.requests[0];
initRequestData(request);
udaInitRequestData(request);

request->request = REQUEST_READ_MDS;
request->exp_number = treenum;
Expand Down
4 changes: 2 additions & 2 deletions source/c_api/udaGetAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int udaGetAPIWithHost(const char* data_object, const char* data_source, const ch
// Initialise the Client Data Request Structure

REQUEST_BLOCK request_block;
initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

//------------------------------------------------------------------------------
// Build the Request Data Block (Version and API dependent)
Expand Down Expand Up @@ -316,7 +316,7 @@ int udaGetBatchAPIWithHost(const char** signals, const char** sources, int count
// Initialise the Client Data Request Structure

REQUEST_BLOCK request_block;
initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

//------------------------------------------------------------------------------
// Build the Request Data Block (Version and API dependent)
Expand Down
8 changes: 4 additions & 4 deletions source/c_api/udaPutAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int udaPutListAPI(const char* putInstruction, PUTDATA_BLOCK_LIST* inPutDataBlock
putDataBlockList = inPutDataBlockList;
} else {
putDataBlockList = &emptyPutDataBlockList;
initPutDataBlockList(putDataBlockList);
udaInitPutDataBlockList(putDataBlockList);
}

//-------------------------------------------------------------------------
Expand All @@ -72,7 +72,7 @@ int udaPutListAPI(const char* putInstruction, PUTDATA_BLOCK_LIST* inPutDataBlock
//-------------------------------------------------------------------------
// Initialise the Client Data Request Structure

initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

//------------------------------------------------------------------------------
// Build the Request Data Block (Version and API dependent)
Expand Down Expand Up @@ -123,7 +123,7 @@ int udaPutAPI(const char* putInstruction, PUTDATA_BLOCK* inPutData)
putData = inPutData;
} else {
putData = &emptyPutDataBlock;
initIdamPutDataBlock(putData);
udaInitPutDataBlock(putData);
}

//-------------------------------------------------------------------------
Expand Down Expand Up @@ -151,7 +151,7 @@ int udaPutAPI(const char* putInstruction, PUTDATA_BLOCK* inPutData)
//-------------------------------------------------------------------------
// Initialise the Client Data Request Structure

initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

//------------------------------------------------------------------------------
// Build the Request Data Block (Version and API dependent)
Expand Down
2 changes: 1 addition & 1 deletion source/cache/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DATA_BLOCK* readCacheData(FILE* fp, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYP
xdrstdio_create(&xdrs, fp, XDR_DECODE);

DATA_BLOCK_LIST data_block_list;
initDataBlockList(&data_block_list);
udaInitDataBlockList(&data_block_list);

int token;
protocol2(&xdrs, UDA_PROTOCOL_DATA_BLOCK_LIST, XDR_RECEIVE, &token, logmalloclist, userdefinedtypelist,
Expand Down
2 changes: 1 addition & 1 deletion source/client/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ int createConnection(XDR* client_input, XDR* client_output, time_t* tv_server_st
return 0;
}

void closeAllConnections()
void udaCloseAllConnections()
{
closeConnection(ClosedownType::CLOSE_ALL);
}
Expand Down
2 changes: 1 addition & 1 deletion source/client/makeClientRequestBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int makeClientRequestBlock(const char** signals, const char** sources, int count
int err = 0;
for (int i = 0; i < count; ++i) {
REQUEST_DATA* request = &request_block->requests[i];
initRequestData(request);
udaInitRequestData(request);
if ((err = makeRequestData(signals[i], sources[i], request))) {
return err;
}
Expand Down
10 changes: 5 additions & 5 deletions source/client/udaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void copyDataBlock(DATA_BLOCK* str, DATA_BLOCK* in)
memcpy(str->data_label, in->data_label, STRING_LENGTH);
memcpy(str->data_desc, in->data_desc, STRING_LENGTH);
memcpy(str->error_msg, in->error_msg, STRING_LENGTH);
initClientBlock(&str->client_block, 0, "");
udaInitClientBlock(&str->client_block, 0, "");
}

void copyClientBlock(CLIENT_BLOCK* str, const CLIENT_FLAGS* client_flags)
Expand Down Expand Up @@ -407,7 +407,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices)
udaFreeErrorStack(&server_block.idamerrorstack); // Free Previous Stack Heap
}

initServerBlock(&server_block, 0); // Reset previous Error Messages from the Server & Free Heap
udaInitServerBlock(&server_block, 0); // Reset previous Error Messages from the Server & Free Heap
udaInitErrorStack();

//-------------------------------------------------------------------------
Expand Down Expand Up @@ -565,7 +565,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices)

if (initServer && system_startup) {
userid(client_username);
initClientBlock(&client_block, client_version, client_username);
udaInitClientBlock(&client_block, client_version, client_username);
system_startup = false; // Don't call again!
}

Expand Down Expand Up @@ -1004,7 +1004,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices)
// Fat Client Server

DATA_BLOCK_LIST data_block_list0;
initDataBlockList(&data_block_list0);
udaInitDataBlockList(&data_block_list0);
err = fatServer(client_block, &server_block, request_block, &data_block_list0);

for (int i = 0; i < data_block_list0.count; ++i) {
Expand Down Expand Up @@ -1417,7 +1417,7 @@ void udaFree(int handle)

// closeIdamError(&server_block.idamerrorstack);
udaFreeErrorStack(&server_block.idamerrorstack);
initDataBlock(data_block);
udaInitDataBlock(data_block);
data_block->handle = -1; // Flag this as ready for re-use
}

Expand Down
14 changes: 7 additions & 7 deletions source/client2/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void copy_data_block(DATA_BLOCK* str, DATA_BLOCK* in)
memcpy(str->data_label, in->data_label, STRING_LENGTH);
memcpy(str->data_desc, in->data_desc, STRING_LENGTH);
memcpy(str->error_msg, in->error_msg, STRING_LENGTH);
initClientBlock(&str->client_block, 0, "");
udaInitClientBlock(&str->client_block, 0, "");
}

void copy_client_block(CLIENT_BLOCK* str, const ClientFlags* client_flags)
Expand Down Expand Up @@ -155,7 +155,7 @@ uda::client::Client::Client() : connection_{environment_}, protocol_version_{Cli
userid(username);
client_username_ = username;

initClientBlock(&client_block_, ClientVersion, client_username_.c_str());
udaInitClientBlock(&client_block_, ClientVersion, client_username_.c_str());

//----------------------------------------------------------------
// Check if Output Requested
Expand Down Expand Up @@ -328,7 +328,7 @@ int get_data_status(DATA_BLOCK* data_block)

int uda::client::Client::get_requests(RequestBlock& request_block, int* indices)
{
initServerBlock(&server_block_, 0);
udaInitServerBlock(&server_block_, 0);
udaInitErrorStack();

time_t tv_server_start = 0;
Expand Down Expand Up @@ -595,7 +595,7 @@ int uda::client::Client::send_putdata(const RequestBlock& request_block)
int uda::client::Client::get(std::string_view data_signal, std::string_view data_source)
{
REQUEST_BLOCK request_block;
initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

auto signal_ptr = data_signal.data();
auto source_ptr = data_source.data();
Expand All @@ -619,7 +619,7 @@ int uda::client::Client::get(std::string_view data_signal, std::string_view data
std::vector<int> uda::client::Client::get(std::vector<std::pair<std::string, std::string>>& requests)
{
REQUEST_BLOCK request_block;
initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

std::vector<const char*> signals;
std::transform(requests.begin(), requests.end(), std::back_inserter(signals),
Expand Down Expand Up @@ -1202,7 +1202,7 @@ void uda::client::Client::set_full_ntree(NTREE* full_ntree)
int uda::client::Client::put(std::string_view put_instruction, PUTDATA_BLOCK* putdata_block)
{
REQUEST_BLOCK request_block;
initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

auto signal_ptr = put_instruction.data();
auto source_ptr = "";
Expand Down Expand Up @@ -1231,7 +1231,7 @@ int uda::client::Client::put(std::string_view put_instruction, PUTDATA_BLOCK* pu
int uda::client::Client::put(std::string_view put_instruction, PUTDATA_BLOCK_LIST* putdata_block_list)
{
REQUEST_BLOCK request_block;
initRequestBlock(&request_block);
udaInitRequestBlock(&request_block);

auto signal_ptr = put_instruction.data();
auto source_ptr = "";
Expand Down
2 changes: 1 addition & 1 deletion source/client2/handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ void uda::client::free_handle(int handle)

// closeIdamError(&server_block.idamerrorstack);

initDataBlock(data_block);
udaInitDataBlock(data_block);
data_block->handle = -1; // Flag this as ready for re-use
}
2 changes: 1 addition & 1 deletion source/client2/make_request_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int uda::client::make_request_block(const Environment* environment, const char**
int err = 0;
for (int i = 0; i < count; ++i) {
REQUEST_DATA* request = &request_block->requests[i];
initRequestData(request);
udaInitRequestData(request);
if ((err = make_request_data(environment, signals[i], sources[i], request))) {
return err;
}
Expand Down
2 changes: 1 addition & 1 deletion source/clientserver/allocData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int allocData(DATA_BLOCK* data_block)
return ERROR_ALLOCATING_HEAP;
}
for (unsigned int i = 0; i < data_block->rank; i++) {
initDimBlock(&data_block->dims[i]);
udaInitDimBlock(&data_block->dims[i]);
}
}

Expand Down
Loading

0 comments on commit 4af76f7

Please sign in to comment.