man stat.h
The following symbolic names for the values of type mode_t shall also
be defined.
File type:
S_IFMT Type of file.
S_IFBLK
Block special.
S_IFCHR
Character special.
S_IFIFO
FIFO special.
S_IFREG
Regular.
S_IFDIR
Directory.
...
The following macros shall be provided to test whether a file is of the
specified type. The value m supplied to the macros is the value of
st_mode from a stat structure. The macro shall evaluate to a non-zero
value if the test is true; 0 if the test is false.
S_ISBLK(m)
Test for a block special file.
S_ISCHR(m)
Test for a character special file.
S_ISDIR(m)
Test for a directory.
S_ISFIFO(m)
Test for a pipe or FIFO special file.
S_ISREG(m)
Test for a regular file.
S_ISLNK(m)
Test for a symbolic link.
S_ISSOCK(m)
Test for a socket.
существует ли что-то вроде этого для Си?
Прошу если не ответить на вопрос прямо, то хотя бы ткнуть мордой в нужную литературу, чтобы почитать.
int n = *w++;