2
dir.c (plib.h plibu.h pstdlib.h) <unistd.h sys/types.h sys/stat.h>
3
DIRENT_HEADER undef, <sys/dir.h>, <sys/ndir.h>, <ndir.h>
4
set only if <dirent.h> not present
6
set to use getwd instead of getcwd
8
files.c (pstdio.h pstdlib.h plibu.h) <string.h unistd.h>
11
see README.fpu for list of FPU_* macros
13
fputest.c is related to fpuset.c
15
getpath.c (plib.h pstdlib.h)
17
handler.c (plib.h) <signal.h>
19
main.c (plib.h pstdlib.h plibu.h) <setjmp.h>
21
pathnm.c (plib.h pstdlib.h) <string.h>
22
NO_PASSWD -- define to skip ~user expansion, otherwise
23
<sys/types.h unistd.h pwd.h>
26
HDR_WITH_TIOCGPGRP -- if undef, <sgtty.h>
27
- pgrp.c only necessary for systems missing tcgetpgrp
29
stdinit.c (plib.h pstdlib.h pstdio.h plibu.h) <string.h>
32
USE_GETRUSAGE -- (preferred if present) <sys/time.h sys/resource.h>
33
USE_TIMES -- (POSIX standard) <time.h sys/times.h>
34
else -- (ANSI C standard) <time.h>
37
USE_GETTIMEOFDAY -- (X11 uses this) <sys/time.h>
38
else -- (ANSI C standard) <time.h>
40
uevent.c (plibu.h pstdlib.h) <errno.h>
41
USE_SELECT -- use upoll.c implementation of poll (upoll.h)
42
else -- use system poll (preferred)
43
USE_SYS_POLL_H <sys/poll.h>
46
ugetc.c (pstdio.h plibu.h ugetc.h)
48
uinbg.c (plibu.h) <sys/types.h>
50
upoll.c (upoll.h pstdlib.h)
51
HAVE_SYS_SELECT_H <sys/select.h>
53
NO_SYS_TIME_H <time.h> else <sys/time.h>
54
NEED_SELECT_PROTO <sys/types.h>
56
usernm.c (plib.h pstdlib.h)
57
NO_PASSWD -- use cuserid function
58
else -- <sys/types.h unistd.h pwd.h>
60
waiter.c (plib.h plibu.h)
66
Notes on UNIX variants
67
----------------------
69
Required headers not part of ANSI C standard:
71
<unistd.h> dir.c usernm.c
72
chdir rmdir getcwd (in dir.c)
73
getlogin getuid (to implement cuserid in usernm.c)
74
<sys/types.h> dir.c usernm.c
76
stat S_IFDIR (in dir.c)
78
or one of: <sys/dir.h>, <sys/ndir.h>, or <ndir.h>
79
opendir readdir closedir (in dir.c)
80
<pwd.h> usernm.c, pathnm.c (unused if NO_PASSWD set)
81
getpwnam (to expand ~user/* pathnames)
82
getpwuid (to implement cuserid in usernm.c)
84
pathname expansion: (pathnm.c)
86
$ENVVAR $(ENVVAR) ${ENVVAR}
87
$ENVVAR/path $(ENVVAR)/path ${ENVVAR}/path
90
are all expanded by u_pathname, which is used in every plib
91
function requiring a pathname
92
~ is the same as $HOME, but if no such environment variable exists
93
and NO_PASSWD is not set, tries to get the home directory for
95
~user will not work if NO_PASSWD is set
99
Old style is struct direct instead of struct dirent; directory
100
functions may be in <sys/dir.h>, <sys/ndir.h>, or <ndir.h>
101
Autoconf manual notes that d_namlen member may be missing from
102
struct dirent (present in struct direct); that raises the
103
possibility that d_name is not a 0-terminated string
104
-- xfig source assumes that it is, so I do too
105
DIRENT_HEADER - if no dirent.h, set to <sys/dir.h> etc
109
SunOS deprecates use of getcwd in favor of getwd,
110
but apparently getcwd is more portable (getwd is non-POSIX)...
111
Comments in HPUX unistd.h indicate that original POSIX.1 1988
112
definition had second parameter of type int; POSIX now size_t
113
NextOS has no getwd, at least in some old versions
114
USE_GETWD - define to use getwd instead of getcwd
118
cuserid was removed from POSIX due to a religious war over
119
whether it should return the real or effective username
120
I call getlogin(), then getpwuid(getuid())
121
NO_PASSWD - define to use cuserid (requires no headers)