#include "stdafx.h"
#include "MASTER.h"
 #define ___260
#include "GLOBAL.h"
#include "TASSERT.h"
#include "ALLOC.h"
#include "CHARTYPE.h"
#include "STRUTIL.h"
#include "ARRLIST.h"
#include "DATASET.h"
#include "STRLIST.h"
#include "SET.h"
#include "AUXDATA.h"
using namespace tecplot; struct AuxDataItem_s { char const*   ___2686; ___90    ___4315; AuxDataType_e ___4236; ___372     ___3362; }; struct AuxData_s { ___90   ___2893; ___134 ItemList; }; ___372 ___250(char      ___472, ___372 ___2030) { ___372 IsValidNameChar; REQUIRE("Char can be any value"); REQUIRE(VALID_BOOLEAN(___2030)); IsValidNameChar = (___472 == '_' || tecplot::___1998(___472)); if (!___2030) IsValidNameChar = (IsValidNameChar || ___472 == '.'     || tecplot::___2012(___472)); ENSURE(VALID_BOOLEAN(IsValidNameChar)); return IsValidNameChar; } ___372 ___249(const char *___2686) { ___372  IsValidName; const char *NPtr; REQUIRE(VALID_REF(___2686)); for (NPtr = ___2686, IsValidName = ___250(*NPtr, ___4226); IsValidName && *NPtr != '\0'; NPtr++) { IsValidName = ___250(*NPtr, ___1305); } ENSURE(VALID_BOOLEAN(IsValidName)); return IsValidName; } static void AuxDataItemDealloc(AuxDataItem_s **AuxDataItem) { REQUIRE(VALID_REF(AuxDataItem)); REQUIRE(VALID_REF(*AuxDataItem) || *AuxDataItem == NULL); if (*AuxDataItem != NULL) { char* ___2686 = const_cast<char*>((*AuxDataItem)->___2686); if (___2686 != NULL) ___1530(___2686, "auxiliary name"); ___478((*AuxDataItem)->___4236 == ___270); char* ___4315 = reinterpret_cast<char*>((*AuxDataItem)->___4315); if (___4315 != NULL) ___1530(___4315, "auxiliary value"); ___1531(*AuxDataItem, "auxiliary data item"); *AuxDataItem = NULL; } ENSURE(*AuxDataItem == NULL); } static AuxDataItem_s* AuxDataItemAlloc(char const*   ___2686, ___90    ___4315, AuxDataType_e ___4236, ___372     ___3362) { REQUIRE(VALID_REF(___2686) && ___249(___2686)); REQUIRE(IMPLICATION(___4236 == ___270, (VALID_REF((char *)___4315) || (char *)___4315 == NULL))); REQUIRE(VALID_ENUM(___4236, AuxDataType_e)); REQUIRE(VALID_BOOLEAN(___3362)); AuxDataItem_s* ___3359 = ALLOC_ITEM(AuxDataItem_s, "auxiliary data item"); if (___3359 != NULL) { ___372 ___2040; ___3359->___4236   = ___4236; ___3359->___3362 = ___3362; ___3359->___2686   = ___1135(___1097(___2686)); ___2040 = (___3359->___2686 != NULL); ___3359->___4315 = 0; if (___2040) { ___478(___4236 == ___270); char* strValue = reinterpret_cast<char*>(___4315); if (strValue != NULL) { char* strCopy = ___1135(___1097(strValue)); ___3359->___4315 = reinterpret_cast<___90>(strCopy); ___2040 = (strCopy != NULL); } else { ___3359->___4315 = 0; } } if (!___2040) AuxDataItemDealloc(&___3359); } ENSURE(VALID_REF(___3359) || ___3359 == NULL); return ___3359; } static ___372 AuxDataItemListItemDestructor(void       *___2098, ___90  ___494) { AuxDataItem_s **AuxDataItemRef = (AuxDataItem_s **)___2098; REQUIRE(VALID_REF(AuxDataItemRef)); REQUIRE(VALID_REF(*AuxDataItemRef) || *AuxDataItemRef == NULL); ___4278(___494); if (*AuxDataItemRef != NULL) AuxDataItemDealloc(AuxDataItemRef); ENSURE(*AuxDataItemRef == NULL); return ___4226; } ___372 ___251(void       *___2098, ___90  ___494) { ___264 *AuxDataRef = (___264 *)___2098; REQUIRE(VALID_REF(AuxDataRef)); REQUIRE(VALID_REF(*AuxDataRef) || *AuxDataRef == NULL); ___4278(___494); if (*AuxDataRef != NULL) ___236(AuxDataRef); ENSURE(*AuxDataRef == NULL); return ___4226; } static ___372 AuxDataItemDuplicator(void       *___3949, void       *___3645, ___90 ___494) { ___372 ___2040 = ___4226; AuxDataItem_s **TargetAuxDataItemRef = (AuxDataItem_s **)___3949; AuxDataItem_s **SourceAuxDataItemRef = (AuxDataItem_s **)___3645; ___372       ConsiderRetain; REQUIRE(VALID_REF(TargetAuxDataItemRef)); REQUIRE(VALID_REF(SourceAuxDataItemRef)); REQUIRE(VALID_REF(*SourceAuxDataItemRef) || *SourceAuxDataItemRef == NULL); REQUIRE(VALID_BOOLEAN((___372)___494)); ConsiderRetain = (___372)___494; if (*SourceAuxDataItemRef != NULL && (!ConsiderRetain || (*SourceAuxDataItemRef)->___3362)) { *TargetAuxDataItemRef = AuxDataItemAlloc((*SourceAuxDataItemRef)->___2686, (*SourceAuxDataItemRef)->___4315, (*SourceAuxDataItemRef)->___4236, (*SourceAuxDataItemRef)->___3362); ___2040 = (*TargetAuxDataItemRef != NULL); } else *TargetAuxDataItemRef = NULL; ENSURE(VALID_REF(*TargetAuxDataItemRef) || *TargetAuxDataItemRef == NULL); ENSURE(VALID_BOOLEAN(___2040)); return ___2040; } void ___236(___264 *___230) { REQUIRE(VALID_REF(___230)); REQUIRE(VALID_REF(*___230) || *___230 == NULL); if (*___230 != NULL) { ArrayListDealloc(&(*___230)->ItemList, AuxDataItemListItemDestructor, 0); ___1531(*___230, "auxiliary data container"); *___230 = NULL; } ENSURE(*___230 == NULL); } ___264 ___231(___90 ___2893) { ___264 ___3359 = ALLOC_ITEM(AuxData_s, "auxiliary data container"); if (___3359 != NULL) { ___3359->___2893 = ___2893; ___3359->ItemList = ArrayListAlloc(0, ArrayListType_VoidPtr, NULL, 0); if (___3359->ItemList == NULL) ___236(&___3359); } ENSURE(VALID_REF(___3359) || ___3359 == NULL); return ___3359; } ___264 ___234(___264 ___230, ___372  ConsiderRetain) { ___264 ___3359; REQUIRE(VALID_REF(___230));
REQUIRE(VALID_BOOLEAN(ConsiderRetain)); ___3359 = ALLOC_ITEM(AuxData_s, "auxiliary data container"); if (___3359 != NULL) { ___3359->___2893 = ___230->___2893; ___3359->ItemList = ArrayListCopy(___230->ItemList, AuxDataItemDuplicator, ConsiderRetain); if (___3359->ItemList != NULL) { if (ConsiderRetain) { int32_t ___2097 = 0; int32_t ItemCount = static_cast<int32_t>(___101(___3359->ItemList)); while (___2097 < ItemCount) { if (___133(___3359->ItemList, ___2097) == NULL) { int32_t BaseOffsetToRemove = ___2097; int32_t NumItemsToRemove   = 1; while (BaseOffsetToRemove + NumItemsToRemove < ItemCount && ___133(___3359->ItemList, BaseOffsetToRemove + NumItemsToRemove) == NULL) NumItemsToRemove++; ArrayListDeleteItems(___3359->ItemList, BaseOffsetToRemove, NumItemsToRemove, NULL, 0); ItemCount = ___101(___3359->ItemList); } else ___2097++; } } } else ___236(&___3359); } ENSURE(VALID_REF(___3359) || ___3359 == NULL); return ___3359; } int32_t ___248(___264 ___230) { int32_t NumItems; REQUIRE(VALID_REF(___230)); NumItems = ___101(___230->ItemList); ENSURE(NumItems >= 0); return NumItems; } ___372 ___246(___264  ___230, const char *___2686, int32_t    *___2096) { ___372 FoundItem = ___1305; int32_t   ___1926; int32_t   NumItems; REQUIRE(VALID_REF(___230)); INVARIANT("AuxData->ItemList is case-insensitive sorted by AuxDataItem->Name"); REQUIRE(VALID_REF(___2686) && ___249(___2686)); REQUIRE(VALID_REF(___2096)); NumItems = ___248(___230); int ___2324, ___1830; ___2324 = 0; ___1830 = NumItems - 1; ___1926 = 0; while (___2324 <= ___1830) { int CompareResult; ___1926 = (___2324 + ___1830) / 2; AuxDataItem_s* AuxDataItem = (AuxDataItem_s *)___133(___230->ItemList, ___1926); CompareResult = ustrcmp(___2686, AuxDataItem->___2686); if (CompareResult < 0) ___1830 = ___1926 - 1; else if (CompareResult > 0) ___2324 = ++___1926; else { FoundItem = ___4226; break; } } *___2096 = ___1926; ENSURE(VALID_BOOLEAN(FoundItem)); ENSURE(0 <= *___2096 && ((FoundItem  && *___2096 <  NumItems) || (!FoundItem && *___2096 <= NumItems))); return FoundItem; } void ___244(___264    ___230, int32_t       ___1926, const char    **___2686, ___90    *___4315, AuxDataType_e *___4236, ___372     *___3362) { AuxDataItem_s *AuxDataItem; REQUIRE(VALID_REF(___230)); INVARIANT("AuxData->ItemList is case-insensitive sorted by AuxDataItem->Name"); REQUIRE(0 <= ___1926 && ___1926 < ___101(___230->ItemList)); REQUIRE(VALID_REF(___2686)); REQUIRE(VALID_REF(___4315)); REQUIRE(VALID_REF(___4236)); REQUIRE(VALID_REF(___3362)); AuxDataItem = (AuxDataItem_s *)___133(___230->ItemList, ___1926); *___2686       = AuxDataItem->___2686; *___4315      = AuxDataItem->___4315; *___4236       = AuxDataItem->___4236; *___3362     = AuxDataItem->___3362; ENSURE(VALID_REF(*___2686) && ___249(*___2686)); ENSURE(IMPLICATION(*___4236 == ___270, (VALID_REF((char *)(*___4315)) || (char *)(*___4315) == NULL))); ENSURE(VALID_ENUM(*___4236, AuxDataType_e)); ENSURE(VALID_BOOLEAN(*___3362)); } ___372 ___245(___264    ___230, const char    *___2686, ___90    *___4315, AuxDataType_e *___4236, ___372     *___3362) { ___372 FoundItem; int32_t ___2096; REQUIRE(VALID_REF(___230)); INVARIANT("AuxData->ItemList is case-insensitive sorted by AuxDataItem->Name"); REQUIRE(VALID_REF(___2686) && ___249(___2686)); REQUIRE(VALID_REF(___4315)); REQUIRE(VALID_REF(___4236)); REQUIRE(VALID_REF(___3362)); FoundItem = ___246(___230, ___2686, &___2096); if (FoundItem) { const char *SameName; ___244(___230, ___2096, &SameName, ___4315, ___4236, ___3362); ___478(ustrcmp(___2686, SameName) == 0); } ENSURE(VALID_BOOLEAN(FoundItem)); ENSURE(IMPLICATION(FoundItem, IMPLICATION(*___4236 == ___270, (VALID_REF((char *)(*___4315)) || (char *)(*___4315) == NULL)))); ENSURE(IMPLICATION(FoundItem, VALID_ENUM(*___4236, AuxDataType_e))); ENSURE(IMPLICATION(FoundItem, VALID_BOOLEAN(*___3362))); return FoundItem; } ___372 ___242(___264     ___230, const char    *___2686, ___372     *___4315, AuxDataType_e *___4236, ___372     *___3362) { ___372 FoundItem; REQUIRE(VALID_REF(___230)); INVARIANT("AuxData->ItemList is case-insensitive sorted by AuxDataItem->Name"); REQUIRE(VALID_REF(___2686) && ___249(___2686)); REQUIRE(VALID_REF(___4315)); REQUIRE(VALID_REF(___4236)); REQUIRE(VALID_REF(___3362)); ___90 strValue; FoundItem = ___245(___230, ___2686, &strValue, ___4236, ___3362); if (FoundItem && (ustrcmp((char *)strValue, "YES")  == 0 || ustrcmp((char *)strValue, "YEP")  == 0 || ustrcmp((char *)strValue, "Y")    == 0 || ustrcmp((char *)strValue, "TRUE") == 0 || ustrcmp((char *)strValue, "T")    == 0 || ustrcmp((char *)strValue, "ON")   == 0 || ustrcmp((char *)strValue, "1")    == 0)) { *___4315 = ___4226; } else { *___4315 = ___1305; } ENSURE(VALID_BOOLEAN(FoundItem)); ENSURE(VALID_BOOLEAN(*___4315)); return FoundItem; } ___372 ___267(___264    ___230,
char const*   ___2686, ___90    ___4315, AuxDataType_e ___4236, ___372     ___3362) { REQUIRE(VALID_REF(___230)); INVARIANT("AuxData->ItemList is case-insensitive sorted by AuxDataItem->Name"); REQUIRE(VALID_REF(___2686) && ___249(___2686)); REQUIRE(IMPLICATION(___4236 == ___270, (VALID_REF((char *)___4315) || (char *)___4315 == NULL))); REQUIRE(VALID_ENUM(___4236, AuxDataType_e)); REQUIRE(VALID_BOOLEAN(___3362)); AuxDataItem_s* AuxDataItem = AuxDataItemAlloc(___2686, ___4315, ___4236, ___3362); ___372 ___2040 = (AuxDataItem != NULL); if (___2040) { int32_t       ___2096; ArrayListItem_u ListItem; ListItem.___4440 = (void *)AuxDataItem; if (!___246(___230, ___2686, &___2096)) ___2040 = ArrayListInsertItem(___230->ItemList, ___2096, ListItem); else ___2040 = ArrayListSetItem(___230->ItemList, ___2096, ListItem, AuxDataItemListItemDestructor, 0); if (!___2040) AuxDataItemDealloc(&AuxDataItem); } ENSURE(VALID_BOOLEAN(___2040)); INVARIANT("AuxData->ItemList is case-insensitive sorted by AuxDataItem->Name"); return ___2040; } void ___237(___264 ___230, int32_t  ___1926) { REQUIRE(VALID_REF(___230)); REQUIRE(0 <= ___1926 && ___1926 < ___101(___230->ItemList)); ArrayListDeleteItem(___230->ItemList, ___1926, AuxDataItemListItemDestructor, 0); } ___372 ___238(___264 ___230, const char *___2686) { ___372 FoundItem; int32_t ___2096; REQUIRE(VALID_REF(___230)); REQUIRE(VALID_REF(___2686) && ___249(___2686)); FoundItem = ___246(___230, ___2686, &___2096); if (FoundItem) ___237(___230, ___2096); ENSURE(VALID_BOOLEAN(FoundItem)); return FoundItem; } void AuxDataDeleteItems(___264 ___230) { REQUIRE(VALID_REF(___230)); ArrayListDeleteAllItems(___230->ItemList); }
