1#define __STDC_WANT_LIB_EXT1__ 1
13 printf(
"\033[999C\033[6n");
73 if (newEntries ==
NULL)
95 if (nameLength > maxLength)
97 maxLength = nameLength;
102 uint32_t columnWidth = maxLength + 2;
103 if (columnWidth > terminalWidth)
105 columnWidth = terminalWidth;
107 uint32_t numColumns = terminalWidth / columnWidth;
115 for (
uint32_t row = 0; row < numRows; row++)
117 for (
uint32_t col = 0; col < numColumns; col++)
119 uint64_t index = col * numRows + row;
127 printf(
"\033[34m%s\033[0m/%-*s", name, columnWidth - (
int)
strlen(name) - 1,
"");
131 printf(
"%-*s", columnWidth, name);
#define MAX_NAME
Maximum length of names.
#define errno
Error number variable.
uint64_t getdents(fd_t fd, dirent_t *buffer, uint64_t count)
System call for reading directory entires.
uint64_t close(fd_t fd)
System call for closing files.
fd_t openf(const char *_RESTRICT format,...)
Wrapper for opening files with a formatted path.
uint64_t read(fd_t fd, void *buffer, uint64_t count)
System call for reading from files.
@ INODE_DIR
Is a directory.
#define NULL
Pointer error value.
__UINT64_TYPE__ fd_t
A file descriptor.
EFI_PHYSICAL_ADDRESS buffer
static uint64_t entryCount
static uint64_t terminal_columns_get(void)
static uint64_t print_dir(const char *path)
_PUBLIC int sscanf(const char *_RESTRICT s, const char *_RESTRICT format,...)
_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 * malloc(size_t size)
_PUBLIC void free(void *ptr)
_PUBLIC char * strerror(int errnum)
_PUBLIC size_t strlen(const char *s)