47 #if PRAGMA_STRUCT_ALIGN
48 #pragma options align = mac68k
49 #elif PRAGMA_STRUCT_PACKPUSH
51 #elif PRAGMA_STRUCT_PACK
101 #if !OPAQUE_UPP_TYPES
104 uppResErrProcInfo = 0x00001002
107 inline ResErrUPP
NewResErrUPP(ResErrProcPtr userRoutine)
110 (ProcPtr)(userRoutine), uppResErrProcInfo, GetCurrentArchitecture());
113 #define NewResErrUPP(userRoutine) \
114 (ResErrUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppResErrProcInfo, \
115 GetCurrentArchitecture())
129 #if !OPAQUE_UPP_TYPES
136 #define DisposeResErrUPP(userUPP) DisposeRoutineDescriptor(userUPP)
148 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
149 #pragma parameter InvokeResErrUPP(__D0, __A0)
153 #if !OPAQUE_UPP_TYPES && \
154 (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
158 CALL_ONE_PARAMETER_UPP(userUPP, uppResErrProcInfo, thErr);
161 #define InvokeResErrUPP(thErr, userUPP) \
162 CALL_ONE_PARAMETER_UPP((userUPP), uppResErrProcInfo, (thErr))
166 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
168 #define NewResErrProc(userRoutine) NewResErrUPP(userRoutine)
169 #define CallResErrProc(userRoutine, thErr) InvokeResErrUPP(thErr, userRoutine)
173 typedef CALLBACK_API(OSErr,
174 ResourceEndianFilterPtr)(Handle theResource,
175 Boolean currentlyNativeEndian);
176 #if CALL_NOT_IN_CARBON
289 #if CALL_NOT_IN_CARBON
385 for (j = 1; j <=
rTotal; j++)
389 printf(
"Type '%c%c%c%c' has %d resources\n",
390 rtp[0], rtp[1], rtp[2], rtp[3], CountResources(rt));
393 * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
394 * \non_carbon_cfm in InterfaceLib 7.1 and
396 * \carbon_lib in CarbonLib 1.0 and
398 * \mac_os_x in version 10.0 and
523 for (j = 1; j <=
rCount; j++)
527 printf(
" 'DRVR' Rsrc ID: %6d, Name: %s\n", rID, PtoCstr(rName) + 1);
531 * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
532 * \non_carbon_cfm in InterfaceLib 7.1 and
534 * \carbon_lib in CarbonLib 1.0 and
536 * \mac_os_x in version 10.0 and
540 CountResources(ResType theType);
642 #define MacLoadResource LoadResource
769 GetResInfo(Handle theResource,
short *theID, ResType *theType, Str255 name);
780 SetResInfo(Handle theResource,
short theID, ConstStr255Param name);
806 AddResource(Handle theData, ResType theType,
short theID, ConstStr255Param name);
830 #if CALL_NOT_IN_CARBON
987 WriteResource(rHandle);
992 before calling WriteResource.</ pre>
993 * \copyright THINK Reference © 1991 -
994 1992 Symantec Corporation
995 * \non_carbon_cfm in InterfaceLib 7.1 and
997 * \carbon_lib in CarbonLib 1.0 and
999 * \mac_os_x in version 10.0 and
1002 void WriteResource(Handle theResource);
1146 OpenRFPerm(ConstStr255Param fileName,
short vRefNum, SInt8 permission);
1148 #if CALL_NOT_IN_CARBON
1220 ScriptCode scriptTag);
1268 #if CALL_NOT_IN_CARBON
1279 ResourceEndianFilterPtr theFilterProc);
1311 kRsrcChainBelowSystemMap = 0,
1312 kRsrcChainBelowApplicationMap = 1,
1313 kRsrcChainAboveApplicationMap = 2,
1314 kRsrcChainAboveAllMaps = 4
1425 #if CALL_NOT_IN_CARBON
1457 openrfperm(
const char *fileName,
short vRefNum,
char permission);
1490 getresinfo(Handle theResource,
short *theID, ResType *theType,
char *name);
1512 addresource(Handle theResource, ResType theType,
short theID,
const char *name);
1517 #define SizeResource(theResource) GetResourceSizeOnDisk(theResource)
1518 #define MaxSizeRsrc(theResource) GetMaxResourceSize(theResource)
1519 #define RmveResource(theResource) RemoveResource(theResource)
1543 const UniChar *name, FSCatalogInfoBitmap whichInfo,
1608 const UniChar *name, FSCatalogInfoBitmap whichInfo,
1610 UniCharCount forkNameLength,
1611 const UniChar *forkName,
1650 const UniChar *forkName,
1651 SInt8 permissions, SInt16 *refNum);
1657 typedef short ResID;
1658 typedef short ResAttributes;
1659 typedef short ResFileAttributes;
1661 #if PRAGMA_STRUCT_ALIGN
1662 #pragma options align = reset
1663 #elif PRAGMA_STRUCT_PACKPUSH
1665 #elif PRAGMA_STRUCT_PACK
1669 #ifdef PRAGMA_IMPORT_OFF
1672 #pragma import reset
1682 #if PRAGMA_STRUCT_ALIGN
1683 #pragma options align = reset
1684 #elif PRAGMA_STRUCT_PACKPUSH
1686 #elif PRAGMA_STRUCT_PACK
1690 #ifdef PRAGMA_IMPORT_OFF
1693 #pragma import reset
#define check(assertion)
Definition: Debugging.h:819
File Manager (MFS, HFS, and HFS+) Interfaces.
printf("First vcb is at = %lx\n", qhp->qHead)
Obtain pointer to the volume control block queue header.
HPurge(myHandle)
Make a relocatable block purgeable.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
short openrfperm(const char *fileName, short vRefNum, char permission)
Handle Get1IndResource(ResType theType, short index)
void ReadPartialResource(Handle theResource, long offset, void *buffer, long count)
Boolean FSpResourceFileAlreadyOpen(const FSSpec *resourceFile, Boolean *inChain, SInt16 *refNum)
void SetResourceSize(Handle theResource, long newSize)
OSErr FSpOpenOrphanResFile(const FSSpec *spec, SignedByte permission, SInt16 *refNum)
short FSpOpenResFile(const FSSpec *spec, SignedByte permission)
Open resource file specified by an FSSpec.
short openresfile(const char *fileName)
void WritePartialResource(Handle theResource, long offset, const void *buffer, long count)
void GetIndType(ResType *theType, short index)
Get the ResType of a resource, given its index.
Handle GetResource(ResType theType, short theID)
short GetResFileAttrs(short refNum)
Obtain resource file attributes.
void createresfile(const char *fileName)
void ChangedResource(Handle theResource)
void SetResLoad(Boolean load)
Set state of automatic resource loading.
Handle GetNextFOND(Handle fondHandle)
void GetResInfo(Handle theResource, short *theID, ResType *theType, Str255 name)
Given a handle, obtain resource ID, type, and name.
OSErr InsertResourceFile(SInt16 refNum, RsrcChainLocation where)
void CloseResFile(short refNum)
Handle RGetResource(ResType theType, short theID)
short InitResources(void)
void getresinfo(Handle theResource, short *theID, ResType *theType, char *name)
void FSCreateResFile(const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo, FSRef *newRef, FSSpec *newSpec)
void RemoveResource(Handle theResource)
Handle Get1Resource(ResType theType, short theID)
void AddResource(Handle theData, ResType theType, short theID, ConstStr255Param name)
Make arbitrary data in memory into a resource.
short CurResFile(void)
Get reference number of current resource file.
short HomeResFile(Handle theResource)
Given a resource handle, return a file reference number.
void SetResAttrs(Handle theResource, short attrs)
Set resource attributes (purgeable, locked, etc.)
short Count1Resources(ResType theType)
Get "1-deep" count of resources of selected type.
void setresinfo(Handle theResource, short theID, const char *name)
void MacLoadResource(Handle theResource)
long GetResourceSizeOnDisk(Handle theResource)
void FSpCreateResFile(const FSSpec *spec, OSType creator, OSType fileType, ScriptCode scriptTag)
SInt16 RsrcChainLocation
Definition: Resources.h:1308
void UpdateResFile(short refNum)
Write changed resource map and data to disk.
short Unique1ID(ResType theType)
1-deep, get unique resource ID
OSErr RegisterResourceEndianFilter(ResType theType, ResourceEndianFilterPtr theFilterProc)
void HCreateResFile(short vRefNum, long dirID, ConstStr255Param fileName)
void SetResPurge(Boolean install)
Write data of one resource to disk.
void CreateResFile(ConstStr255Param fileName)
OSErr FSCreateResourceFile(const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo, UniCharCount forkNameLength, const UniChar *forkName, FSRef *newRef, FSSpec *newSpec)
short OpenResFile(ConstStr255Param fileName)
OSErr ResError(void)
Find if an error occurred in a resource operation.
Handle getnamedresource(ResType theType, const char *name)
Handle get1namedresource(ResType theType, const char *name)
OSErr GetNextResourceFile(SInt16 curRefNum, SInt16 *nextRefNum)
short ResFileRefNum
Definition: Resources.h:1656
short FSOpenResFile(const FSRef *ref, SInt8 permission)
OSErr GetTopResourceFile(SInt16 *refNum)
void TempInsertROMMap(Boolean tempResLoad)
long RsrcMapEntry(Handle theResource)
Obtain offset in resource map for a handle's entry.
short UniqueID(ResType theType)
Get unique resource ID (before adding a resource)
void DetachResource(Handle theResource)
Prevent resource from being discarded when file is closed.
void UseResFile(short refNum)
Make specified resource file the "current file".
short rTotal
Get total number of resource types in open files.
Definition: Resources.h:381
OSErr DetachResourceFile(SInt16 refNum)
Handle Get1NamedResource(ResType theType, ConstStr255Param name)
void addresource(Handle theResource, ResType theType, short theID, const char *name)
short HOpenResFile(short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission)
Handle GetIndResource(ResType theType, short index)
void Get1IndType(ResType *theType, short index)
void SetResFileAttrs(short refNum, short attrs)
Set resource file attributes.
void ReleaseResource(Handle theResource)
ResErrUPP NewResErrUPP(ResErrProcPtr userRoutine)
short Count1Types(void)
Get total number of resource types in current file.
short GetResAttrs(Handle theResource)
rCount
Find how many of a selected resource type exist.
Definition: Resources.h:521
void SetResInfo(Handle theResource, short theID, ConstStr255Param name)
void InvokeResErrUPP(OSErr thErr, ResErrUPP userUPP)
short OpenRFPerm(ConstStr255Param fileName, short vRefNum, SInt8 permission)
Boolean FSResourceFileAlreadyOpen(const FSRef *resourceFileRef, Boolean *inChain, SInt16 *refNum)
long GetMaxResourceSize(Handle theResource)
OSErr FSOpenResourceFile(const FSRef *ref, UniCharCount forkNameLength, const UniChar *forkName, SInt8 permissions, SInt16 *refNum)
void DisposeResErrUPP(ResErrUPP userUPP)
Handle GetNamedResource(ResType theType, ConstStr255Param name)
typedef CALLBACK_API_REGISTER68K(void, SIInterruptProcPtr,(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize))
typedef REGISTER_UPP_TYPE(HighHookProcPtr) HighHookUPP
Definition: MacTypes.h:520