Chapter 6. The C-API

Table of Contents

6.1. The C-API
6.2. mlInitSystemML.h
6.3. mlAPI.h
6.4. mlDataTypes.h
6.5. mlTypeDefs.h
6.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++.

6.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 6.2, “mlInitSystemML.h”, Section 6.3, “mlAPI.h” and Section 6.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 6.2, “mlInitSystemML.h”, Section 6.3, “mlAPI.h” and Section 6.4, “mlDataTypes.h”.