X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=posix.h;h=ca30edb9958f5727951bde50cf17088991b7cf78;hb=fdfcdca978ffcb21472d0b0f6025557678ff35da;hp=33ca96ccbb04c6164cff63e122dfb0215355c8f5;hpb=a86e9a3e58f55bf49d99dfd5e5d6413e17149593;p=libpicofe.git diff --git a/posix.h b/posix.h index 33ca96c..ca30edb 100644 --- a/posix.h +++ b/posix.h @@ -1,3 +1,6 @@ +#ifndef LIBPICOFE_POSIX_H +#define LIBPICOFE_POSIX_H + /* define POSIX stuff: dirent, scandir, getcwd, mkdir */ #if defined(__linux__) || defined(__MINGW32__) @@ -14,10 +17,23 @@ #define DT_DIR 0 #endif +#elif defined(__PSP__) + +#include +#include +#include + +/* map PSP names to posix. needs special scandir() function to mask rwx bits */ +#define d_type d_stat.st_attr +#define DT_LNK FIO_SO_IFLNK +#define DT_DIR FIO_SO_IFDIR +#define DT_REG FIO_SO_IFREG +#define DT_UNKNOWN 0 + #else #error "must provide posix" #endif - +#endif // LIBPICOFE_POSIX_H