diff options
author | Gene Cumm <gene.cumm@gmail.com> | 2009-02-10 22:18:18 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-02-10 21:33:08 -0800 |
commit | 3d17ee8d11838b6380818f144ed04c188c775df5 (patch) | |
tree | a360e8f1858f57b6d84fcf43a9d35dfb72dae995 /com32/include | |
parent | c1def425e3eeb245da7a59025f2fa37f02368504 (diff) | |
download | syslinux-elf-3d17ee8d11838b6380818f144ed04c188c775df5.tar.gz syslinux-elf-3d17ee8d11838b6380818f144ed04c188c775df5.tar.xz syslinux-elf-3d17ee8d11838b6380818f144ed04c188c775df5.zip |
COM32 API: Add functions for directory use
COM32: Add directory functions getcwd(), opendir(), readdir() and closedir().
This depends on the patch that I just submitted creating the COMBOOT API calls.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/include')
-rw-r--r-- | com32/include/dirent.h | 36 | ||||
-rw-r--r-- | com32/include/unistd.h | 3 |
2 files changed, 39 insertions, 0 deletions
diff --git a/com32/include/dirent.h b/com32/include/dirent.h new file mode 100644 index 00000000..956b911d --- /dev/null +++ b/com32/include/dirent.h @@ -0,0 +1,36 @@ +/* + * dirent.h + */ + +#ifndef _DIRENT_H +#define _DIRENT_H + +#include <klibc/extern.h> +#include <klibc/compiler.h> +#include <stddef.h> +#include <sys/types.h> + +#ifndef NAME_MAX +#define NAME_MAX 255 +#endif + +struct dirent { + long d_ino; /* Inode/File number */ + off_t d_size; /* Size of file */ + mode_t d_mode; /* Type of file */ + char d_name[NAME_MAX + 1]; +}; + +typedef struct { + short dd_stat; /* status return from last lookup */ + uint16_t dd_fd; + size_t dd_sect; + char dd_name[NAME_MAX + 1]; /* directory */ +} DIR; + +__extern DIR *opendir(const char *); +__extern struct dirent *readdir(DIR *); +__extern int closedir(DIR *); +__extern DIR *fdopendir(int); + +#endif /* Not _DIRENT_H */ diff --git a/com32/include/unistd.h b/com32/include/unistd.h index d0b8309c..c0b52d60 100644 --- a/com32/include/unistd.h +++ b/com32/include/unistd.h @@ -22,6 +22,9 @@ __extern int isatty(int); __extern int getscreensize(int, int *, int *); +__extern char *getcwd(char *, int); +__extern int chdir(const char *); + /* Standard file descriptor numbers. */ #define STDIN_FILENO 0 #define STDOUT_FILENO 1 |