Skip to content

Commit

Permalink
renaming struct api functions to include uda keyword e.g. udaAddMalloc()
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-dixon committed Jan 25, 2024
1 parent ea32085 commit 3e187dd
Show file tree
Hide file tree
Showing 27 changed files with 1,117 additions and 1,117 deletions.
2 changes: 1 addition & 1 deletion source/c_api/accAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3900,7 +3900,7 @@ int udaSetDataTree(int handle)
void* opaque_block = udaGetDataOpaqueBlock(handle);
setUserDefinedTypeList(((GENERAL_BLOCK*)opaque_block)->userdefinedtypelist);
setLogMallocList(((GENERAL_BLOCK*)opaque_block)->logmalloclist);
setLastMallocIndexValue(&(((GENERAL_BLOCK*)opaque_block)->lastMallocIndex));
udaSetLastMallocIndexValue(&(((GENERAL_BLOCK*)opaque_block)->lastMallocIndex));
return 1; // Return TRUE
}

Expand Down
16 changes: 8 additions & 8 deletions source/client/udaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ int idamClient(REQUEST_BLOCK* request_block, int* indices)
#endif

LOGSTRUCTLIST log_struct_list;
initLogStructList(&log_struct_list);
udaInitLogStructList(&log_struct_list);

unsigned int* private_flags = udaPrivateFlags();
CLIENT_FLAGS* client_flags = udaClientFlags();
Expand Down Expand Up @@ -1256,38 +1256,38 @@ void udaFree(int handle)
#ifndef FATCLIENT
if (g_user_defined_type_list ==
general_block->userdefinedtypelist) { // Is this the current setting?
freeUserDefinedTypeList(g_user_defined_type_list);
udaFreeUserDefinedTypeList(g_user_defined_type_list);
free(g_user_defined_type_list);
g_user_defined_type_list = nullptr;
} else {
freeUserDefinedTypeList(general_block->userdefinedtypelist);
udaFreeUserDefinedTypeList(general_block->userdefinedtypelist);
free(general_block->userdefinedtypelist);
}
#else
freeUserDefinedTypeList(general_block->userdefinedtypelist);
udaFreeUserDefinedTypeList(general_block->userdefinedtypelist);
free(general_block->userdefinedtypelist);
#endif
}

if (general_block->logmalloclist != nullptr) {
#ifndef FATCLIENT
if (g_log_malloc_list == general_block->logmalloclist) {
freeMallocLogList(g_log_malloc_list);
udaFreeMallocLogList(g_log_malloc_list);
free(g_log_malloc_list);
g_log_malloc_list = nullptr;
} else {
freeMallocLogList(general_block->logmalloclist);
udaFreeMallocLogList(general_block->logmalloclist);
free(general_block->logmalloclist);
}
#else
freeMallocLogList(general_block->logmalloclist);
udaFreeMallocLogList(general_block->logmalloclist);
free(general_block->logmalloclist);
#endif
}

#ifndef FATCLIENT
if (general_block->userdefinedtype != nullptr) {
freeUserDefinedType(general_block->userdefinedtype);
udaFreeUserDefinedType(general_block->userdefinedtype);
free(general_block->userdefinedtype);
}

Expand Down
4 changes: 2 additions & 2 deletions source/client2/handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ void uda::client::free_handle(int handle)
auto general_block = (GENERAL_BLOCK*)data_block->opaque_block;

if (general_block->userdefinedtypelist != nullptr) {
freeUserDefinedTypeList(general_block->userdefinedtypelist);
udaFreeUserDefinedTypeList(general_block->userdefinedtypelist);
free(general_block->userdefinedtypelist);
}

if (general_block->logmalloclist != nullptr) {
freeMallocLogList(general_block->logmalloclist);
udaFreeMallocLogList(general_block->logmalloclist);
free(general_block->logmalloclist);
}
}
Expand Down
28 changes: 14 additions & 14 deletions source/clientserver/protocolXML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,22 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC
if (udt == nullptr || u == nullptr) {
err = 999;
UDA_LOG(UDA_LOG_DEBUG, "protocolXML: nullptr SARRAY User defined data Structure Definition\n");
printUserDefinedTypeListTable(*userdefinedtypelist);
udaPrintUserDefinedTypeListTable(*userdefinedtypelist);
udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err,
"nullptr User defined data Structure Definition");
break;
}

