void parcSortedList_Display(const PARCSortedList *instance, int indentation) { parcDisplayIndented_PrintLine(indentation, "PARCSortedList@%p {", instance); parcLinkedList_Display(instance->list, indentation + 1); parcDisplayIndented_PrintLine(indentation, "}"); }
void parcStopwatch_Display(const PARCStopwatch *instance, int indentation) { parcDisplayIndented_PrintLine(indentation, "PARCStopwatch@%p {", instance); /* Call Display() functions for the fields here. */ parcDisplayIndented_PrintLine(indentation, "}"); }
void parcJSONValue_Display(const PARCJSONValue *value, int indentation) { parcDisplayIndented_PrintLine(indentation, "PARCJSONValue@%p {", value); if (value != NULL) { parcDisplayIndented_PrintLine(indentation + 1, ".type=%d", value->type); switch (value->type) { case PARCJSONValueType_Boolean: _displayBoolean(value, indentation + 1); break; case PARCJSONValueType_String: parcBuffer_Display(value->value.string, indentation + 1); break; case PARCJSONValueType_Number: _displayNumber(value, indentation + 1); break; case PARCJSONValueType_Array: parcJSONArray_Display(value->value.array, indentation + 1); break; case PARCJSONValueType_JSON: parcJSON_Display(value->value.object, indentation + 1); break; case PARCJSONValueType_Null: parcDisplayIndented_PrintLine(indentation + 1, ".value=null"); break; default: trapIllegalValue(value->type, "Unknown PARCJSONValue type %d", value->type); } } parcDisplayIndented_PrintLine(indentation, "}"); }
void parcTimer_Display(const PARCTimer *instance, int indentation) { parcDisplayIndented_PrintLine(indentation, "PARCTimer@%p {", instance); /* Call Display() functions for the fields here. */ parcDisplayIndented_PrintLine(indentation, "}"); }
void parcScheduledTask_Display(const PARCScheduledTask *instance, int indentation) { parcDisplayIndented_PrintLine(indentation, "PARCScheduledTask@%p {", instance); /* Call Display() functions for the fields here. */ parcDisplayIndented_PrintLine(indentation, "}"); }
static void _athenaLRUContentStoreEntry_Display(const _AthenaLRUContentStoreEntry *entry, int indentation) { CCNxName *name = ccnxContentObject_GetName(entry->contentObject); char *nameString = ccnxName_ToString(name); int childIndentation = indentation + 2; //strlen("AthenaLRUContentStoreEntry"); parcDisplayIndented_PrintLine(indentation, "AthenaLRUContentStoreEntry {%p, prev = %p, next = %p, co = %p, size = %zu", entry, entry->prev, entry->next, entry->contentObject, entry->sizeInBytes); parcDisplayIndented_PrintLine(childIndentation, "Name: %p [%s]", name, nameString); if (entry->hasExpiryTime) { parcDisplayIndented_PrintLine(childIndentation, "ExpiryTime: [%" PRIu64 "]", entry->expiryTime); } if (entry->hasRecommendedCacheTime) { parcDisplayIndented_PrintLine(childIndentation, "RecommendedCacheTime: [%" PRIu64 "]", entry->recommendedCacheTime); } parcDisplayIndented_PrintLine(childIndentation, "}"); parcMemory_Deallocate(&nameString); }
void parcLock_Display(const PARCLock *lock, int indentation) { parcDisplayIndented_PrintLine(indentation, "PARCLock@%p {", lock); parcDisplayIndented_PrintLine(indentation + 1, ".locked=%s", lock->locked ? "true" : "false"); parcDisplayIndented_PrintLine(indentation, "}"); }
void ccnxNameSegment_Display(const CCNxNameSegment *segment, int indentation) { parcDisplayIndented_PrintLine(indentation, "CCNxNameSegment@%p {", segment); parcDisplayIndented_PrintLine(indentation + 1, "type=%d", segment->type); parcBuffer_Display(segment->value, indentation + 1); parcDisplayIndented_PrintLine(indentation, "}"); }
void ccnxPortalAnchor_Display(const CCNxPortalAnchor *anchor, int indentation) { char *prefix = ccnxName_ToString(anchor->prefix); parcDisplayIndented_PrintLine(indentation, "CCNxPortalAnchor@%p {", anchor); parcDisplayIndented_PrintLine(indentation+1, ".prefix=%s}", prefix); parcDisplayIndented_PrintLine(indentation+1, ".expireTime=%ld", anchor->expireTime); /* Call Display() functions for the fields here. */ parcDisplayIndented_PrintLine(indentation, "}"); parcMemory_Deallocate(&prefix); }
void parcBuffer_Display(const PARCBuffer *buffer, int indentation) { if (buffer == NULL) { parcDisplayIndented_PrintLine(indentation, "PARCBuffer@NULL"); } else { parcDisplayIndented_PrintLine(indentation, "PARCBuffer@%p {", (void *) buffer); parcDisplayIndented_PrintLine(indentation + 1, ".arrayOffset=%zd .position=%zd .limit=%zd .mark=%zd", buffer->arrayOffset, buffer->position, buffer->limit, buffer->mark); parcByteArray_Display(buffer->array, indentation + 1); parcDisplayIndented_PrintLine(indentation, "}"); } }
static void _displayNumber(const PARCJSONValue *value, int indentation) { if (value->value.number.internalDoubleRepresentation) { parcDisplayIndented_PrintLine(indentation, ".value=%Lf", value->value.number.internalDoubleValue); } else { parcDisplayIndented_PrintLine(indentation, ".value.number={ sign=%d whole=%lld fractionLog10=%d fraction=%lld exponent=%lld", value->value.number.sign, value->value.number.whole, (int) value->value.number.fractionLog10, value->value.number.fraction, value->value.number.exponent); } }
void parcBasicStats_Display(const PARCBasicStats *stats, int indentation) { parcDisplayIndented_PrintLine(indentation, "PARCBasicStats@%p { .count=%" PRId64 " .minimum=%llf .maximum=%llf .mean=%llf }", stats, stats->count, stats->minimum, stats->maximum, stats->mean); }
void parcHashMap_Display(const PARCHashMap *hashMap, int indentation) { parcDisplayIndented_PrintLine(indentation, "PARCHashMap@%p {", hashMap); PARCIterator *iterator = parcHashMap_CreateKeyIterator((PARCHashMap *) hashMap); while (parcIterator_HasNext(iterator)) { PARCObject *keyObject = parcIterator_Next(iterator); const PARCObject *valueObject = parcHashMap_Get(hashMap, keyObject); char *key = parcObject_ToString(keyObject); char *value = parcObject_ToString(valueObject); parcDisplayIndented_PrintLine(indentation + 1, "%s -> %s", key, value); parcMemory_Deallocate(&key); parcMemory_Deallocate(&value); } parcIterator_Release(&iterator); parcDisplayIndented_PrintLine(indentation, "}"); }
void athenaLRUContentStore_Display(const AthenaContentStoreImplementation *store, int indentation) { AthenaLRUContentStore *impl = (AthenaLRUContentStore *) store; parcDisplayIndented_PrintLine(indentation, "AthenaLRUContentStore @ %p {", impl); parcDisplayIndented_PrintLine(indentation + 4, "maxSizeInBytes = %zu", impl->maxSizeInBytes); parcDisplayIndented_PrintLine(indentation + 4, "sizeInBytes = %zu", impl->currentSizeInBytes); parcDisplayIndented_PrintLine(indentation + 4, "numEntriesInStore = %zu", impl->numEntries); parcDisplayIndented_PrintLine(indentation + 4, "numEntriesInNameIndex = %zu", parcHashMap_Size(impl->tableByName)); parcDisplayIndented_PrintLine(indentation + 4, "numEntriesInName+KeyIndex = %zu", parcHashMap_Size(impl->tableByNameAndKeyId)); parcDisplayIndented_PrintLine(indentation + 4, "numEntriesInName+HashIndex = %zu", parcHashMap_Size(impl->tableByNameAndObjectHash)); parcDisplayIndented_PrintLine(indentation + 4, "LRU = {"); _AthenaLRUContentStoreEntry *entry = impl->lruHead; // Dump entries, head to tail while (entry) { _athenaLRUContentStoreEntry_Display(entry, indentation + 8); entry = entry->next; } parcDisplayIndented_PrintLine(indentation + 4, "}"); parcDisplayIndented_PrintLine(indentation, "}"); }
static void _displayBoolean(const PARCJSONValue *value, int indentation) { parcDisplayIndented_PrintLine(indentation, ".value=%s", value->value.boolean == true ? "true" : "false"); }