blob: 505045533e3ea7d44712e23900cdf896e3c53cdc [file] [log] [blame]
Denis Vlasenkod18f52b2008-03-02 12:53:15 +00001/* vi: set sw=4 ts=4: */
2/*
3 * Wrapper for common string vector sorting operation
4 *
5 * Copyright (c) 2008 Denys Vlasenko
6 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02007 * Licensed under GPLv2, see file LICENSE in this source tree.
Denis Vlasenkod18f52b2008-03-02 12:53:15 +00008 */
Denis Vlasenkod18f52b2008-03-02 12:53:15 +00009#include "libbb.h"
10
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000011int /* not FAST_FUNC! */ bb_pstrcmp(const void *a, const void *b)
Denis Vlasenkod18f52b2008-03-02 12:53:15 +000012{
13 return strcmp(*(char**)a, *(char**)b);
14}
15
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000016void FAST_FUNC qsort_string_vector(char **sv, unsigned count)
Denis Vlasenkod18f52b2008-03-02 12:53:15 +000017{
18 qsort(sv, count, sizeof(char*), bb_pstrcmp);
19}