UDA_LOG(UDA_LOG_DEBUG, "protocolXML: Creating SARRAY carrier structure\n");

initSArray(&sarray);
udaInitSArray(&sarray);
sarray.count = data_block->data_n; // Number of this structure
sarray.rank = 1; // Array Data Rank?
sarray.shape = &shape; // Only if rank > 1?
sarray.data = (void*)data_block->data; // Pointer to the data to be passed
strcpy(sarray.type, udt->name); // The name of the type
data = (void*)&psarray; // Pointer to the SARRAY array pointer
addNonMalloc(logmalloclist, (void*)&shape, 1, sizeof(int), "int");
udaAddNonMalloc(logmalloclist, (void*)&shape, 1, sizeof(int), "int");

UDA_LOG(UDA_LOG_DEBUG, "protocolXML: sending Structure Definitions\n");

Expand Down Expand Up @@ -240,7 +240,7 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC
UDA_LOG(UDA_LOG_DEBUG, "protocolXML: Structure Definitions sent: rc = %d\n", rc);

// send the Data
rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data,
protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source);

UDA_LOG(UDA_LOG_DEBUG, "protocolXML: Data sent: rc = %d\n", rc);
Expand Down Expand Up @@ -377,12 +377,12 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC

if (option == 1 || option == 2) {
logmalloclist = (LOGMALLOCLIST*)malloc(sizeof(LOGMALLOCLIST));
initLogMallocList(logmalloclist);
udaInitLogMallocList(logmalloclist);

userdefinedtypelist = (USERDEFINEDTYPELIST*)malloc(sizeof(USERDEFINEDTYPELIST));
auto udt_received = (USERDEFINEDTYPE*)malloc(sizeof(USERDEFINEDTYPE));

initUserDefinedTypeList(userdefinedtypelist);
udaInitUserDefinedTypeList(userdefinedtypelist);

UDA_LOG(UDA_LOG_DEBUG, "protocolXML: xdr_userdefinedtypelist #A\n");

Expand Down Expand Up @@ -439,14 +439,14 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC
"Failure receiving Structure Definitions");
break;
}
UDA_LOG(UDA_LOG_DEBUG, "protocolXML: xdrUserDefinedTypeData #A\n");
initUserDefinedType(udt_received);
UDA_LOG(UDA_LOG_DEBUG, "protocolXML: udaXdrUserDefinedTypeData #A\n");
udaInitUserDefinedType(udt_received);

rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data,
protocolVersion, xdr_stdio_flag, log_struct_list,
malloc_source); // receive the Data

UDA_LOG(UDA_LOG_DEBUG, "protocolXML: xdrUserDefinedTypeData #B\n");
UDA_LOG(UDA_LOG_DEBUG, "protocolXML: udaXdrUserDefinedTypeData #B\n");
if (!rc) {
err = 999;
udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err,
Expand Down Expand Up @@ -567,12 +567,12 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC
// Unpack the data Structures

logmalloclist = (LOGMALLOCLIST*)malloc(sizeof(LOGMALLOCLIST));
initLogMallocList(logmalloclist);
udaInitLogMallocList(logmalloclist);

userdefinedtypelist = (USERDEFINEDTYPELIST*)malloc(sizeof(USERDEFINEDTYPELIST));
auto udt_received = (USERDEFINEDTYPE*)malloc(sizeof(USERDEFINEDTYPE));

initUserDefinedTypeList(userdefinedtypelist);
udaInitUserDefinedTypeList(userdefinedtypelist);

// Create input xdr file stream

Expand All @@ -598,9 +598,9 @@ int protocolXML(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLOC
break;
}

initUserDefinedType(udt_received);
udaInitUserDefinedType(udt_received);

rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received,
&data, protocolVersion, xdr_stdio_flag, log_struct_list,
malloc_source); // receive the Data

