C, C++, and Other 3GLs
Uniface provides an API that makes it possible to integrate Uniface applications and programs created in 3GL programming languages such as C, C++, Visual Basic, Cobol, Fortran, and Pascal.
Uniface is a fourth-generation language (4GL) tool. A typical feature of 4GLs is that compiled intermediate code is dynamically executed by a runtime interpreter. While 4GLs typically offer a broad range of high-level functionality, they generally lack the basic functionality that is commonly provided by a so-called third-generation language (3GL). Many applications might need to have both types of functionality—4GL code for productivity and portability, and 3GL code for specialized low-level tasks, or to interface with other code written in a 3GL.
The most common 3GLs are C, C++, Visual Basic, Cobol, Fortran, and Pascal. It is possible for Uniface to interface with code written in any of these languages, but because Uniface is itself written in C and C++, the interface is heavily biased towards C. Uniface provides include files only for C.
Although the Java and C# language can be considered 3GLs, their dependency on their respective runtime environments makes for a different type of interfacing that falls outside the scope of this documentation.
At one time, 3GL was also used to build a Uniface application, but this is no longer the case. The current Uniface architecture uses shared libraries to access 3GL code, rather than a dispatch table that must be linked into a user executable. Customers who do not make explicit use of 3GL code no longer need to have a C compiler, and need not be concerned with linking an application. However, because there are differences between the current version of Uniface and earlier versions (Uniface V7 and earlier), there is still useful information to be found here.
Uniface can use, or be used by, 3GL code in the following ways:
- Calling 3GL code from the Uniface ProcScript language (commonly called 3GL call-out)
- Executing Uniface components from 3GL code (commonly called 3GL call-in)
- Implementing a user-defined packing code for a data type not supported by Uniface
- Implementing a user-defined database driver to access a database not supported by Uniface
- Implementing user-defined data encryption using the formatToDbms and formatFromDbms triggers
- Implementing custom password validation and/or network data encryption via the security driver
- Posting asynchronous messages to Uniface using the Postmessage API