Guardian Procedure Calls Reference Manual
HEAPSORT Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Considerations
Example
Summary
The HEAPSORT procedure is used to sort an array of equal-sized elements in place.
Syntax for C Programmers
#include <cextdecs(HEAPSORT)>
short HEAPSORT ( short _near *array
,short num-elements
,short size-of-element
,short (*)()compare-function );
• The compare-function parameter is an application-supplied comparison function that must
be written in C. It must return values as described under the compare-proc parameter in
the TAL syntax.
Syntax for TAL Programmers
CALL HEAPSORT ( array ! i,o
,num-elements ! i
,size-of-element ! i
,compare-proc ); ! i
Parameters
array
input, output
INT:ref:*
contains equal-sized elements to be sorted.
num-elements
input
INT:value
is the number of elements in array.
size-of-element
input
INT:value
is the size, in words, of each element in array.
HEAPSORT Procedure 693