Expand Down
52 changes: 26 additions & 26 deletions source/clientserver/protocolXML2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,22 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO
if (udt == nullptr || u == nullptr) {
err = 999;
UDA_LOG(UDA_LOG_DEBUG, "nullptr SARRAY User defined data Structure Definition\n");
printUserDefinedTypeListTable(*userdefinedtypelist);
udaPrintUserDefinedTypeListTable(*userdefinedtypelist);
udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err,
"nullptr User defined data Structure Definition");
break;
}

UDA_LOG(UDA_LOG_DEBUG, "Creating SARRAY carrier structure\n");

initSArray(&sarray);
udaInitSArray(&sarray);
sarray.count = data_block->data_n; // Number of this structure
sarray.rank = 1; // Array Data Rank?
sarray.shape = &shape; // Only if rank > 1?
sarray.data = (void*)data_block->data; // Pointer to the data to be passed
strcpy(sarray.type, udt->name); // The name of the type
data = (void*)&psarray; // Pointer to the SARRAY array pointer
addNonMalloc(logmalloclist, (void*)&shape, 1, sizeof(int), "int");
udaAddNonMalloc(logmalloclist, (void*)&shape, 1, sizeof(int), "int");

UDA_LOG(UDA_LOG_DEBUG, "sending Structure Definitions\n");

Expand Down Expand Up @@ -326,7 +326,7 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO
break;
}

rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, u, (void**)data,
protocolVersion, xdr_stdio_flag, log_struct_list,
malloc_source); // send the Data

Expand Down Expand Up @@ -602,12 +602,12 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO
// Unpack data structures
if (option == 1 || option == 2 || option == 5) {
logmalloclist = (LOGMALLOCLIST*)malloc(sizeof(LOGMALLOCLIST));
initLogMallocList(logmalloclist);
udaInitLogMallocList(logmalloclist);

userdefinedtypelist = (USERDEFINEDTYPELIST*)malloc(sizeof(USERDEFINEDTYPELIST));
auto udt_received = (USERDEFINEDTYPE*)malloc(sizeof(USERDEFINEDTYPE));

initUserDefinedTypeList(userdefinedtypelist);
udaInitUserDefinedTypeList(userdefinedtypelist);

UDA_LOG(UDA_LOG_DEBUG, "xdr_userdefinedtypelist #A\n");

Expand Down Expand Up @@ -707,14 +707,14 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO
break;
}

UDA_LOG(UDA_LOG_DEBUG, "xdrUserDefinedTypeData #A\n");
initUserDefinedType(udt_received);
UDA_LOG(UDA_LOG_DEBUG, "udaXdrUserDefinedTypeData #A\n");
udaInitUserDefinedType(udt_received);

rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data,
protocolVersion, xdr_stdio_flag, log_struct_list,
malloc_source); // receive the Data

UDA_LOG(UDA_LOG_DEBUG, "xdrUserDefinedTypeData #B\n");
UDA_LOG(UDA_LOG_DEBUG, "udaXdrUserDefinedTypeData #B\n");
if (!rc) {
err = 999;
udaAddError(UDA_CODE_ERROR_TYPE, "protocolXML", err,
Expand Down Expand Up @@ -874,12 +874,12 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO
// Unpack the data Structures

logmalloclist = (LOGMALLOCLIST*)malloc(sizeof(LOGMALLOCLIST));
initLogMallocList(logmalloclist);
udaInitLogMallocList(logmalloclist);

userdefinedtypelist = (USERDEFINEDTYPELIST*)malloc(sizeof(USERDEFINEDTYPELIST));
USERDEFINEDTYPE* udt_received = (USERDEFINEDTYPE*)malloc(sizeof(USERDEFINEDTYPE));

initUserDefinedTypeList(userdefinedtypelist);
udaInitUserDefinedTypeList(userdefinedtypelist);

// Close current input xdr stream and create a memory stream

Expand All @@ -902,9 +902,9 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO
break;
}

initUserDefinedType(udt_received);
udaInitUserDefinedType(udt_received);

rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received,
&data, protocolVersion, xdr_stdio_flag, log_struct_list,
malloc_source); // receive the Data

