]> ncurses.scripts.mit.edu Git - ncurses.git/blob - progs/progs.priv.h
ncurses 4.1
[ncurses.git] / progs / progs.priv.h
1
2 /***************************************************************************
3 *                            COPYRIGHT NOTICE                              *
4 ****************************************************************************
5 *                ncurses is copyright (C) 1992-1995                        *
6 *                          Zeyd M. Ben-Halim                               *
7 *                          zmbenhal@netcom.com                             *
8 *                          Eric S. Raymond                                 *
9 *                          esr@snark.thyrsus.com                           *
10 *                                                                          *
11 *        Permission is hereby granted to reproduce and distribute ncurses  *
12 *        by any means and for any fee, whether alone or as part of a       *
13 *        larger distribution, in source or in binary form, PROVIDED        *
14 *        this notice is included with any such distribution, and is not    *
15 *        removed from any of its header files. Mention of ncurses in any   *
16 *        applications linked with it is highly appreciated.                *
17 *                                                                          *
18 *        ncurses comes AS IS with no warranty, implied or expressed.       *
19 *                                                                          *
20 ***************************************************************************/
21
22 /*
23  * $Id: progs.priv.h,v 1.9 1997/04/05 23:38:08 tom Exp $
24  *
25  *      progs.priv.h
26  *
27  *      Header file for curses utility programs
28  *
29  */
30
31 #include <ncurses_cfg.h>
32
33 #ifdef USE_RCS_IDS
34 #define MODULE_ID(id) static const char Ident[] = id;
35 #else
36 #define MODULE_ID(id) /*nothing*/
37 #endif
38
39 #include <stdlib.h>
40 #include <string.h>
41 #include <sys/types.h>
42
43 #if HAVE_UNISTD_H
44 #include <unistd.h>
45 #else
46 # if HAVE_LIBC_H
47 # include <libc.h>
48 # endif
49 #endif
50
51 #if HAVE_SYS_BSDTYPES_H
52 #include <sys/bsdtypes.h>       /* needed for ISC */
53 #endif
54
55 #if HAVE_LIMITS_H
56 # include <limits.h>
57 #elif HAVE_SYS_PARAM_H
58 # include <sys/param.h>
59 #endif
60
61 #ifndef PATH_MAX
62 # if defined(_POSIX_PATH_MAX)
63 #  define PATH_MAX _POSIX_PATH_MAX
64 # elif defined(MAXPATHLEN)
65 #  define PATH_MAX MAXPATHLEN
66 # else
67 #  define PATH_MAX 255  /* the Posix minimum pathsize */
68 # endif
69 #endif
70
71 #if HAVE_DIRENT_H
72 # include <dirent.h>
73 # define NAMLEN(dirent) strlen((dirent)->d_name)
74 #else
75 # define dirent direct
76 # define NAMLEN(dirent) (dirent)->d_namlen
77 # if HAVE_SYS_NDIR_H
78 #  include <sys/ndir.h>
79 # endif
80 # if HAVE_SYS_DIR_H
81 #  include <sys/dir.h>
82 # endif
83 # if HAVE_NDIR_H
84 #  include <ndir.h>
85 # endif
86 #endif
87
88 #include <errno.h>
89
90 #if !HAVE_EXTERN_ERRNO
91 extern int errno;
92 #endif
93
94 #if HAVE_GETOPT_H
95 #include <getopt.h>
96 #else
97 /* 'getopt()' may be prototyped in <stdlib.h>, but declaring its
98  * variables doesn't hurt.
99  */
100 extern char *optarg;
101 extern int optind;
102 #endif /* HAVE_GETOPT_H */
103
104 #include <term.h>
105 #include <tic.h>
106 #include <nc_alloc.h>
107
108 /* usually in <unistd.h> */
109 #ifndef STDOUT_FILENO
110 #define STDOUT_FILENO 1
111 #endif
112
113 #ifndef STDERR_FILENO
114 #define STDERR_FILENO 2
115 #endif
116
117 #ifndef EXIT_SUCCESS
118 #define EXIT_SUCCESS 0
119 #endif
120
121 #ifndef EXIT_FAILURE
122 #define EXIT_FAILURE 1
123 #endif
124
125 #ifndef F_OK
126 #define F_OK    0               /* Test for existence.  */
127 #endif
128
129 /* usually in <unistd.h> */
130 #ifndef STDOUT_FILENO
131 #define STDOUT_FILENO 1
132 #endif
133
134 #ifndef STDERR_FILENO
135 #define STDERR_FILENO 2
136 #endif