| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.8.1 C/Fortran interface
The C interface is a base for many other interfaces. It contains the pure C functions for most of the methods of MathGL classes. In distinction to C++ classes, C functions must have an argument HMGL (for graphics) and/or HMDT (for data arrays), which specifies the object for drawing or manipulating (changing). So, firstly, the user has to create this object by the function mgl_create_*() and has to delete it after the use by function mgl_delete_*().
All C functions are described in the header file #include <mgl2/mgl_cf.h> and use variables of the following types:
-
HMGL— Pointer to classmglGraph(see section MathGL core). -
HCDT— Pointer to classconst mglDataA(see section Data processing) — constant data array. -
HMDT— Pointer to classmglData(see section Data processing) — data array of real numbers. -
HADT— Pointer to classmglDataC(see section Data processing) — data array of complex numbers. -
HMPR— Pointer to classmglParse(see section mglParse class) — MGL script parsing. -
HMEX— Pointer to classmglExpr(see section Evaluate expression) — textual formulas for real numbers. -
HMAX— Pointer to classmglExprC(see section Evaluate expression) — textual formulas for complex numbers.
These variables contain identifiers for graphics drawing objects and for the data objects.
Fortran functions/subroutines have the same names as C functions. However, there is a difference. Variable of type HMGL, HMDT must be an integer with sufficient size (integer*4 in the 32-bit operating system or integer*8 in the 64-bit operating system). All C functions of type void are subroutines in Fortran, which are called by operator call. The exceptions are functions, which return variables of types HMGL or HMDT. These functions should be declared as integer in Fortran code. Also, one should keep in mind that strings in Fortran are denoted by ' symbol, not the " symbol.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 21, 2014 using texi2html 5.0.