Expand Down Expand Up @@ -1002,12 +1002,12 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO
// Unpack the data Structures

logmalloclist = (LOGMALLOCLIST*)malloc(sizeof(LOGMALLOCLIST));
initLogMallocList(logmalloclist);
udaInitLogMallocList(logmalloclist);

userdefinedtypelist = (USERDEFINEDTYPELIST*)malloc(sizeof(USERDEFINEDTYPELIST));
USERDEFINEDTYPE* udt_received = (USERDEFINEDTYPE*)malloc(sizeof(USERDEFINEDTYPE));

initUserDefinedTypeList(userdefinedtypelist);
udaInitUserDefinedTypeList(userdefinedtypelist);

// Create input xdr file stream

Expand Down Expand Up @@ -1037,9 +1037,9 @@ int protocolXML2(XDR* xdrs, int protocol_id, int direction, int* token, LOGMALLO
break;
}

initUserDefinedType(udt_received);
udaInitUserDefinedType(udt_received);

rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received,
&data, protocolVersion, xdr_stdio_flag, log_struct_list,
malloc_source); // receive the Data

Expand Down Expand Up @@ -1189,12 +1189,12 @@ int unpackXDRFile(LOGMALLOCLIST* logmalloclist, XDR* xdrs, unsigned char* filena
// Unpack the data Structures

logmalloclist = (LOGMALLOCLIST*)malloc(sizeof(LOGMALLOCLIST));
initLogMallocList(logmalloclist);
udaInitLogMallocList(logmalloclist);

auto userdefinedtypelist = (USERDEFINEDTYPELIST*)malloc(sizeof(USERDEFINEDTYPELIST));
auto udt_received = (USERDEFINEDTYPE*)malloc(sizeof(USERDEFINEDTYPE));

initUserDefinedTypeList(userdefinedtypelist);
udaInitUserDefinedTypeList(userdefinedtypelist);

// Close current input xdr stream and create a file stream

Expand Down Expand Up @@ -1227,9 +1227,9 @@ int unpackXDRFile(LOGMALLOCLIST* logmalloclist, XDR* xdrs, unsigned char* filena

// Unpack the Data

initUserDefinedType(udt_received);
udaInitUserDefinedType(udt_received);

rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data,
protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source);

if (!rc) {
Expand Down Expand Up @@ -1305,12 +1305,12 @@ int unpackXDRObject(LOGMALLOCLIST* logmalloclist, XDR* xdrs, unsigned char* obje
// Unpack the data Structures

logmalloclist = (LOGMALLOCLIST*)malloc(sizeof(LOGMALLOCLIST));
initLogMallocList(logmalloclist);
udaInitLogMallocList(logmalloclist);

auto userdefinedtypelist = (USERDEFINEDTYPELIST*)malloc(sizeof(USERDEFINEDTYPELIST));
auto udt_received = (USERDEFINEDTYPE*)malloc(sizeof(USERDEFINEDTYPE));

initUserDefinedTypeList(userdefinedtypelist);
udaInitUserDefinedTypeList(userdefinedtypelist);

// Create a memory stream

Expand All @@ -1337,9 +1337,9 @@ int unpackXDRObject(LOGMALLOCLIST* logmalloclist, XDR* xdrs, unsigned char* obje

// Unpack the Data

initUserDefinedType(udt_received);
udaInitUserDefinedType(udt_received);

rc = rc && xdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data,
rc = rc && udaXdrUserDefinedTypeData(xdrs, logmalloclist, userdefinedtypelist, udt_received, &data,
protocolVersion, xdr_stdio_flag, log_struct_list, malloc_source);

if (!rc) {
Expand Down
Loading

0 comments on commit 3e187dd

Please sign in to comment.