1#define __STDC_WANT_LIB_EXT1__ 1
16 printf(
"\033[999C\033[6n");
69 if (
count == capacity)
73 if (newEntries ==
NULL)
150 if (colWidth > termWidth)
152 colWidth = termWidth;
155 uint32_t numCols = termWidth / colWidth;
163 for (
uint32_t r = 0; r < numRows; r++)
165 for (
uint32_t c = 0; c < numCols; c++)
174 const char* name = ent->
path;
200 for (
uint64_t i = len; i < colWidth; i++)
216 for (; i < argc; i++)
218 if (argv[i][0] !=
'-')
223 for (
int j = 1; argv[i][j] !=
'\0'; j++)
225 if (argv[i][j] ==
'a')
229 else if (argv[i][j] ==
'f')
250 for (; i < argc; i++)
#define MAX_NAME
Maximum length of names.
EFI_PHYSICAL_ADDRESS buffer
#define errno
Error number variable.
size_t getdents(fd_t fd, dirent_t *buffer, uint64_t count)
System call for reading directory entires.
fd_t open(const char *path)
System call for opening files.
uint64_t close(fd_t fd)
System call for closing files.
size_t read(fd_t fd, void *buffer, size_t count)
System call for reading from files.
#define STDIN_FILENO
Standard input file descriptor.
@ VSYMLINK
Is a symbolic link.
@ DIRENT_MOUNTED
The directory entry is a mountpoint.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINT64_TYPE__ fd_t
File descriptor type.
static uint64_t terminal_columns_get(void)
static int dirent_cmp(const void *a, const void *b)
static uint64_t print_dir(const char *path)
_PUBLIC int sscanf(const char *_RESTRICT s, const char *_RESTRICT format,...)
_PUBLIC int putchar(int c)
_PUBLIC int fflush(FILE *stream)
_PUBLIC int printf(const char *_RESTRICT format,...)
_PUBLIC int fprintf(FILE *_RESTRICT stream, const char *_RESTRICT format,...)
_PUBLIC void * realloc(void *ptr, size_t size)
_PUBLIC void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
_PUBLIC char * strerror(int errnum)
_PUBLIC char * strstr(const char *s1, const char *s2)
_PUBLIC size_t strlen(const char *s)
_PUBLIC int strcmp(const char *s1, const char *s2)
char path[MAX_PATH]
The relative path of the entry.
char mode[MAX_PATH]
The flags of the paths mount.