dir2list

generate a list of files shuffled by directory
git clone anongit@rnpnr.xyz:dir2list.git
Log | Files | Refs | Feed | README | LICENSE

Commit: ee8b5be1dd4f6c294964ea46083656fea79268d1
Parent: ce182f6ad31fd59657a05202745b19b5da41193f
Author: 0x766F6964
Date:   Sat, 17 Oct 2020 11:53:32 -0600

add comment about entry struct

Diffstat:
Mdir2list.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dir2list.c b/dir2list.c @@ -17,6 +17,7 @@ struct node { int a; /* Applied */ }; +/* this makes calls to qsort nicer */ struct entry { char *name; }; @@ -61,7 +62,7 @@ reallocarray(void *p, size_t n, size_t s) } static int -namecmp(const void *va, const void *vb) +entcmp(const void *va, const void *vb) { const struct entry *a = va, *b = vb; return strcmp(a->name, b->name); @@ -114,7 +115,7 @@ addfiles(const char *path) } closedir(dir); - qsort(&ents[n_ents - n], n, sizeof(struct entry), namecmp); + qsort(&ents[n_ents - n], n, sizeof(struct entry), entcmp); } /* Fill out the next field for all nodes */