Chameleon

Chameleon Commit Details

Date:2010-05-12 16:19:38 (13 years 11 months ago)
Author:Tamás Kosárszky
Commit:151
Parents: 150
Message:Applied easternguy's (long long) cast changes for filesystem functions.
Changes:
M/trunk/i386/boot2/drivers.c
M/trunk/i386/libsaio/ufs.h
M/trunk/i386/libsaio/saio_types.h
M/trunk/i386/libsaio/hfs.h
M/trunk/i386/libsaio/msdos.c
M/trunk/i386/libsaio/msdos.h
M/trunk/i386/libsaio/saio_internal.h
M/trunk/i386/libsaio/ufs.c
M/trunk/i386/libsaio/sys.c
M/trunk/i386/libsaio/nbp.c
M/trunk/i386/libsaio/hfs.c

File differences

trunk/i386/libsaio/hfs.c
8080
8181
8282
83
83
8484
85
85
8686
8787
8888
89
89
9090
9191
92
92
9393
9494
9595
......
304304
305305
306306
307
307
308308
309309
310310
......
346346
347347
348348
349
349
350350
351351
352352
......
360360
361361
362362
363
363
364364
365365
366366
......
526526
527527
528528
529
529
530530
531531
532
532
533
533534
534535
535536
......
576577
577578
578579
579
580
580581
581582
582583
......
597598
598599
599600
600
601
601
602
602603
603604
604605
605
606
606607
607608
608609
......
626627
627628
628629
629
630
630631
631632
632633
......
634635
635636
636637
637
638
638639
639640
640641
......
680681
681682
682683
683
684
684685
685686
686687
......
732733
733734
734735
735
736
736737
737738
738739
......
800801
801802
802803
803
804
804805
805806
806807
static long GetCatalogEntryInfo(void *entry, long *flags, long *time,
FinderInfo *finderInfo, long *infoValid);
static long ResolvePathToCatalogEntry(char *filePath, long *flags,
void *entry, long dirID, long *dirIndex);
void *entry, long dirID, long long *dirIndex);
static long GetCatalogEntry(long *dirIndex, char **name,
static long GetCatalogEntry(long long *dirIndex, char **name,
long *flags, long *time,
FinderInfo *finderInfo, long *infoValid);
static long ReadCatalogEntry(char *fileName, long dirID, void *entry,
long *dirIndex);
long long *dirIndex);
static long ReadExtentsEntry(long fileID, long startBlock, void *entry);
static long ReadBTreeEntry(long btree, void *key, char *entry, long *dirIndex);
static long ReadBTreeEntry(long btree, void *key, char *entry, long long *dirIndex);
static void GetBTreeRecord(long index, char *nodeBuffer, long nodeSize,
char **key, char **data);
return length;
}
long HFSGetDirEntry(CICell ih, char * dirPath, long * dirIndex, char ** name,
long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name,
long * flags, long * time,
FinderInfo * finderInfo, long * infoValid)
{
UInt16 nodeSize;
UInt32 firstLeafNode;
long dirIndex;
long long dirIndex;
char *name;
long flags, time;
nodeSize = SWAP_BE16(gBTHeaders[kBTreeCatalog]->nodeSize);
firstLeafNode = SWAP_BE32(gBTHeaders[kBTreeCatalog]->firstLeafNode);
dirIndex = firstLeafNode * nodeSize;
dirIndex = (long long) firstLeafNode * nodeSize;
GetCatalogEntry(&dirIndex, &name, &flags, &time, 0, 0);
}
static long ResolvePathToCatalogEntry(char * filePath, long * flags,
void * entry, long dirID, long * dirIndex)
void * entry, long dirID, long long * dirIndex)
{
char *restPath;
long result, cnt, subFolderID = 0, tmpDirIndex;
long result, cnt, subFolderID = 0;
long long tmpDirIndex;
HFSPlusCatalogFile *hfsPlusFile;
// Copy the file name to gTempStr
return result;
}
static long GetCatalogEntry(long * dirIndex, char ** name,
static long GetCatalogEntry(long long * dirIndex, char ** name,
long * flags, long * time,
FinderInfo * finderInfo, long * infoValid)
{
nodeBuf = (char *)malloc(nodeSize);
node = (BTNodeDescriptor *)nodeBuf;
index = *dirIndex % nodeSize;
curNode = *dirIndex / nodeSize;
index = (long) (*dirIndex % nodeSize);
curNode = (long) (*dirIndex / nodeSize);
// Read the BTree node and get the record for index.
ReadExtent(extent, extentSize, kHFSCatalogFileID,
(long long)curNode * nodeSize, nodeSize, nodeBuf, 1);
(long long) curNode * nodeSize, nodeSize, nodeBuf, 1);
GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &entry);
GetCatalogEntryInfo(entry, flags, time, finderInfo, infoValid);
index = 0;
curNode = SWAP_BE32(node->fLink);
}
*dirIndex = curNode * nodeSize + index;
*dirIndex = (long long) curNode * nodeSize + index;
free(nodeBuf);
}
static long ReadCatalogEntry(char * fileName, long dirID,
void * entry, long * dirIndex)
void * entry, long long * dirIndex)
{
long length;
char key[sizeof(HFSPlusCatalogKey)];
return ReadBTreeEntry(kBTreeExtents, &key, entry, 0);
}
static long ReadBTreeEntry(long btree, void * key, char * entry, long * dirIndex)
static long ReadBTreeEntry(long btree, void * key, char * entry, long long * dirIndex)
{
long extentSize;
void *extent;
while (1) {
// Read the current node.
ReadExtent(extent, extentSize, extentFile,
(long long)curNode * nodeSize, nodeSize, nodeBuf, 1);
(long long) curNode * nodeSize, nodeSize, nodeBuf, 1);
// Find the matching key.
lowerBound = 0;
index = 0;
curNode = SWAP_BE32(node->fLink);
}
*dirIndex = curNode * nodeSize + index;
*dirIndex = (long long) curNode * nodeSize + index;
}
free(nodeBuf);
trunk/i386/libsaio/hfs.h
2323
2424
2525
26
26
2727
2828
2929
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 HFSGetDirEntry(CICell ih, char * dirPath, long * dirIndex,
extern long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
FinderInfo * finderInfo, long * infoValid);
extern void HFSGetDescription(CICell ih, char *str, long strMaxLen);
trunk/i386/libsaio/ufs.c
4646
4747
4848
49
49
5050
5151
5252
......
223223
224224
225225
226
226
227227
228228
229229
......
383383
384384
385385
386
386
387387
388388
389389
390
390
391391
392392
393393
394394
395395
396
397
396
397
398398
399399
400400
......
418418
419419
420420
421
421
422
422423
423424
424425
static long ResolvePathToInode(char *filePath, long *flags,
InodePtr fileInode, InodePtr dirInode);
static long ReadDirEntry(InodePtr dirInode, long *fileInodeNum,
long *dirIndex, char **name);
long long *dirIndex, char **name);
static long FindFileInDir(char *fileName, long *flags,
InodePtr fileInode, InodePtr dirInode);
static char *ReadFileBlock(InodePtr fileInode, long fragNum, long blockOffset,
#ifndef BOOT1
long UFSGetDirEntry( CICell ih, char * dirPath, long * dirIndex,
long UFSGetDirEntry( CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
FinderInfo * finderInfo, long * infoValid)
{
}
static long ReadDirEntry( InodePtr dirInode, long * fileInodeNum,
long * dirIndex, char ** name )
long long * dirIndex, char ** name )
{
struct direct *dir;
char *buffer;
long index;
long long index;
long dirBlockNum, dirBlockOffset;
while (1) {
index = *dirIndex;
dirBlockOffset = index % DIRBLKSIZ;
dirBlockNum = index / DIRBLKSIZ;
dirBlockOffset = (long) (index % DIRBLKSIZ);
dirBlockNum = (long) (index / DIRBLKSIZ);
buffer = ReadFileBlock(dirInode, dirBlockNum, 0, DIRBLKSIZ, 0, 1);
if (buffer == 0) return -1;
static long FindFileInDir( char * fileName, long * flags,
InodePtr fileInode, InodePtr dirInode )
{
long ret, inodeNum, index = 0;
long ret, inodeNum;
long long index = 0;
char *name;
while (1) {
trunk/i386/libsaio/ufs.h
2323
2424
2525
26
26
2727
2828
2929
extern long UFSInitPartition(CICell ih);
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 * dirIndex,
extern long UFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
FinderInfo * finderInfo, long * infoValid);
extern void UFSGetDescription(CICell ih, char *str, long strMaxLen);
trunk/i386/libsaio/sys.c
294294
295295
296296
297
297
298298
299299
300300
......
322322
323323
324324
325
325
326326
327327
328328
// GetDirEntry - LOW-LEVEL FILESYSTEM FUNCTION.
// Fetch the next directory entry for the given directory.
long GetDirEntry(const char * dirSpec, long * dirIndex, const char ** name,
long GetDirEntry(const char * dirSpec, long long * dirIndex, const char ** name,
long * flags, long * time)
{
const char * dirPath;
long GetFileInfo(const char * dirSpec, const char * name,
long * flags, long * time)
{
long index = 0;
long long index = 0;
const char * entryName;
if (gMakeDirSpec == 0)
trunk/i386/libsaio/nbp.c
9696
9797
9898
99
99
100100
101101
102102
/*==========================================================================
* GetDirEntry is not supported.
*/
static long NBPGetDirEntry(CICell ih, char * dirPath, long * dirIndex,
static long NBPGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
FinderInfo * finderInfo, long * infoValid)
{
trunk/i386/libsaio/saio_types.h
132132
133133
134134
135
135
136136
137137
138138
......
157157
158158
159159
160
160
161161
162162
163163
typedef long (*FSLoadFile)(CICell ih, char * filePath);
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 * dirIndex,
typedef long (*FSGetDirEntry)(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
FinderInfo * finderInfo, long * infoValid);
typedef long (* FSGetUUID)(CICell ih, char *uuidStr);
struct dirstuff {
char * dir_path; /* directory path */
long dir_index; /* directory entry index */
long long dir_index; /* directory entry index */
BVRef dir_bvr; /* volume reference */
};
trunk/i386/libsaio/msdos.c
615615
616616
617617
618
618
619619
620620
621621
......
626626
627627
628628
629
629
630630
631631
632632
......
651651
652652
653653
654
654
655655
656656
657657
return 0;
}
long MSDOSGetDirEntry(CICell ih, char * dirPath, long * dirIndex,
long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
FinderInfo * finderInfo, long * infoValid)
{
return -1;
if (dirPath[0] == '/')
dirPath++;
st = (struct msdosdirstate *)*dirIndex;
st = (struct msdosdirstate *)(long) *dirIndex;
if (!st)
{
st=malloc (sizeof (*st));
}
else
initRoot (st);
*dirIndex = (long)st;
*dirIndex = (long long) (long) st;
}
while((dirp = getnextdirent (ih, vfatname, st))&& (dirp->deAttributes & ATTR_VOLUME));
if (!dirp)
trunk/i386/libsaio/msdos.h
2424
2525
2626
27
27
2828
2929
3030
3131
3232
33
33
extern long MSDOSInitPartition(CICell ih);
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 * dirIndex,
extern long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex,
char ** name, long * flags, long * time,
FinderInfo * finderInfo, long * infoValid);
extern long MSDOSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock);
extern long MSDOSGetUUID(CICell ih, char *uuidStr);
extern void MSDOSFree(CICell ih);
extern int MSDOSProbe (const void *buf);
extern int MSDOSProbe (const void *buf);
trunk/i386/libsaio/saio_internal.h
170170
171171
172172
173
173
174174
175175
176176
extern long LoadFile(const char *fileSpec);
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 *dirIndex, const char **name,
extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name,
long *flags, long *time);
extern long GetFileInfo(const char *dirSpec, const char *name,
long *flags, long *time);
trunk/i386/boot2/drivers.c
257257
258258
259259
260
260
261
261262
262263
263264
static long
FileLoadDrivers( char * dirSpec, long plugin )
{
long ret, length, index, flags, time, bundleType;
long ret, length, flags, time, bundleType;
long long index;
long result = -1;
const char * name;

Archive Download the corresponding diff file

Revision: 151