#ifndef _QSORTER_H
#define	_QSORTER_H

#include "scpview.h"

/** \defgroup qsort Supplementary quick sort
 *  Not reentrant, only one
 *  sorting can be performed one time
 *  @{
 */

#ifdef	__cplusplus
extern "C" {
#endif

typedef struct _QSorter QSorter;
typedef int(*qs_comp_func)(SCPView*,int,int,void*);

struct _QSorter {
    SCPView* view;
    qs_comp_func comparator;
    void* miscData;
};

extern QSorter scpqsort;

void quick_sort_rows(SCPView* v,qs_comp_func compare,void* miscData);
void quick_sort_columns(SCPView* v,qs_comp_func compare,void* miscData);

void qs_rows(int l,int r);
void qs_columns(int l,int r);

/** @}*/

#ifdef	__cplusplus
}
#endif

#endif	/* _QSORTER_H */

