I need to modify old code which is using Carbon APIs as the Carbon APIs were deprecated after Mac OS X v10.8 (Mountain Lion). I am stuck on finding the replacement for resource APIs such as CurResfile, UseResFile, Get1Resource, FsCreateResFile, FsOpenResFile, etc.
I read the Apple documentation and found I can use bundle instead of this. But bundle contains different types of file and resource is one of them. How will I get the current resource file which I used to get by CurResfile?
short sCurRes = CurResFile();
UseResFile(sCurRes);
There is no direct replacement for these APIs. The Resource Manager, as a concept, has been functionally obsolete for most of the lifetime of Mac OS X -- it was made available as a transitional technology for applications which had used it in earlier versions of Mac OS. This transition occurred over 15 years ago, and it's well past time that your application moved on.
Move your application's assets out of resources and into individual files in your application's bundle.