1
.TH MA_GET_INDEX 3 "20 February 1997" "MA Release 1.8" "MA LIBRARY ROUTINES"
4
get the base index for a block
9
Boolean MA_get_index(memhandle, index)
10
Integer memhandle; /* read-only */
11
Integer *index; /* write-only */
13
.SH "FORTRAN SYNOPSIS"
15
#include "mafdecls.fh"
17
logical function MA_get_index(memhandle, index)
22
MA_get_index() returns in
25
for the type-specific data array that is appropriate
26
for the block corresponding to the handle
28
(which was returned by MA_allocate_heap() or MA_push_stack()
29
when the block was allocated).
31
The following FORTRAN code illustrates the use of MA_get_index()
32
by allocating a block of 5 integers on the heap
33
and then storing values into the integers.
36
#include "mafdecls.fh"
43
ok = MA_allocate_heap(MT_INT, 5, 'heap int block', mhandle)
45
ok = MA_get_index(mhandle, index)
57
is not a valid handle.
59
invalid checksum for memhandle %d (name: '%s')
61
The block's computed checksum does not match its stored checksum.
62
This indicates that the block has been corrupted
63
by having its internal state overwritten.
65
invalid guard(s) for memhandle %d (name: '%s')
67
This indicates that the block has been corrupted
68
by being overwritten at one or both ends.
69
The likely cause of this is an application indexing bug.
71
memhandle %d (name: '%s') not in heap or stack
73
The block is not currently allocated in the heap or the stack.
76
Other diagnostics are possible.
78
they indicate corruption of the internal state of MA,
79
caused by bugs in either MA or the application.
81
C: MA_TRUE upon success, MA_FALSE upon failure.
83
FORTRAN: .true. upon success, .false. upon failure.
85
Type-specific data arrays are not yet available in C,
86
so employ pointers instead of indices
87
by using MA_get_pointer()
88
instead of MA_get_index().
91
Include files: /msrc/proj/hpctools/ma/release/current/include
92
Library: /msrc/proj/hpctools/ma/release/current/lib/\fIplatform\fR/libma.a
93
Man pages: /msrc/proj/hpctools/ma/release/current/man/man3
94
Source code: /msrc/proj/hpctools/ma/release/current/tar/ma\fIrelease\fR.tar
106
Gregory S. Thomas, Pacific Northwest National Laboratory