void displayFolder(HFSCatalogNodeID folderID, Volume* volume) { CatalogRecordList* list; CatalogRecordList* theList; HFSPlusCatalogFolder* folder; HFSPlusCatalogFile* file; theList = list = getFolderContents(folderID, volume); while(list != NULL) { if(list->record->recordType == kHFSPlusFolderRecord) { folder = (HFSPlusCatalogFolder*)list->record; bufferPrintf("%06o ", folder->permissions.fileMode); bufferPrintf("%3d ", folder->permissions.ownerID); bufferPrintf("%3d ", folder->permissions.groupID); bufferPrintf("%12d ", folder->valence); } else if(list->record->recordType == kHFSPlusFileRecord) { file = (HFSPlusCatalogFile*)list->record; bufferPrintf("%06o ", file->permissions.fileMode); bufferPrintf("%3d ", file->permissions.ownerID); bufferPrintf("%3d ", file->permissions.groupID); bufferPrintf("%12Ld ", file->dataFork.logicalSize); } bufferPrintf(" "); printUnicode(&list->name); bufferPrintf("\r\n"); list = list->next; } releaseCatalogRecordList(theList); }
static void attrKeyPrint(BTKey* toPrint) { HFSPlusAttrKey* key; key = (HFSPlusAttrKey*)toPrint; printf("attribute%d:%d:", key->fileID, key->startBlock); printUnicode(&key->name); }
static void catalogKeyPrint(BTKey* toPrint) { HFSPlusCatalogKey* key; key = (HFSPlusCatalogKey*) toPrint; printf("%d:", key->parentID); printUnicode(&key->nodeName); }
void displayFolder(HFSCatalogNodeID folderID, Volume* volume) { CatalogRecordList* list; CatalogRecordList* theList; HFSPlusCatalogFolder* folder; HFSPlusCatalogFile* file; time_t fileTime; struct tm *date; HFSPlusDecmpfs* compressData; size_t attrSize; theList = list = getFolderContents(folderID, volume); while(list != NULL) { if(list->record->recordType == kHFSPlusFolderRecord) { folder = (HFSPlusCatalogFolder*)list->record; printf("%06o ", folder->permissions.fileMode); printf("%3d ", folder->permissions.ownerID); printf("%3d ", folder->permissions.groupID); printf("%12d ", folder->valence); fileTime = APPLE_TO_UNIX_TIME(folder->contentModDate); } else if(list->record->recordType == kHFSPlusFileRecord) { file = (HFSPlusCatalogFile*)list->record; printf("%06o ", file->permissions.fileMode); printf("%3d ", file->permissions.ownerID); printf("%3d ", file->permissions.groupID); if(file->permissions.ownerFlags & UF_COMPRESSED) { attrSize = getAttribute(volume, file->fileID, "com.apple.decmpfs", (uint8_t**)(&compressData)); flipHFSPlusDecmpfs(compressData); printf("%12" PRId64 " ", compressData->size); free(compressData); } else { printf("%12" PRId64 " ", file->dataFork.logicalSize); } fileTime = APPLE_TO_UNIX_TIME(file->contentModDate); } date = localtime(&fileTime); if(date != NULL) { printf("%2d/%2d/%4d %02d:%02d ", date->tm_mon, date->tm_mday, date->tm_year + 1900, date->tm_hour, date->tm_min); } else { printf(" "); } printUnicode(&list->name); printf("\n"); list = list->next; } releaseCatalogRecordList(theList); }
void displayFolder(HFSCatalogNodeID folderID, Volume* volume) { CatalogRecordList* list; CatalogRecordList* theList; HFSPlusCatalogFolder* folder; HFSPlusCatalogFile* file; time_t fileTime; struct tm *date; theList = list = getFolderContents(folderID, volume); while(list != NULL) { if(list->record->recordType == kHFSPlusFolderRecord) { folder = (HFSPlusCatalogFolder*)list->record; printf("%06o ", folder->permissions.fileMode); printf("%3d ", folder->permissions.ownerID); printf("%3d ", folder->permissions.groupID); printf("%12d ", folder->valence); fileTime = APPLE_TO_UNIX_TIME(folder->contentModDate); } else if(list->record->recordType == kHFSPlusFileRecord) { file = (HFSPlusCatalogFile*)list->record; printf("%06o ", file->permissions.fileMode); printf("%3d ", file->permissions.ownerID); printf("%3d ", file->permissions.groupID); printf("%12" PRId64 " ", file->dataFork.logicalSize); fileTime = APPLE_TO_UNIX_TIME(file->contentModDate); } date = localtime(&fileTime); if(date != NULL) { printf("%2d/%2d/%4d %02d:%02d ", date->tm_mon, date->tm_mday, date->tm_year + 1900, date->tm_hour, date->tm_min); } else { printf(" "); } printUnicode(&list->name); printf("\n"); list = list->next; } releaseCatalogRecordList(theList); }
void showInfo() { //StringList show=InitStringList(); int i; Xref xref; for(i=0;i<xrefs->length;i++){ xref=(Xref)GetNodeData(xrefs,i); printf("%d----\n",i+1); printf("XrefOffset: %d\n",xref->xrefOffset); printf("Prev: %d\n",xref->trailer->Prev); printf("XRefStm: %d\n",xref->trailer->XRefStm); } printf( "----\n"); printf("InfoAt: %d\n",InfoAt); printf("%d xrefs\n", xrefs->length); for(i=0;i<xrefs->length;i++){ xref=(Xref)GetNodeData(xrefs,i); printf( "%s\n",xref->trailer->Prototype) ; } printf("PDFInfo:\n"); printf("Title: "); printUnicode(Title); printf("\nAuthor: "); printUnicode(Author); printf("\nSubject: "); printUnicode(Subject); printf("\nKeywords: ");printUnicode(Keywords); printf("\nCreationDate: ");printUnicode(CreationDate); printf("\nModDate: ");printUnicode(ModDate); printf("\nCreator: ");printUnicode(Creator); printf("\nProducer: ");printUnicode(Producer); printf("\nAdditive Attributes:\n"); Attr attr; for(i=0;i<Attrs->length;i++){ attr=(Attr)GetNodeData(Attrs,i); printf("%d\t",i+1); printUnicode(ReadTagString(attr->Name)); printf("\t"); printUnicode(attr->Value); printf("\n"); } if(Tail==0)return; printf("\nTail Attributes:\n"); for(i=0;i<Tails->length;i++){ attr=(Attr)GetNodeData(Tails,i); printf("%d\t",i+1); printUnicode(ReadTagString(attr->Name)); printf("\t"); printUnicode(attr->Value); printf("\n"); } /*return show;*/ }