almost finished Resources.c, two small issues in ReadResourceFork and FSpOpenResFile

This commit is contained in:
Ash Wolf 2022-10-11 18:54:59 +01:00
parent 26b57fbea1
commit 4c9d73d724
2 changed files with 646 additions and 177 deletions

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,8 @@ enum {
resFNotFound = -193, // resource file not found resFNotFound = -193, // resource file not found
addResFailed = -194, // AddResource failed addResFailed = -194, // AddResource failed
rmvResFailed = -196, // RmveResource failed rmvResFailed = -196, // RmveResource failed
resAttrErr = -198 // inconsistent attribute resAttrErr = -198, // inconsistent attribute
mapReadErr = -199 // map inconsistent with operation
}; };
enum { kNilOptions = 0 }; enum { kNilOptions = 0 };
enum { kUnknownType = 0x3F3F3F3F }; enum { kUnknownType = 0x3F3F3F3F };
@ -78,6 +79,9 @@ typedef const unsigned char *ConstStr255Param;
// XXX: MacTypes.h defines StrLength() which is an inline for C++ and a macro for C // XXX: MacTypes.h defines StrLength() which is an inline for C++ and a macro for C
// This might be useful? // This might be useful?
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
typedef struct Point { typedef struct Point {
SInt16 v, h; SInt16 v, h;
} Point; } Point;
@ -85,9 +89,31 @@ typedef struct Point {
typedef struct Rect { typedef struct Rect {
SInt16 top, left, bottom, right; SInt16 top, left, bottom, right;
} Rect; } Rect;
#ifdef __MWERKS__
#pragma options align=reset
#endif
// ------- // -------
// Files.h // Files.h
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
enum {
fsCurPerm = 0x00,
fsRdPerm = 0x01,
fsWrPerm = 0x02,
fsRdWrPerm = 0x03,
fsRdWrShPerm = 0x04,
fsRdDenyPerm = 0x10,
fsWrDenyPerm = 0x20
};
enum {
fsAtMark = 0,
fsFromStart = 1,
fsFromLEOF = 2,
fsFromMark = 3
};
typedef struct FSSpec { typedef struct FSSpec {
SInt16 vRefNum; SInt16 vRefNum;
SInt32 parID; SInt32 parID;
@ -231,7 +257,9 @@ typedef union CInfoPBRec {
DirInfo hDirInfo; DirInfo hDirInfo;
} CInfoPBRec; } CInfoPBRec;
typedef CInfoPBRec *CInfoPBPtr; typedef CInfoPBRec *CInfoPBPtr;
//#endif #ifdef __MWERKS__
#pragma options align=reset
#endif
//#include "../sdk_hdrs/CompilerMapping.h" //#include "../sdk_hdrs/CompilerMapping.h"
//#include "../sdk_hdrs/DropInCompilerLinker.h" //#include "../sdk_hdrs/DropInCompilerLinker.h"