Chameleon

Chameleon Commit Details

Date:2014-10-23 09:08:52 (4 years 8 months ago)
Author:Chuck Fry
Commit:2453
Parents: 2452
Message:Represent all file system dates as unsigned 32-bit ints
Changes:
M/branches/chucko/i386/libsaio/saio_types.h
M/branches/chucko/i386/libsaio/hfs.h
M/branches/chucko/i386/libsaio/msdos.c
M/branches/chucko/i386/boot2/boot.c
M/branches/chucko/i386/modules/AcpiCodec/acpi_codec.c
M/branches/chucko/i386/libsaio/disk.c
M/branches/chucko/i386/libsaio/msdos.h
M/branches/chucko/i386/boot2/modules.c
M/branches/chucko/i386/libsaio/saio_internal.h
M/branches/chucko/i386/libsaio/sys.c
M/branches/chucko/i386/libsaio/hfs.c
M/branches/chucko/i386/boot2/drivers.c
M/branches/chucko/i386/libsaio/ufs.h

File differences

branches/chucko/i386/libsaio/hfs.c
4545
4646
4747
48
49
48
49
5050
5151
5252
......
6262
6363
6464
65
6665
67
66
67
6868
6969
7070
......
7676
7777
7878
79
80
79
80
8181
8282
83
83
8484
8585
86
86
8787
88
88
8989
90
90
9191
9292
93
93
9494
9595
96
97
96
97
9898
99
100
99
100
101101
102102
103103
......
155155
156156
157157
158
159
158
159
160
161
160162
161163
162164
......
292294
293295
294296
295
297
296298
297299
298300
299
301
302
300303
301304
302305
......
359362
360363
361364
362
365
363366
364367
365368
366
369
370
367371
368372
369373
......
397401
398402
399403
400
401
402
403
404
404405
405
406
407
408
409
406410
407411
408412
409413
410
411414
412415
413416
......
424427
425428
426429
427
430
428431
429432
430
433
434
431435
432436
433437
......
461465
462466
463467
464
465
468
469
466470
467471
468
472
469473
470474
471475
......
479483
480484
481485
482
486
483487
488
484489
485
486
487490
488491
492
489493
490494
491495
492
496
493497
494498
495499
......
517521
518522
519523
520
524
521525
522526
523
527
524528
525529
526530
......
580584
581585
582586
583
587
584588
585589
586
590
591
587592
588593
589594
......
632637
633638
634639
635
640
636641
637642
638
639
640
641
643
644
645
646
647
648
642649
643
644
645
646
647
648
649
650
651
652
653
654
655
656
650657
651
652
653
658
659
660
654661
655
656
662
663
657664
658
659
660
661
665
666
667
668
662669
663
670
664671
665
666
667
668
669
670
671
672
673
674
675
676
672
673
674
675
676
677
678
679
680
681
682
683
677684
678
679
680
681
682
683
684
685
686
687
688
689
690
691
685692
686
693
687694
688
695
689696
690697
691
698
692699
693700
694
695
696
697
701
702
703
704
698705
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
706
707
708
709
710
711
712
713
714
715
716
717
718
719
714720
715
721
716722
717723
718
724
719725
720726
721727
......
737743
738744
739745
740
746
741747
742
748
743749
744750
745
746
751
752
747753
754
748755
749756
750757
......
863870
864871
865872
866
873
867874
868875
869
870
876
871877
872
878
873879
874880
875
881
876882
877883
878884
......
880886
881887
882888
883
884
889
890
885891
886892
887
888
889
890
891
892
893
894
895
896
897
898
893899
894900
895901
......
909915
910916
911917
912
918
913919
914920
915921
......
961967
962968
963969
964
970
965971
966
967
968
972
973
974
969975
970
971
976
977
972978
973
979
974980
975981
976
982
977983
978
979
980
984
985
986
981987
982
983
988
989
984990
985
991
986992
987993
988994
static long long gAllocationOffset;
static long gIsHFSPlus;
static long gCaseSensitive;
static long gBlockSize;
static long gCacheBlockSize;
static u_int32_t gBlockSize;
static u_int32_t gCacheBlockSize;
static char *gBTreeHeaderBuffer;
static BTHeaderRec *gBTHeaders[2];
static char *gHFSMdbVib;
static CICell gCurrentIH;
static long long gAllocationOffset;
static long gIsHFSPlus;
static long gBlockSize;
static long gCaseSensitive;
static long gCacheBlockSize;
static u_int32_t gBlockSize;
static u_int32_t gCacheBlockSize;
static char gBTreeHeaderBuffer[512];
static BTHeaderRec *gBTHeaders[2];
static char gHFSMdbVib[kBlockSize];
#endif /* !__i386__ */
static long ReadFile(void *file, uint64_t *length, void *base, uint64_t offset);
static long GetCatalogEntryInfo(void *entry, long *flags, long *time,
static long ReadFile(void *file, u_int64_t *length, void *base, u_int64_t offset);
static long GetCatalogEntryInfo(void *entry, long *flags, u_int32_t *time,
FinderInfo *finderInfo, long *infoValid);
static long ResolvePathToCatalogEntry(char *filePath, long *flags,
void *entry, long dirID, long long *dirIndex);
void *entry, u_int32_t dirID, long long *dirIndex);
static long GetCatalogEntry(long long *dirIndex, char **name,
long *flags, long *time,
long *flags, u_int32_t *time,
FinderInfo *finderInfo, long *infoValid);
static long ReadCatalogEntry(char *fileName, long dirID, void *entry,
static long ReadCatalogEntry(char *fileName, u_int32_t dirID, void *entry,
long long *dirIndex);
static long ReadExtentsEntry(long fileID, long startBlock, void *entry);
static long ReadExtentsEntry(u_int32_t fileID, long startBlock, void *entry);
static long ReadBTreeEntry(long btree, void *key, char *entry, long long *dirIndex);
static void GetBTreeRecord(long index, char *nodeBuffer, long nodeSize,
static void GetBTreeRecord(u_int16_t index, char *nodeBuffer, u_int16_t nodeSize,
char **key, char **data);
static long ReadExtent(char *extent, uint64_t extentSize, long extentFile,
uint64_t offset, uint64_t size, void *buffer, long cache);
static long ReadExtent(char *extent, u_int64_t extentSize, u_int32_t extentFile,
u_int64_t offset, u_int64_t size, void *buffer, long cache);
static long GetExtentStart(void *extents, long index);
static long GetExtentSize(void *extents, long index);
static u_int32_t GetExtentStart(void *extents, u_int32_t index);
static u_int32_t GetExtentSize(void *extents, u_int32_t index);
static long CompareHFSCatalogKeys(void *key, void *testKey);
static long CompareHFSPlusCatalogKeys(void *key, void *testKey);
long HFSInitPartition(CICell ih)
{
long extentSize, extentFile, nodeSize;
void *extent;
u_int64_t extentSize;
void *extent;
u_int32_t extentFile;
u_int16_t nodeSize;
if (ih == gCurrentIH)
{
return HFSReadFile(ih, filePath, (void *)gFSLoadAddress, 0, 0);
}
long HFSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length)
long HFSReadFile(CICell ih, char * filePath, void *base, u_int64_t offset, u_int64_t length)
{
char entry[512];
char devStr[12];
long dirID, result, flags;
u_int32_t dirID;
long result, flags;
if (HFSInitPartition(ih) == -1)
{
}
long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name,
long * flags, long * time,
long * flags, u_int32_t * time,
FinderInfo * finderInfo, long * infoValid)
{
char entry[512];
long dirID, dirFlags;
u_int32_t dirID;
long dirFlags;
if (HFSInitPartition(ih) == -1) return -1;
void
HFSGetDescription(CICell ih, char *str, long strMaxLen)
{
UInt16 nodeSize;
UInt32 firstLeafNode;
long long dirIndex;
long long dirIndex = 0;
char *name;
long flags, time;
long flags;
u_int32_t firstLeafNode;
u_int32_t time;
u_int16_t nodeSize;
if (HFSInitPartition(ih) == -1) { return; }
/* Fill some crucial data structures by side effect. */
dirIndex = 0;
HFSGetDirEntry(ih, "/", &dirIndex, &name, &flags, &time, 0, 0);
/* Now we can loook up the volume name node. */
long
HFSGetFileBlock(CICell ih, char *filePath, unsigned long long *firstBlock)
HFSGetFileBlock(CICell ih, char *filePath, u_int64_t *firstBlock)
{
char entry[512];
long dirID, result, flags;
long result, flags;
u_int32_t dirID;
void *extents;
HFSCatalogFile *hfsFile = (void *)entry;
HFSPlusCatalogFile *hfsPlusFile = (void *)entry;
}
#if DEBUG
printf("extent start 0x%x\n", (unsigned long)GetExtentStart(extents, 0));
printf("block size 0x%x\n", (unsigned long)gBlockSize);
printf("extent start 0x%x\n", GetExtentStart(extents, 0));
printf("block size 0x%x\n", gBlockSize);
printf("Allocation offset 0x%x\n", (unsigned long)gAllocationOffset);
#endif
*firstBlock = ((unsigned long long)GetExtentStart(extents, 0) * (unsigned long long) gBlockSize + gAllocationOffset) / 512ULL;
*firstBlock = ((u_int64_t) GetExtentStart(extents, 0) * (u_int64_t) gBlockSize + gAllocationOffset) / 512ULL;
return 0;
}
// Private Functions
static long ReadFile(void * file, uint64_t * length, void * base, uint64_t offset)
static long ReadFile(void * file, u_int64_t * length, void * base, u_int64_t offset)
{
u_int64_t fileLength;
void *extents;
long fileID;
uint64_t fileLength;
HFSCatalogFile *hfsFile = file;
HFSPlusCatalogFile *hfsPlusFile = file;
u_int32_t fileID;
if (gIsHFSPlus) {
fileID = SWAP_BE32(hfsPlusFile->fileID);
fileLength = (uint64_t)SWAP_BE64(hfsPlusFile->dataFork.logicalSize);
fileLength = (u_int64_t)SWAP_BE64(hfsPlusFile->dataFork.logicalSize);
extents = &hfsPlusFile->dataFork.extents;
} else {
fileID = SWAP_BE32(hfsFile->fileID);
return 0;
}
static long GetCatalogEntryInfo(void * entry, long * flags, long * time,
static long GetCatalogEntryInfo(void * entry, long * flags, u_int32_t * time,
FinderInfo * finderInfo, long * infoValid)
{
long tmpTime = 0;
u_int32_t tmpTime = 0;
long valid = 0;
// Get information about the file.
}
static long ResolvePathToCatalogEntry(char * filePath, long * flags,
void * entry, long dirID, long long * dirIndex)
void * entry, u_int32_t dirID, long long * dirIndex)
{
char *restPath;
long result, cnt, subFolderID = 0;
long result, cnt;
u_int32_t subFolderID = 0;
long long tmpDirIndex;
HFSPlusCatalogFile *hfsPlusFile;
}
static long GetCatalogEntry(long long * dirIndex, char ** name,
long * flags, long * time,
long * flags, u_int32_t * time,
FinderInfo * finderInfo, long * infoValid)
{
long extentSize, nodeSize, curNode, index;
void *extent;
char *nodeBuf, *testKey, *entry;
BTNodeDescriptor *node;
u_int64_t extentSize;
void *extent;
char *nodeBuf, *testKey, *entry;
BTNodeDescriptor *node;
u_int32_t curNode;
u_int16_t nodeSize, index;
if (gIsHFSPlus) {
extent = &gHFSPlus->catalogFile.extents;
extentSize = SWAP_BE64(gHFSPlus->catalogFile.logicalSize);
} else {
extent = (HFSExtentDescriptor *)&gHFSMDB->drCTExtRec;
extentSize = SWAP_BE32(gHFSMDB->drCTFlSize);
}
if (gIsHFSPlus) {
extent = &gHFSPlus->catalogFile.extents;
extentSize = SWAP_BE64(gHFSPlus->catalogFile.logicalSize);
} else {
extent = (HFSExtentDescriptor *)&gHFSMDB->drCTExtRec;
extentSize = SWAP_BE32(gHFSMDB->drCTFlSize);
}
nodeSize = SWAP_BE16(gBTHeaders[kBTreeCatalog]->nodeSize);
nodeBuf = (char *)malloc(nodeSize);
node = (BTNodeDescriptor *)nodeBuf;
nodeSize = SWAP_BE16(gBTHeaders[kBTreeCatalog]->nodeSize);
nodeBuf = (char *)malloc(nodeSize);
node = (BTNodeDescriptor *)nodeBuf;
index = (long) (*dirIndex % nodeSize);
curNode = (long) (*dirIndex / nodeSize);
index = (u_int16_t) (*dirIndex % nodeSize);
curNode = (u_int32_t) (*dirIndex / nodeSize);
// Read the BTree node and get the record for index.
ReadExtent(extent, extentSize, kHFSCatalogFileID,
(long long) curNode * nodeSize, nodeSize, nodeBuf, 1);
GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &entry);
// Read the BTree node and get the record for index.
ReadExtent(extent, extentSize, kHFSCatalogFileID,
(long long) curNode * nodeSize, nodeSize, nodeBuf, 1);
GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &entry);
GetCatalogEntryInfo(entry, flags, time, finderInfo, infoValid);
GetCatalogEntryInfo(entry, flags, time, finderInfo, infoValid);
// Get the file name.
if (gIsHFSPlus) {
utf_encodestr(((HFSPlusCatalogKey *)testKey)->nodeName.unicode,
SWAP_BE16(((HFSPlusCatalogKey *)testKey)->nodeName.length),
(u_int8_t *)gTempStr, 256, OSBigEndian);
} else {
strncpy(gTempStr,
(const char *)&((HFSCatalogKey *)testKey)->nodeName[1],
((HFSCatalogKey *)testKey)->nodeName[0]);
gTempStr[((HFSCatalogKey *)testKey)->nodeName[0]] = '\0';
}
*name = gTempStr;
// Get the file name.
if (gIsHFSPlus) {
utf_encodestr(((HFSPlusCatalogKey *)testKey)->nodeName.unicode,
SWAP_BE16(((HFSPlusCatalogKey *)testKey)->nodeName.length),
(u_int8_t *)gTempStr, 256, OSBigEndian);
} else {
strncpy(gTempStr,
(const char *)&((HFSCatalogKey *)testKey)->nodeName[1],
((HFSCatalogKey *)testKey)->nodeName[0]);
gTempStr[((HFSCatalogKey *)testKey)->nodeName[0]] = '\0';
}
*name = gTempStr;
// Update dirIndex.
index++;
if (index == SWAP_BE16(node->numRecords)) {
index = 0;
curNode = SWAP_BE32(node->fLink);
}
*dirIndex = (long long) curNode * nodeSize + index;
// Update dirIndex.
index++;
if (index == SWAP_BE16(node->numRecords)) {
index = 0;
curNode = SWAP_BE32(node->fLink);
}
*dirIndex = (long long) curNode * nodeSize + index;
free(nodeBuf);
free(nodeBuf);
return 0;
return 0;
}
static long ReadCatalogEntry(char * fileName, long dirID,
static long ReadCatalogEntry(char * fileName, u_int32_t dirID,
void * entry, long long * dirIndex)
{
long length;
char key[sizeof(HFSPlusCatalogKey)];
HFSCatalogKey *hfsKey = (HFSCatalogKey *)key;
HFSPlusCatalogKey *hfsPlusKey = (HFSPlusCatalogKey *)key;
long length = strlen(fileName);
char key[sizeof(HFSPlusCatalogKey)];
HFSCatalogKey *hfsKey = (HFSCatalogKey *)key;
HFSPlusCatalogKey *hfsPlusKey = (HFSPlusCatalogKey *)key;
// Make the catalog key.
if ( gIsHFSPlus )
{
hfsPlusKey->parentID = SWAP_BE32(dirID);
length = strlen(fileName);
if (length > 255) length = 255;
utf_decodestr((u_int8_t *)fileName, hfsPlusKey->nodeName.unicode,
&(hfsPlusKey->nodeName.length), 512, OSBigEndian);
} else {
hfsKey->parentID = SWAP_BE32(dirID);
length = strlen(fileName);
if (length > 31) length = 31;
hfsKey->nodeName[0] = length;
strncpy((char *)(hfsKey->nodeName + 1), fileName, length);
}
// Make the catalog key.
if ( gIsHFSPlus ) {
if (length > kHFSPlusMaxFileNameChars)
length = kHFSPlusMaxFileNameChars;
hfsPlusKey->parentID = SWAP_BE32(dirID);
utf_decodestr((u_int8_t *)fileName, hfsPlusKey->nodeName.unicode,
&(hfsPlusKey->nodeName.length), 512, OSBigEndian);
} else {
if (length > kHFSMaxFileNameChars)
length = kHFSMaxFileNameChars;
hfsKey->parentID = SWAP_BE32(dirID);
hfsKey->nodeName[0] = length;
strncpy((char *)(hfsKey->nodeName + 1), fileName, length);
}
return ReadBTreeEntry(kBTreeCatalog, &key, entry, dirIndex);
return ReadBTreeEntry(kBTreeCatalog, &key, entry, dirIndex);
}
static long ReadExtentsEntry(long fileID, long startBlock, void * entry)
static long ReadExtentsEntry(u_int32_t fileID, long startBlock, void * entry)
{
char key[sizeof(HFSPlusExtentKey)];
HFSExtentKey *hfsKey = (HFSExtentKey *)key;
static long ReadBTreeEntry(long btree, void * key, char * entry, long long * dirIndex)
{
long extentSize;
u_int64_t extentSize;
void *extent;
short extentFile;
u_int16_t extentFile;
char *nodeBuf;
BTNodeDescriptor *node;
long nodeSize, result = 0, entrySize = 0;
long curNode, index = 0, lowerBound, upperBound;
long result = 0, entrySize = 0;
u_int32_t curNode;
char *testKey, *recordData;
u_int16_t nodeSize, index = 0, lowerBound, upperBound;
// Figure out which tree is being looked at.
if (btree == kBTreeCatalog) {
return 0;
}
static void GetBTreeRecord(long index, char * nodeBuffer, long nodeSize,
static void GetBTreeRecord(u_int16_t index, char * nodeBuffer, u_int16_t nodeSize,
char ** key, char ** data)
{
long keySize;
long recordOffset;
u_int16_t recordOffset, keySize;
recordOffset = SWAP_BE16(*((short *)(nodeBuffer + (nodeSize - 2 * index - 2))));
recordOffset = SWAP_BE16(*((u_int16_t *)(nodeBuffer + (nodeSize - 2 * index - 2))));
*key = nodeBuffer + recordOffset;
if (gIsHFSPlus) {
keySize = SWAP_BE16(*(short *)*key);
keySize = SWAP_BE16(*(u_int16_t *)*key);
*data = *key + 2 + keySize;
} else {
keySize = **key;
}
}
static long ReadExtent(char * extent, uint64_t extentSize,
long extentFile, uint64_t offset, uint64_t size,
static long ReadExtent(char * extent, u_int64_t extentSize,
u_int32_t extentFile, u_int64_t offset, u_int64_t size,
void * buffer, long cache)
{
uint64_t lastOffset;
long long blockNumber, countedBlocks = 0;
long long nextExtent = 0, sizeRead = 0, readSize;
long long nextExtentBlock, currentExtentBlock = 0;
long long readOffset;
long long extentDensity, sizeofExtent, currentExtentSize;
u_int64_t lastOffset;
u_int64_t blockNumber, countedBlocks = 0;
u_int64_t nextExtent = 0, sizeRead = 0, readSize;
u_int64_t nextExtentBlock, currentExtentBlock = 0;
u_int64_t readOffset;
u_int64_t extentDensity, sizeofExtent, currentExtentSize;
char *currentExtent, *extentBuffer = 0, *bufferPos = buffer;
if (offset >= extentSize) return 0;
// Find the extent for the offset.
for (; ; nextExtent++) {
if (nextExtent < extentDensity) {
if ((countedBlocks+GetExtentSize(extent, nextExtent)-1)<blockNumber) {
if ((countedBlocks + GetExtentSize(extent, nextExtent) - 1) < blockNumber) {
countedBlocks += GetExtentSize(extent, nextExtent);
continue;
}
return sizeRead;
}
static long GetExtentStart(void * extents, long index)
static u_int32_t GetExtentStart(void * extents, u_int32_t index)
{
long start;
HFSExtentDescriptor *hfsExtents = extents;
HFSPlusExtentDescriptor *hfsPlusExtents = extents;
u_int32_t start;
HFSExtentDescriptor *hfsExtents = extents;
HFSPlusExtentDescriptor *hfsPlusExtents = extents;
if (gIsHFSPlus) start = SWAP_BE32(hfsPlusExtents[index].startBlock);
else start = SWAP_BE16(hfsExtents[index].startBlock);
if (gIsHFSPlus) start = SWAP_BE32(hfsPlusExtents[index].startBlock);
else start = SWAP_BE16(hfsExtents[index].startBlock);
return start;
return start;
}
static long GetExtentSize(void * extents, long index)
static u_int32_t GetExtentSize(void * extents, u_int32_t index)
{
long size;
HFSExtentDescriptor *hfsExtents = extents;
HFSPlusExtentDescriptor *hfsPlusExtents = extents;
u_int32_t size;
HFSExtentDescriptor *hfsExtents = extents;
HFSPlusExtentDescriptor *hfsPlusExtents = extents;
if (gIsHFSPlus) size = SWAP_BE32(hfsPlusExtents[index].blockCount);
else size = SWAP_BE16(hfsExtents[index].blockCount);
if (gIsHFSPlus) size = SWAP_BE32(hfsPlusExtents[index].blockCount);
else size = SWAP_BE16(hfsExtents[index].blockCount);
return size;
return size;
}
static long CompareHFSCatalogKeys(void * key, void * testKey)
branches/chucko/i386/libsaio/hfs.h
2020
2121
2222
23
24
2325
2426
25
27
2628
27
29
2830
2931
30
32
3133
3234
3335
* @APPLE_LICENSE_HEADER_END@
*/
#include <sys/types.h>
extern long HFSInitPartition(CICell ih);
extern long HFSLoadFile(CICell ih, char * filePath);
extern long HFSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length);
extern long HFSReadFile(CICell ih, char * filePath, void *base, u_int64_t offset, u_int64_t length);
extern long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
char ** name, long * flags, u_int32_t * time,
FinderInfo * finderInfo, long * infoValid);
extern void HFSGetDescription(CICell ih, char *str, long strMaxLen);
extern long HFSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock);
extern long HFSGetFileBlock(CICell ih, char *str, u_int64_t *firstBlock);
extern long HFSGetUUID(CICell ih, char *uuidStr);
extern void HFSFree(CICell ih);
extern bool HFSProbe (const void *buf);
branches/chucko/i386/libsaio/ufs.h
2424
2525
2626
27
27
2828
2929
3030
extern long UFSLoadFile(CICell ih, char * filePath);
extern long UFSReadFile( CICell ih, char * filePath, void * base, uint64_t offset, uint64_t length );
extern long UFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
char ** name, long * flags, u_int32_t * time,
FinderInfo * finderInfo, long * infoValid);
extern void UFSGetDescription(CICell ih, char *str, long strMaxLen);
extern long UFSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock);
branches/chucko/i386/libsaio/sys.c
343343
344344
345345
346
346
347347
348348
349349
......
369369
370370
371371
372
372
373373
374374
375375
......
795795
796796
797797
798
798
799799
800800
801801
......
806806
807807
808808
809
809
810810
811811
812812
// Fetch the next directory entry for the given directory.
long GetDirEntry(const char * dirSpec, long long * dirIndex, const char ** name,
long * flags, long * time)
long * flags, u_int32_t * time)
{
const char * dirPath;
BVRef bvr;
static char* gMakeDirSpec;
long GetFileInfo(const char * dirSpec, const char * name,
long * flags, long * time)
long * flags, u_int32_t * time)
{
long long index = 0;
const char * entryName;
//==========================================================================
int readdir(struct dirstuff * dirp, const char ** name, long * flags,
long * time)
u_int32_t * time)
{
return dirp->dir_bvr->fs_getdirentry(dirp->dir_bvr,
/* dirPath */ dirp->dir_path,
//==========================================================================
int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags,
long * time, FinderInfo *finderInfo, long *infoValid)
u_int32_t * time, FinderInfo *finderInfo, long *infoValid)
{
return dirp->dir_bvr->fs_getdirentry( dirp->dir_bvr,
/* dirPath */ dirp->dir_path,
branches/chucko/i386/libsaio/disk.c
16111611
16121612
16131613
1614
1614
1615
16151616
16161617
16171618
char dirSpec[512], fileSpec[512];
char label[BVSTRLEN];
int ret;
long flags, time;
long flags;
u_int32_t time;
int fh, fileSize, error;
for (bvr = chain; bvr; bvr = bvr->next) {
branches/chucko/i386/libsaio/saio_types.h
143143
144144
145145
146
146
147147
148148
149149
typedef long (*FSReadFile)(CICell ih, char *filePath, void *base, uint64_t offset, uint64_t length);
typedef long (*FSGetFileBlock)(CICell ih, char *filePath, unsigned long long *firstBlock);
typedef long (*FSGetDirEntry)(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
char ** name, long * flags, u_int32_t * time,
FinderInfo * finderInfo, long * infoValid);
typedef long (*FSGetUUID)(CICell ih, char *uuidStr);
typedef void (*BVGetDescription)(CICell ih, char * str, long strMaxLen);
branches/chucko/i386/libsaio/msdos.c
648648
649649
650650
651
651
652652
653653
654654
}
long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
char ** name, long * flags, u_int32_t * time,
FinderInfo * finderInfo, long * infoValid)
{
struct msdosdirstate *st;
branches/chucko/i386/libsaio/msdos.h
2525
2626
2727
28
28
2929
3030
3131
extern long MSDOSLoadFile(CICell ih, char * filePath);
extern long MSDOSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length);
extern long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
char ** name, long * flags, u_int32_t * time,
FinderInfo * finderInfo, long * infoValid);
extern long MSDOSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock);
extern long MSDOSGetUUID(CICell ih, char *uuidStr);
branches/chucko/i386/libsaio/saio_internal.h
175175
176176
177177
178
178
179179
180
180
181181
182182
183183
......
196196
197197
198198
199
199
200200
201
201
202202
203203
204204
extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length);
extern long LoadThinFatFile(const char *fileSpec, void **binary);
extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name,
long *flags, long *time);
long *flags, u_int32_t *time);
extern long GetFileInfo(const char *dirSpec, const char *name,
long *flags, long *time);
long *flags, u_int32_t *time);
extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock);
extern long GetFSUUID(char *spec, char *uuidStr);
extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr);
extern struct dirstuff * opendir(const char *path);
extern struct dirstuff * vol_opendir(BVRef bvr, const char *path);
extern int closedir(struct dirstuff *dirp);
extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time);
extern int readdir(struct dirstuff *dirp, const char **name, long *flags, u_int32_t *time);
extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags,
long * time, FinderInfo *finderInfo, long *infoValid);
u_int32_t * time, FinderInfo *finderInfo, long *infoValid);
extern void flushdev(void);
extern void scanBootVolumes(int biosdev, int *count);
extern void scanDisks(int biosdev, int *count);
branches/chucko/i386/boot2/drivers.c
271271
272272
273273
274
274
275
275276
276277
277278
......
302303
303304
304305
305
306306
307
307308
309
308310
309311
310312
static long
FileLoadMKext( const char * dirSpec, const char * extDirSpec )
{
longret, flags, time, time2;
long ret, flags;
u_int32_t time, time2;
charaltDirSpec[512];
snprintf(altDirSpec, sizeof(altDirSpec), "%s%s", dirSpec, extDirSpec);
long
FileLoadDrivers( char * dirSpec, long plugin )
{
long ret, length, flags, time, bundleType;
long long index;
long ret, length, flags, bundleType;
long result = -1;
u_int32_t time;
const char * name;
if ( !plugin )
branches/chucko/i386/boot2/boot.c
239239
240240
241241
242
242
243243
244
244245
245246
246247
......
264265
265266
266267
267
268
268
269
269270
270271
271272
......
501502
502503
503504
504
505
506
505507
506508
507509
{
charkernelCacheFile[512];
charkernelCachePath[512];
longflags, time, cachetime, kerneltime, exttime, ret=-1;
longflags, ret=-1;
unsigned long adler32;
u_int32_t time, cachetime, kerneltime, exttime;
if((gBootMode & kBootModeSafe) != 0) {
DBG("Kernel Cache ignored.\n");
(archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64");
intlnam = strlen(kernelCacheFile) + 9; //with adler32
char*name;
longprev_time = 0;
char *name;
u_int32_t prev_time = 0;
structdirstuff* cacheDir = opendir(kDefaultCachePathSnow);
booluseKernelCache = true; // by default try to use the prelinked kernel
const char*val;
intlen, ret = -1;
longflags, sleeptime, time;
longflags;
u_int32_t sleeptime, time;
void*binary = (void *)kLoadAddr;
char bootFile[sizeof(bootInfo->bootFile)];
branches/chucko/i386/boot2/modules.c
103103
104104
105105
106
106
107107
108108
109109
{
char* name;
long flags;
long time;
u_int32_t time;
struct dirstuff* moduleDir = opendir("/Extra/modules/");
while (readdir(moduleDir, (const char**)&name, &flags, &time) >= 0) {
if(strcmp(&name[strlen(name) - sizeof("dylib")], ".dylib") == 0) {
branches/chucko/i386/modules/AcpiCodec/acpi_codec.c
47414741
47424742
47434743
4744
47454744
4745
4746
47464747
47474748
47484749
}
{
long ret, length, flags, time;
long long index = 0;
long ret, length, flags;
u_int32_t time;
const char * name;
U8 i = 0;

Archive Download the corresponding diff file

Revision: 2453