rMPL - Multi Platform Library

The rMPL library ensures that all source modules using rMPL can be absolutly platform independent. rMPL is the very basic library of all products of RCS Ltd. Development of rMPL has never ended, because compilers and operating systems have new versions what rMPL should follow. Therefore this library is open and any comment, improvement, idea are wellcome.

Nowadays the phrase "Multi Platform Programming" is very popular. The Java language was invented to solve these problems, but we believe that Java cannot replace C/C++ on many fields, where the size and speed of the executable code are essential or the software needs to solve hardware related problems (e.g. handling hardware devices).

From the other hand C/C++ is the most powerful programming language where even "language extensions" can be implemented. We believe, that the problem of Multi-Platform Programming can be solved in C/C++.

The basic idea of rMPL is providing platform dependency by defining include path of rMPL's header files of the required platform and linking the appropriate libraries. For example if someone wants to compile his program on Windows 95, with Visual C++ version 5.0 the items -I/rMPL/inc/_p/w32 -I/rMPL/Inc/_c/vc50 should be added to C_FLAGS in the makefile and the libraries belong to these headers should be linked to the application.

The rMPL library provides platform independency with fulfilling the following requirements:

Many companies deal with multi-platform libraries (Zink, Qt) and they provide very nice tools and multi-platform class hierarchy of GUI components. However there are some problems generally not handled. These companies provide source code of their GUI components on different platforms, but they do not help the developer how to write his own portable source code.

Writing portable source code requires deep knowledge of different platforms, compilers and tools on all target platforms The source will be portable, if all platform dependent parts are clearly separated and implemented parallel on several platforms.

Most of the available libraries supports only our first requirements of portability. The applications cannot communicate with each others if they run on different platforms and the binary files cannot be loaded for example on a PC, if it was saved on a Sun Workstation.

Multi-platform programming starts with solving much simpler problems like portable user interface. A lot of things are different between hardware and software platforms. For example the files system, the byte order of integer numbers, the size of int (16, 32 or 64 bit), system calls, etc. How can you save the access rights of your source files under UNIX, if you move it to Microsoft Windows, where no such access rights exist? How can you convert file extensions from .cpp to .cxx or .CC, as different compilers may require? How can you convert CR/LF (DOS style end of line) to LF (UNIX style end of line)?

The primary goal of rMPL is to help programmers writing multi platform applications. When the application has developed the programmer should know what is platform dependent and how that problem is solved in rMPL. rMPL's documentation collects all known problems and describes the possible solutions. The programmer should learn rMPL instead of a lot of programming environments. You should treat this library as a collection of our experience solving a lot but probably not all the problems. If you find something not covered by rMPL, please let us know and we will provide a solution in rMPL soon.

The rMPL library gives solutions for the problems like:

If a feature implemented in most complilers or platform rMPL emulates or implements it if necessary. vscanf(), vfscanf() and vsscanf() is a good example. They are supported by most UNIX C compilers, but missing from most Microsoft Windows C compilers.

Graphical user interfaces and all related problems are not part of rMPL. See rGUI for these topics.

For more information about rMPL see its documentaion. It is opened as all documentation of RCS's softwares.

Examples to Demonstrate How rMPL Works.

Most compilers provide a safe version of sprintf() having an additional argument for buffer size, but it has different names under different compilers. rMPL defines a common name r_sprintf() for this function and calls the appropriate function of the selected compiler when r_sprintf() is used. The user of rMPL should known from rMPL's documentation, that this function is platform dependent and use the rMPL's equivalent instead. The user should not know, how this function is called in different compilers and his code will not look like a series of #ifdef statements instead of a simple function call.

Platforms and Compilers Supported by rMPL

The following platforms and compilers are supported:


[ Home | RCS | rIDE | SIMM-Sys | SC | Site-map | Help | Feedback ]

Robot Control Software Ltd. Úrbéres u. 62/A., Budapest, 1028 Hungary; Tel:+36-1 398-0200 Fax:+36-1 398-0202