1
0

initial commit

This commit is contained in:
2025-05-27 11:36:06 +03:00
commit 4ba42acfea
14 changed files with 1584 additions and 0 deletions

29
sort.cc Normal file
View File

@@ -0,0 +1,29 @@
/* SPDX-License-Identifier: Apache-2.0
* (c) 2025, Konstantin Demin
*/
#include "sort.hh"
#include <cstring>
#include "coreutils-sort.hh"
int custom_sort(const char * a, const char * b, sort_mode mode)
{
switch (mode) {
case sort_mode::glibc_version_sort:
return strverscmp(a, b);
case sort_mode::coreutils_version_sort:
return coreutils_version_sort(a, b);
// not a actual version sort
/*
case sort_mode::simple_sort:
return strcmp(a, b);
*/
default:
return strcmp(a, b);
}
}