From: Thomas M. <tma...@ze...> - 2000-12-11 21:15:30
|
John Palmieri wrote: > It seems as if S_IFDIR is defined on my Debian GNU linux and on > FreeBSD. Should it not also be defined on HPUX? I am having trouble > with the tests in configure for checking headers - AC_EGREP_HEADER. > Please check the sys/stat.h for this decleration. In my experience with > C/C++ if a macro is prepended by underscores it is mostly only supposed > to be used internaly and is given a public alias without the underscores > if it ment to be used externaly. > > --Quinticent > > _______________________________________________ > somelib-devel mailing list > som...@li... > http://lists.sourceforge.net/mailman/listinfo/somelib-devel Here is the whole kit and caboodle from HP's sys/stat.h. So there is a S_IFDIR macro on HPUX. /* Symbols and macros for decoding the value of st_mode */ #ifdef _INCLUDE_POSIX_SOURCE # ifndef S_IRWXU /* fcntl.h might have already defined these */ # define S_ISUID 0004000 /* set user ID on execution */ # define S_ISGID 0002000 /* set group ID on execution */ # define S_IRWXU 0000700 /* read, write, execute permission (owner) */ # define S_IRUSR 0000400 /* read permission (owner) */ # define S_IWUSR 0000200 /* write permission (owner) */ # define S_IXUSR 0000100 /* execute permission (owner) */ # define S_IRWXG 0000070 /* read, write, execute permission (group) */ # define S_IRGRP 0000040 /* read permission (group) */ # define S_IWGRP 0000020 /* write permission (group) */ # define S_IXGRP 0000010 /* execute permission (group) */ # define S_IRWXO 0000007 /* read, write, execute permission (other) */ # define S_IROTH 0000004 /* read permission (other) */ # define S_IWOTH 0000002 /* write permission (other) */ # define S_IXOTH 0000001 /* execute permission (other) */ # endif /* S_IRWXU */ # define _S_IFMT 0170000 /* type of file */ # define _S_IFREG 0100000 /* regular */ # define _S_IFBLK 0060000 /* block special */ # define _S_IFCHR 0020000 /* character special */ # define _S_IFDIR 0040000 /* directory */ # define _S_IFIFO 0010000 /* pipe or FIFO */ # define S_ISDIR(_M) ((_M & _S_IFMT)==_S_IFDIR) /* test for directory */ # define S_ISCHR(_M) ((_M & _S_IFMT)==_S_IFCHR) /* test for char special */ # define S_ISBLK(_M) ((_M & _S_IFMT)==_S_IFBLK) /* test for block special */ # define S_ISREG(_M) ((_M & _S_IFMT)==_S_IFREG) /* test for regular file */ # define S_ISFIFO(_M) ((_M & _S_IFMT)==_S_IFIFO) /* test for pipe or FIFO */ #endif /* _INCLUDE_POSIX_SOURCE */ #ifdef _INCLUDE_POSIX4_SOURCE /* P1003.4/D14.1 */ # define S_TYPEISMQ(buf) (0) /* 5.6.1.1 */ # define S_TYPEISSEM(buf) (0) /* 5.6.1.1 */ # define S_TYPEISSHM(buf) (0) /* 5.6.1.1 */ #endif /* _INCLUDE_POSIX4_SOURCE */ #ifdef _INCLUDE_XOPEN_SOURCE # define S_IFMT _S_IFMT /* type of file */ # define S_IFBLK _S_IFBLK /* block special */ # define S_IFCHR _S_IFCHR /* character special */ # define S_IFDIR _S_IFDIR /* directory */ # define S_IFIFO _S_IFIFO /* pipe or FIFO */ # define S_IFREG _S_IFREG /* regular */ # ifndef _XPG4 # define S_ISVTX 0001000 /* save swapped text even after use */ # endif /* not _XPG4 */ #endif /* _INCLUDE_XOPEN_SOURCE */ #ifdef _INCLUDE_AES_SOURCE # define S_IFLNK 0120000 /* symbolic link */ # define S_ISLNK(_M) ((_M & S_IFMT)==S_IFLNK) /* test for symbolic link */ #endif /* _INCLUDE_AES_SOURCE */ #ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED # ifndef S_ISVTX # define S_ISVTX 0001000 /* save swapped text even after use */ # endif /* not S_ISVTX */ # define S_IFSOCK 0140000 /* socket */ # define S_ISSOCK(_M) ((_M & S_IFMT)==S_IFSOCK) /* test for socket */ #endif /* _INCLUDE_XOPEN_SOURCE_EXTENDED */ #ifdef _INCLUDE_HPUX_SOURCE # define S_CDF 0004000 /* hidden directory */ # define S_ENFMT 0002000 /* enforced file locking (shared w/ S_ISGID) */ # define S_IFNWK 0110000 /* network special */ # define S_ISNWK(_M) ((_M & S_IFMT)==S_IFNWK) /* test for network special */ # define S_ISCDF(_M) (S_ISDIR(_M) && (_M & S_CDF)) /* test for hidden dir */ /* Some synonyms used historically in the kernel and elsewhere */ # define S_IREAD S_IRUSR /* read permission, owner */ # define S_IWRITE S_IWUSR /* write permission, owner */ # define S_IEXEC S_IXUSR /* execute/search permission, owner */ # define st_rsite st_rcnode #endif /* _INCLUDE_HPUX_SOURCE */ #ifdef _UNSUPPORTED -- Thomas O Matelich Senior Software Designer Zetec, Inc. sos...@us... tma...@ze... |