[ << ] | [ < ] | [ 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). -
HMDT
— Pointer to classmglData
(see section Data processing). -
HMPR
— Pointer to classmglParse
(see section mglParse class).
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 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 April 13, 2012 using texi2html 5.0.