mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
Reduce duplication by using the new template. Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/CA%2BhUKGJ2-eaDqAum5bxhpMNhvuJmRDZxB_Tow0n-gse%2BHG0Yig%40mail.gmail.com
23 lines
409 B
C
23 lines
409 B
C
/*
|
|
* qsort.c: standard quicksort algorithm
|
|
*/
|
|
|
|
#include "c.h"
|
|
|
|
#define ST_SORT pg_qsort
|
|
#define ST_ELEMENT_TYPE_VOID
|
|
#define ST_COMPARE_RUNTIME_POINTER
|
|
#define ST_SCOPE
|
|
#define ST_DECLARE
|
|
#define ST_DEFINE
|
|
#include "lib/sort_template.h"
|
|
|
|
/*
|
|
* qsort comparator wrapper for strcmp.
|
|
*/
|
|
int
|
|
pg_qsort_strcmp(const void *a, const void *b)
|
|
{
|
|
return strcmp(*(const char *const *) a, *(const char *const *) b);
|
|
}
|