X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=bootcensus;a=blobdiff_plain;f=src%2Flibc%2Fdirent.h;fp=src%2Flibc%2Fdirent.h;h=7f0da64fd2b7415ecb758fc5d1ce4b15433197fd;hp=0000000000000000000000000000000000000000;hb=78e3e75fc7b5838d0261c876d00e1b8c3e0bcfe0;hpb=7b6f6de2124e28ae7da5599a7cdaf2c171c4f15e diff --git a/src/libc/dirent.h b/src/libc/dirent.h new file mode 100644 index 0000000..7f0da64 --- /dev/null +++ b/src/libc/dirent.h @@ -0,0 +1,42 @@ +/* +pcboot - bootable PC demo/game kernel +Copyright (C) 2018-2019 John Tsiombikas + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY, without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#ifndef DIRENT_H_ +#define DIRENT_H_ + +typedef struct DIR DIR; + +enum { + DT_UNKNOWN = 0, + DT_DIR = 4, + DT_REG = 8 +}; + +struct dirent { + char d_name[256]; + unsigned char d_type; + long d_fsize; +}; + +DIR *opendir(const char *path); +int closedir(DIR *dir); + +void rewinddir(DIR *dir); + +struct dirent *readdir(DIR *dir); + +#endif /* DIRENT_H_ */