Portability and use of APIs are mutually exclusive. The use of platform-specific APIs when creating some software means that it will not work on any other platform, and there is no guarantee that other systems even have a similar API. If you have code that uses the API heavily, you probably have no choice but to override (part of) the program if you want to port it to another platform. This is NOT something that could be solved using the "Find + replace one API function with another" function (although this may be applicable in some cases), so the existence of a dictionary for translation between them is unlikely, and will still be incomplete. You must rewrite the code! Read manpages, google, etc., and then if you have specific problems you can ask about them. Instead of spamming this site with a question for every thing ...!
To avoid this entire API problem, rather than using the API directly when writing code, you can use a portable library designed for the required functionality (Google should help you) that will make API calls for you, and the accompanying libraries should worry about all the problems. platform-related so you donβt need to! A good example of this (for C ++) is the SDL, which processes video, audio, and controllers. Please note that it contains a portable version of GetKeyState ! The .NET / Mono library itself hides many API calls from you.
It is probably recommended that you use a library with a similar interface for the Windows API when porting your program (if it exists), and not translate everything into the Linux API (thus transferring the software), but I think the best plan is to see what they are used for APIs, and then learn how to do this in a portable way, rather than trying to translate each function individually. Keep in mind that functions can be interdependent and can be grouped around a set of tasks when looking for solutions.
source share