Annotation of src/usr.bin/tic/progs.priv.h, Revision 1.1
1.1 ! millert 1: /* $OpenBSD$ */
! 2:
! 3: /****************************************************************************
! 4: * Copyright (c) 1998 Free Software Foundation, Inc. *
! 5: * *
! 6: * Permission is hereby granted, free of charge, to any person obtaining a *
! 7: * copy of this software and associated documentation files (the *
! 8: * "Software"), to deal in the Software without restriction, including *
! 9: * without limitation the rights to use, copy, modify, merge, publish, *
! 10: * distribute, distribute with modifications, sublicense, and/or sell *
! 11: * copies of the Software, and to permit persons to whom the Software is *
! 12: * furnished to do so, subject to the following conditions: *
! 13: * *
! 14: * The above copyright notice and this permission notice shall be included *
! 15: * in all copies or substantial portions of the Software. *
! 16: * *
! 17: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
! 18: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
! 19: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
! 20: * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
! 21: * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
! 22: * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
! 23: * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
! 24: * *
! 25: * Except as contained in this notice, the name(s) of the above copyright *
! 26: * holders shall not be used in advertising or otherwise to promote the *
! 27: * sale, use or other dealings in this Software without prior written *
! 28: * authorization. *
! 29: ****************************************************************************/
! 30:
! 31: /****************************************************************************
! 32: * Author: Thomas E. Dickey <dickey@clark.net> 1997,1998 *
! 33: ****************************************************************************/
! 34: /*
! 35: * $From: progs.priv.h,v 1.18 1998/07/25 17:38:51 tom Exp $
! 36: *
! 37: * progs.priv.h
! 38: *
! 39: * Header file for curses utility programs
! 40: */
! 41:
! 42: #include <ncurses_cfg.h>
! 43:
! 44: #ifdef USE_RCS_IDS
! 45: #define MODULE_ID(id) static const char Ident[] = id;
! 46: #else
! 47: #define MODULE_ID(id) /*nothing*/
! 48: #endif
! 49:
! 50: #include <stdlib.h>
! 51: #include <ctype.h>
! 52: #include <string.h>
! 53: #include <sys/types.h>
! 54:
! 55: #if HAVE_UNISTD_H
! 56: #include <unistd.h>
! 57: #else
! 58: # if HAVE_LIBC_H
! 59: # include <libc.h>
! 60: # endif
! 61: #endif
! 62:
! 63: #if HAVE_SYS_BSDTYPES_H
! 64: #include <sys/bsdtypes.h> /* needed for ISC */
! 65: #endif
! 66:
! 67: #if HAVE_LIMITS_H
! 68: # include <limits.h>
! 69: #elif HAVE_SYS_PARAM_H
! 70: # include <sys/param.h>
! 71: #endif
! 72:
! 73: #if HAVE_DIRENT_H
! 74: # include <dirent.h>
! 75: # define NAMLEN(dirent) strlen((dirent)->d_name)
! 76: #else
! 77: # define dirent direct
! 78: # define NAMLEN(dirent) (dirent)->d_namlen
! 79: # if HAVE_SYS_NDIR_H
! 80: # include <sys/ndir.h>
! 81: # endif
! 82: # if HAVE_SYS_DIR_H
! 83: # include <sys/dir.h>
! 84: # endif
! 85: # if HAVE_NDIR_H
! 86: # include <ndir.h>
! 87: # endif
! 88: #endif
! 89:
! 90: #include <errno.h>
! 91:
! 92: #if DECL_ERRNO
! 93: extern int errno;
! 94: #endif
! 95:
! 96: #if HAVE_GETOPT_H
! 97: #include <getopt.h>
! 98: #else
! 99: /* 'getopt()' may be prototyped in <stdlib.h>, but declaring its
! 100: * variables doesn't hurt.
! 101: */
! 102: extern char *optarg;
! 103: extern int optind;
! 104: #endif /* HAVE_GETOPT_H */
! 105:
! 106: #include <curses.h>
! 107: #include <term.h>
! 108: #include <tic.h>
! 109: #include <nc_alloc.h>
! 110:
! 111: /* usually in <unistd.h> */
! 112: #ifndef STDOUT_FILENO
! 113: #define STDOUT_FILENO 1
! 114: #endif
! 115:
! 116: #ifndef STDERR_FILENO
! 117: #define STDERR_FILENO 2
! 118: #endif
! 119:
! 120: #ifndef EXIT_SUCCESS
! 121: #define EXIT_SUCCESS 0
! 122: #endif
! 123:
! 124: #ifndef EXIT_FAILURE
! 125: #define EXIT_FAILURE 1
! 126: #endif
! 127:
! 128: #ifndef F_OK
! 129: #define F_OK 0 /* Test for existence. */
! 130: #endif
! 131:
! 132: /* usually in <unistd.h> */
! 133: #ifndef STDOUT_FILENO
! 134: #define STDOUT_FILENO 1
! 135: #endif
! 136:
! 137: #ifndef STDERR_FILENO
! 138: #define STDERR_FILENO 2
! 139: #endif
! 140:
! 141: /* may be in limits.h, included from various places */
! 142: #ifndef PATH_MAX
! 143: # if defined(_POSIX_PATH_MAX)
! 144: # define PATH_MAX _POSIX_PATH_MAX
! 145: # elif defined(MAXPATHLEN)
! 146: # define PATH_MAX MAXPATHLEN
! 147: # else
! 148: # define PATH_MAX 255 /* the Posix minimum pathsize */
! 149: # endif
! 150: #endif
! 151:
! 152: /* We use isascii only to guard against use of 7-bit ctype tables in the
! 153: * isprint test in infocmp.
! 154: */
! 155: #ifndef HAVE_ISASCII
! 156: # undef isascii
! 157: # if ('z'-'a' == 25) && ('z' < 127) && ('Z'-'A' == 25) && ('Z' < 127) && ('9' < 127)
! 158: # define isascii(c) (((c) & 0xff) <= 127)
! 159: # else
! 160: # define isascii(c) 1 /* not really ascii anyway */
! 161: # endif
! 162: #endif