X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fport.h;h=4e65a9ace886cd611bd00fb0b168b75e38905652;hb=b216fed6340d073d33351145be033ecc5b903c7a;hp=4bf9d2c6b95eb7c06c5e6f896c5cf8658284c87e;hpb=f9a11075d98cfd0336a325e7c293853d5736f12c;p=chaz%2Ftar diff --git a/src/port.h b/src/port.h index 4bf9d2c..4e65a9a 100644 --- a/src/port.h +++ b/src/port.h @@ -62,7 +62,7 @@ char *alloca (); #define major(dev) (dev) #define minor(dev) (dev) typedef long off_t; -#endif /* __MSDOS__ */ +#endif /* __MSDOS__ */ #if defined(__STDC__) || defined(__TURBOC__) #define PTR void * @@ -93,7 +93,7 @@ typedef long off_t; #endif #undef HAVE_MAJOR -#if defined(STDC_HEADERS) || defined(USG) +#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include #if !defined(__MSDOS__) && !defined(STDC_HEADERS) #include @@ -116,17 +116,17 @@ typedef long off_t; #if defined(STDC_HEADERS) #include #else -char *malloc(), *realloc(); -char *getenv(); +char *malloc (), *realloc (); +char *getenv (); #endif #ifndef _POSIX_VERSION #ifdef __MSDOS__ #include -#else /* !__MSDOS__ */ -off_t lseek(); -#endif /* !__MSDOS__ */ -char *getcwd(); +#else /* !__MSDOS__ */ +off_t lseek (); +#endif /* !__MSDOS__ */ +char *getcwd (); #endif /* !_POSIX_VERSION */ #ifndef NULL @@ -175,16 +175,41 @@ char *getcwd(); #if !defined(S_ISSOCK) && defined(S_IFSOCK) #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) #endif -#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ +#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) #endif -#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ +#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) #endif -#if !defined(S_ISCTG) && defined(S_IFCTG) /* contiguous file */ +#if !defined(S_ISCTG) && defined(S_IFCTG) /* contiguous file */ #define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG) #endif #if !defined(S_ISVTX) #define S_ISVTX 0001000 #endif + +#ifdef __MSDOS__ +#include "msd_dir.h" +#define NLENGTH(direct) ((direct)->d_namlen) + +#else /* not __MSDOS__ */ + +#if defined(DIRENT) || defined(_POSIX_VERSION) +#include +#define NLENGTH(direct) (strlen((direct)->d_name)) +#else /* not (DIRENT or _POSIX_VERSION) */ +#define dirent direct +#define NLENGTH(direct) ((direct)->d_namlen) +#ifdef SYSNDIR +#include +#endif /* SYSNDIR */ +#ifdef SYSDIR +#include +#endif /* SYSDIR */ +#ifdef NDIR +#include +#endif /* NDIR */ +#endif /* DIRENT or _POSIX_VERSION */ + +#endif /* not __MSDOS__ */