Drizzled Public API Documentation

ut0sort.h File Reference

#include "univ.i"

Go to the source code of this file.

Defines

#define UT_SORT_FUNCTION_BODY(SORT_FUN, ARR, AUX_ARR, LOW, HIGH, CMP_FUN)

Detailed Description

Sort utility

Created 11/9/1995 Heikki Tuuri

Definition in file ut0sort.h.


Define Documentation

#define UT_SORT_FUNCTION_BODY (   SORT_FUN,
  ARR,
  AUX_ARR,
  LOW,
  HIGH,
  CMP_FUN 
)

This macro expands to the body of a standard sort function. The sort function uses mergesort and must be defined separately for each type of array. Also the comparison function has to be defined individually for each array cell type. SORT_FUN is the sort function name. The function takes the array to be sorted (ARR), the array of auxiliary space (AUX_ARR) of same size, and the low (LOW), inclusive, and high (HIGH), noninclusive, limits for the sort interval as arguments. CMP_FUN is the comparison function name. It takes as arguments two elements from the array and returns 1, if the first is bigger, 0 if equal, and -1 if the second bigger.

Definition at line 53 of file ut0sort.h.