X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Fprogs.priv.h;h=362c3b38e64e7c66d0aed134dbcceaddf081a393;hp=3384d37c4e6dea01c97e86a765539ffb4ab5aab2;hb=2639531af0c3ca25b48e7bcb9c790fa566cc5892;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce diff --git a/progs/progs.priv.h b/progs/progs.priv.h index 3384d37c..362c3b38 100644 --- a/progs/progs.priv.h +++ b/progs/progs.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,10 +27,10 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1997,1998 * + * Author: Thomas E. Dickey 1997-on * ****************************************************************************/ /* - * $Id: progs.priv.h,v 1.19 1999/02/23 11:10:32 tom Exp $ + * $Id: progs.priv.h,v 1.32 2007/02/03 19:59:02 tom Exp $ * * progs.priv.h * @@ -39,7 +39,7 @@ #include -#ifdef USE_RCS_IDS +#if USE_RCS_IDS #define MODULE_ID(id) static const char Ident[] = id; #else #define MODULE_ID(id) /*nothing*/ @@ -52,10 +52,6 @@ #if HAVE_UNISTD_H #include -#else -# if HAVE_LIBC_H -# include -# endif #endif #if HAVE_SYS_BSDTYPES_H @@ -71,8 +67,17 @@ #if HAVE_DIRENT_H # include # 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 -# define dirent direct +# define DIRENT struct direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include @@ -104,7 +109,13 @@ extern int optind; #include #include #include +#include + #include +#if HAVE_NC_FREEALL +#undef ExitProgram +#define ExitProgram(code) _nc_free_tic(code) +#endif /* usually in */ #ifndef STDOUT_FILENO @@ -123,6 +134,18 @@ extern int optind; #define EXIT_FAILURE 1 #endif +#ifndef R_OK +#define R_OK 4 /* Test for readable. */ +#endif + +#ifndef W_OK +#define W_OK 2 /* Test for writable. */ +#endif + +#ifndef X_OK +#define X_OK 1 /* Test for executable. */ +#endif + #ifndef F_OK #define F_OK 0 /* Test for existence. */ #endif @@ -150,11 +173,15 @@ extern int optind; /* We use isascii only to guard against use of 7-bit ctype tables in the * isprint test in infocmp. */ -#ifndef HAVE_ISASCII +#if !HAVE_ISASCII # undef isascii # if ('z'-'a' == 25) && ('z' < 127) && ('Z'-'A' == 25) && ('Z' < 127) && ('9' < 127) -# define isascii(c) (((c) & 0xff) <= 127) +# define isascii(c) (UChar(c) <= 127) # else # define isascii(c) 1 /* not really ascii anyway */ # endif #endif + +#define UChar(c) ((unsigned char)(c)) + +#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))