version 1.8, 2001/01/22 18:02:20 |
version 1.9, 2010/01/12 23:22:14 |
|
|
/* $OpenBSD$ */ |
/* $OpenBSD$ */ |
|
|
/**************************************************************************** |
/**************************************************************************** |
* Copyright (c) 1998-2000 Free Software Foundation, Inc. * |
* Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * |
* * |
* * |
* Permission is hereby granted, free of charge, to any person obtaining a * |
* Permission is hereby granted, free of charge, to any person obtaining a * |
* copy of this software and associated documentation files (the * |
* copy of this software and associated documentation files (the * |
|
|
****************************************************************************/ |
****************************************************************************/ |
|
|
/**************************************************************************** |
/**************************************************************************** |
* Author: Thomas E. Dickey <dickey@clark.net> 1997,1998 * |
* Author: Thomas E. Dickey 1997-on * |
****************************************************************************/ |
****************************************************************************/ |
/* |
/* |
* $From: progs.priv.h,v 1.26 2000/11/05 00:22:05 tom Exp $ |
* $Id$ |
* |
* |
* progs.priv.h |
* progs.priv.h |
* |
* |
|
|
|
|
#if HAVE_UNISTD_H |
#if HAVE_UNISTD_H |
#include <unistd.h> |
#include <unistd.h> |
#else |
|
# if HAVE_LIBC_H |
|
# include <libc.h> |
|
# endif |
|
#endif |
#endif |
|
|
#if HAVE_SYS_BSDTYPES_H |
#if HAVE_SYS_BSDTYPES_H |
|
|
#if HAVE_DIRENT_H |
#if HAVE_DIRENT_H |
# include <dirent.h> |
# include <dirent.h> |
# define NAMLEN(dirent) strlen((dirent)->d_name) |
# define NAMLEN(dirent) strlen((dirent)->d_name) |
|
# if defined(_FILE_OFFSET_BITS) && defined(HAVE_STRUCT_DIRENT64) |
|
# if !defined(_LP64) && (_FILE_OFFSET_BITS == 64) |
|
# define DIRENT struct dirent64 |
|
# else |
|
# define DIRENT struct dirent |
|
# endif |
|
# else |
|
# define DIRENT struct dirent |
|
# endif |
#else |
#else |
# define dirent direct |
# define DIRENT struct direct |
# define NAMLEN(dirent) (dirent)->d_namlen |
# define NAMLEN(dirent) (dirent)->d_namlen |
# if HAVE_SYS_NDIR_H |
# if HAVE_SYS_NDIR_H |
# include <sys/ndir.h> |
# include <sys/ndir.h> |
|
|
# endif |
# endif |
#endif |
#endif |
|
|
|
#include <assert.h> |
#include <errno.h> |
#include <errno.h> |
|
|
#if DECL_ERRNO |
#if DECL_ERRNO |
|
|
#include <curses.h> |
#include <curses.h> |
#include <term_entry.h> |
#include <term_entry.h> |
#include <tic.h> |
#include <tic.h> |
|
#include <nc_tparm.h> |
|
|
#include <nc_alloc.h> |
#include <nc_alloc.h> |
|
#if HAVE_NC_FREEALL |
|
#undef ExitProgram |
|
#ifdef USE_LIBTINFO |
|
#define ExitProgram(code) _nc_free_tinfo(code) |
|
#else |
|
#define ExitProgram(code) _nc_free_tic(code) |
|
#endif |
|
#endif |
|
|
/* usually in <unistd.h> */ |
/* usually in <unistd.h> */ |
#ifndef STDOUT_FILENO |
#ifndef STDOUT_FILENO |
|
|
#if !HAVE_ISASCII |
#if !HAVE_ISASCII |
# undef isascii |
# undef isascii |
# if ('z'-'a' == 25) && ('z' < 127) && ('Z'-'A' == 25) && ('Z' < 127) && ('9' < 127) |
# if ('z'-'a' == 25) && ('z' < 127) && ('Z'-'A' == 25) && ('Z' < 127) && ('9' < 127) |
# define isascii(c) (CharOf(c) <= 127) |
# define isascii(c) (UChar(c) <= 127) |
# else |
# else |
# define isascii(c) 1 /* not really ascii anyway */ |
# define isascii(c) 1 /* not really ascii anyway */ |
# endif |
# endif |
#endif |
#endif |
|
|
#define CharOf(c) ((unsigned char)(c)) |
#define UChar(c) ((unsigned char)(c)) |
|
|
#define SIZEOF(v) (sizeof(v)/sizeof(v[0])) |
#define SIZEOF(v) (sizeof(v)/sizeof(v[0])) |