Chapter 7. The C-API

Table of Contents

7.1. The C-API
7.2. mlInitSystemML.h
7.3. mlAPI.h
7.4. mlDataTypes.h
7.5. mlTypeDefs.h
7.6. C-Example using the C-API

Chapter Objectives

By reading this chapter, you will get information on how to use the ML and the ML modules with other languages and without C++.

7.1. The C-API

The ML includes an interface that exports ML functionality as pure C. Many other programming libraries can also use the ML functionality because most linkers can bind pure C objects from different languages if they have a pure C interface. MeVisLab also uses the ML by simply including the files mlInitSystemML.h, mlAPI.h and mlDataTypes.h in pure C mode (see Section 7.2, “mlInitSystemML.h”, Section 7.3, “mlAPI.h” and Section 7.4, “mlDataTypes.h”). The files the files mlInitSystemML.h and mlDatatypes.h, however, can be both; if setting the compiler switches ML_DISABLE_CPP, only the C interface is available; otherwise C++ classes can also be used.

Most of the ML functionality can be accessed by including the three files described in Section 7.2, “mlInitSystemML.h”, Section 7.3, “mlAPI.h” and Section 7.4, “mlDataTypes.h”.