Files
SDK_SG200x_V2/u-boot-2021.10/include/sort.h
carbon 0545e9dc6d init version 2024-05-07
commit d1edce71135cc6d98c0a4b5729774542b676e769
Author: sophgo-forum-service <forum_service@sophgo.com>
Date:   Fri Mar 15 16:07:33 2024 +0800

    [fix] recommend using ssh method to clone repo.
    [fix] fix sensor driver repo branch name.
2024-05-07 19:36:36 +08:00

35 lines
909 B
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright 2019 Google LLC
*/
#ifndef __SORT_H
#define __SORT_H
/**
* qsort() - Use the quicksort algorithm to sort some values
*
* @base: Base address of array to sort
* @nmemb: Number of members to sort
* @size: Size of each member in bytes
* @compar: Comparison function which should return:
* < 0 if element at s1 < element at s2,
* 0 if element at s1 == element at s2,
* > 0 if element at s1 > element at s2,
*/
void qsort(void *base, size_t nmemb, size_t size,
int (*compar)(const void *s1, const void *s2));
/**
* strcmp_compar() - compar function for string arrays
*
* This can be passed to qsort when a string array is being sorted
*
* @s1: First string to compare
* @s2: Second string to compare
* @return comparison value (less than, equal to, or greater than 0)
*/
int strcmp_compar(const void *s1, const void *s2);
#endif