aboutsummaryrefslogtreecommitdiff
path: root/contrib/less/less.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/less/less.h')
-rw-r--r--contrib/less/less.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/contrib/less/less.h b/contrib/less/less.h
index 8f0d2d85e83c..078ccbbb43f7 100644
--- a/contrib/less/less.h
+++ b/contrib/less/less.h
@@ -71,6 +71,9 @@
#if HAVE_CTYPE_H
#include <ctype.h>
#endif
+#if HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
#if HAVE_LIMITS_H
#include <limits.h>
#endif
@@ -125,16 +128,23 @@ void free();
#undef IS_SPACE
#undef IS_DIGIT
-#if !HAVE_UPPER_LOWER
-#define IS_UPPER(c) ASCII_IS_UPPER(c)
-#define IS_LOWER(c) ASCII_IS_LOWER(c)
-#define TO_UPPER(c) ASCII_TO_UPPER(c)
-#define TO_LOWER(c) ASCII_TO_LOWER(c)
+#if HAVE_WCTYPE
+#define IS_UPPER(c) iswupper(c)
+#define IS_LOWER(c) iswlower(c)
+#define TO_UPPER(c) towupper(c)
+#define TO_LOWER(c) towlower(c)
#else
+#if HAVE_UPPER_LOWER
#define IS_UPPER(c) isupper((unsigned char) (c))
#define IS_LOWER(c) islower((unsigned char) (c))
#define TO_UPPER(c) toupper((unsigned char) (c))
#define TO_LOWER(c) tolower((unsigned char) (c))
+#else
+#define IS_UPPER(c) ASCII_IS_UPPER(c)
+#define IS_LOWER(c) ASCII_IS_LOWER(c)
+#define TO_UPPER(c) ASCII_TO_UPPER(c)
+#define TO_LOWER(c) ASCII_TO_LOWER(c)
+#endif
#endif
#ifdef isspace
@@ -187,6 +197,13 @@ void free();
#define BAD_LSEEK ((off_t)-1)
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+#ifndef SEEK_END
+#define SEEK_END 2
+#endif
+
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif
@@ -457,6 +474,9 @@ struct textlist
#define QUIT_ERROR 1
#define QUIT_SAVED_STATUS (-1)
+#define FOLLOW_DESC 0
+#define FOLLOW_NAME 1
+
/* filestate flags */
#define CH_CANSEEK 001
#define CH_KEEPOPEN 002