mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 10:48:29 +00:00
Release Cosmopolitan v3.6.0
This release is an atomic upgrade to GCC 14.1.0 with C23 and C++23
This commit is contained in:
parent
62ace3623a
commit
5660ec4741
1585 changed files with 117353 additions and 271644 deletions
2
third_party/tree/file.c
vendored
2
third_party/tree/file.c
vendored
|
@ -25,7 +25,7 @@ extern bool noindent, force_color, matchdirs, fflinks;
|
|||
extern bool reverse;
|
||||
extern int pattern, ipattern;
|
||||
|
||||
extern int (*topsort)();
|
||||
extern int (*topsort)(const void *, const void *);
|
||||
extern FILE *outfile;
|
||||
extern int Level, *dirs, maxdirs;
|
||||
|
||||
|
|
2
third_party/tree/list.c
vendored
2
third_party/tree/list.c
vendored
|
@ -24,7 +24,7 @@ extern bool Dflag, Hflag, inodeflag, devflag, Rflag, duflag, pruneflag, metafirs
|
|||
extern bool Jflag, hflag, siflag, noreport, noindent, force_color, xdev, nolinks;
|
||||
|
||||
extern struct _info **(*getfulltree)(char *d, u_long lev, dev_t dev, off_t *size, char **err);
|
||||
extern int (*topsort)();
|
||||
extern int (*topsort)(const void *, const void *);
|
||||
extern FILE *outfile;
|
||||
extern int flimit, Level, *dirs, maxdirs, errors;
|
||||
extern int htmldirlen;
|
||||
|
|
35
third_party/tree/tree.c
vendored
35
third_party/tree/tree.c
vendored
|
@ -61,8 +61,9 @@ const char *charset = NULL;
|
|||
|
||||
struct _info **(*getfulltree)(char *d, u_long lev, dev_t dev, off_t *size, char **err) = unix_getfulltree;
|
||||
/* off_t (*listdir)(char *, int *, int *, u_long, dev_t) = unix_listdir; */
|
||||
int (*basesort)() = alnumsort;
|
||||
int (*topsort)() = NULL;
|
||||
int alnumsort(const void *, const void *);
|
||||
int (*basesort)(const void *, const void *) = alnumsort;
|
||||
int (*topsort)(const void *, const void *) = NULL;
|
||||
|
||||
char *sLevel, *curdir;
|
||||
FILE *outfile = NULL;
|
||||
|
@ -89,7 +90,7 @@ const u_short ifmt[]={ FILE_ARCHIVED, FILE_DIRECTORY, FILE_SYSTEM, FILE_HIDDEN,
|
|||
|
||||
struct sorts {
|
||||
char *name;
|
||||
int (*cmpfunc)();
|
||||
int (*cmpfunc)(const void *, const void *);
|
||||
} sorts[] = {
|
||||
{"name", alnumsort},
|
||||
{"version", versort},
|
||||
|
@ -1017,16 +1018,20 @@ struct _info **unix_getfulltree(char *d, u_long lev, dev_t dev, off_t *size, cha
|
|||
/**
|
||||
* filesfirst and dirsfirst are now top-level meta-sorts.
|
||||
*/
|
||||
int filesfirst(struct _info **a, struct _info **b)
|
||||
int filesfirst(const void *a_, const void *b_)
|
||||
{
|
||||
struct _info **a = (struct _info **)a_;
|
||||
struct _info **b = (struct _info **)b_;
|
||||
if ((*a)->isdir != (*b)->isdir) {
|
||||
return (*a)->isdir ? 1 : -1;
|
||||
}
|
||||
return basesort(a, b);
|
||||
}
|
||||
|
||||
int dirsfirst(struct _info **a, struct _info **b)
|
||||
int dirsfirst(const void *a_, const void *b_)
|
||||
{
|
||||
struct _info **a = (struct _info **)a_;
|
||||
struct _info **b = (struct _info **)b_;
|
||||
if ((*a)->isdir != (*b)->isdir) {
|
||||
return (*a)->isdir ? -1 : 1;
|
||||
}
|
||||
|
@ -1034,20 +1039,26 @@ int dirsfirst(struct _info **a, struct _info **b)
|
|||
}
|
||||
|
||||
/* Sorting functions */
|
||||
int alnumsort(struct _info **a, struct _info **b)
|
||||
int alnumsort(const void *a_, const void *b_)
|
||||
{
|
||||
struct _info **a = (struct _info **)a_;
|
||||
struct _info **b = (struct _info **)b_;
|
||||
int v = strcoll((*a)->name,(*b)->name);
|
||||
return reverse? -v : v;
|
||||
}
|
||||
|
||||
int versort(struct _info **a, struct _info **b)
|
||||
int versort(const void *a_, const void *b_)
|
||||
{
|
||||
struct _info **a = (struct _info **)a_;
|
||||
struct _info **b = (struct _info **)b_;
|
||||
int v = strverscmp((*a)->name,(*b)->name);
|
||||
return reverse? -v : v;
|
||||
}
|
||||
|
||||
int mtimesort(struct _info **a, struct _info **b)
|
||||
int mtimesort(const void *a_, const void *b_)
|
||||
{
|
||||
struct _info **a = (struct _info **)a_;
|
||||
struct _info **b = (struct _info **)b_;
|
||||
int v;
|
||||
|
||||
if ((*a)->mtime == (*b)->mtime) {
|
||||
|
@ -1058,8 +1069,10 @@ int mtimesort(struct _info **a, struct _info **b)
|
|||
return reverse? -v : v;
|
||||
}
|
||||
|
||||
int ctimesort(struct _info **a, struct _info **b)
|
||||
int ctimesort(const void *a_, const void *b_)
|
||||
{
|
||||
struct _info **a = (struct _info **)a_;
|
||||
struct _info **b = (struct _info **)b_;
|
||||
int v;
|
||||
|
||||
if ((*a)->ctime == (*b)->ctime) {
|
||||
|
@ -1075,8 +1088,10 @@ int sizecmp(off_t a, off_t b)
|
|||
return (a == b)? 0 : ((a < b)? 1 : -1);
|
||||
}
|
||||
|
||||
int fsizesort(struct _info **a, struct _info **b)
|
||||
int fsizesort(const void *a_, const void *b_)
|
||||
{
|
||||
struct _info **a = (struct _info **)a_;
|
||||
struct _info **b = (struct _info **)b_;
|
||||
int v = sizecmp((*a)->size, (*b)->size);
|
||||
if (v == 0) v = strcoll((*a)->name,(*b)->name);
|
||||
return reverse? -v : v;
|
||||
|
|
16
third_party/tree/tree.h
vendored
16
third_party/tree/tree.h
vendored
|
@ -153,15 +153,15 @@ int patinclude(char *name, int isdir);
|
|||
struct _info **unix_getfulltree(char *d, u_long lev, dev_t dev, off_t *size, char **err);
|
||||
struct _info **read_dir(char *dir, int *n, int infotop);
|
||||
|
||||
int filesfirst(struct _info **, struct _info **);
|
||||
int dirsfirst(struct _info **, struct _info **);
|
||||
int alnumsort(struct _info **, struct _info **);
|
||||
int versort(struct _info **a, struct _info **b);
|
||||
int reversealnumsort(struct _info **, struct _info **);
|
||||
int mtimesort(struct _info **, struct _info **);
|
||||
int ctimesort(struct _info **, struct _info **);
|
||||
int filesfirst(const void *, const void *);
|
||||
int dirsfirst(const void *, const void *);
|
||||
int alnumsort(const void *, const void *);
|
||||
int versort(const void *, const void *);
|
||||
int reversealnumsort(const void *, const void *);
|
||||
int mtimesort(const void *, const void *);
|
||||
int ctimesort(const void *, const void *);
|
||||
int sizecmp(off_t a, off_t b);
|
||||
int fsizesort(struct _info **a, struct _info **b);
|
||||
int fsizesort(const void *, const void *);
|
||||
|
||||
void *xmalloc(size_t), *xrealloc(void *, size_t);
|
||||
char *gnu_getcwd();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue