MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / __CARDGetFileNo

Function __CARDGetFileNo

src/dolphin/src/card/CARDOpen.c:89–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89s32 __CARDGetFileNo(CARDControl *card, const char *fileName, s32 *pfileNo)
90{
91 CARDDir *dir;
92 CARDDir *ent;
93 s32 fileNo;
94 s32 result;
95
96 if (!card->attached)
97 {
98 return CARD_RESULT_NOCARD;
99 }
100
101 dir = __CARDGetDirBlock(card);
102 for (fileNo = 0; fileNo < CARD_MAX_FILE; fileNo++)
103 {
104 ent = &dir[fileNo];
105 result = __CARDAccess(card, ent);
106 if (result < 0)
107 {
108 continue;
109 }
110 if (__CARDCompareFileName(ent, fileName))
111 {
112 *pfileNo = fileNo;
113 return CARD_RESULT_READY;
114 }
115 }
116
117 return CARD_RESULT_NOFILE;
118}
119
120s32 CARDFastOpen(s32 chan, s32 fileno, CARDFileInfo *fileinfo)
121{

Callers 2

CARDDeleteAsyncFunction · 0.85
CARDOpenFunction · 0.85

Calls 3

__CARDGetDirBlockFunction · 0.85
__CARDAccessFunction · 0.85
__CARDCompareFileNameFunction · 0.85

Tested by

no test coverage detected