summaryrefslogtreecommitdiff
path: root/src/vim.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-16 20:03:43 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-16 20:03:43 +0200
commit84cf6bd81bec93b49166cd48fccc7087fdbaa6fc (patch)
tree63d744fbf9ac7db5246a60b48aa0396aaaa22c18 /src/vim.h
parent9af78769eeae0318e07aa8b6af4d6e2244481ca7 (diff)
downloadvim-git-84cf6bd81bec93b49166cd48fccc7087fdbaa6fc.tar.gz
patch 8.2.0988: getting directory contents is always case sortedv8.2.0988
Problem: Getting directory contents is always case sorted. Solution: Add sort options and v:collate. (Christian Brabandt, closes #6229)
Diffstat (limited to 'src/vim.h')
-rw-r--r--src/vim.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/vim.h b/src/vim.h
index 0204aa306..2c2848cc7 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1599,6 +1599,11 @@ void *vim_memset(void *, int, size_t);
# define STRICMP(d, s) vim_stricmp((char *)(d), (char *)(s))
# endif
#endif
+#ifdef HAVE_STRCOLL
+# define STRCOLL(d, s) strcoll((char *)(d), (char *)(s))
+#else
+# define STRCOLL(d, s) strcmp((char *)(d), (char *)(s))
+#endif
// Like strcpy() but allows overlapped source and destination.
#define STRMOVE(d, s) mch_memmove((d), (s), STRLEN(s) + 1)
@@ -1896,7 +1901,7 @@ typedef int sock_T;
#define VALID_PATH 1
#define VALID_HEAD 2
-// Defines for Vim variables. These must match vimvars[] in eval.c!
+// Defines for Vim variables. These must match vimvars[] in evalvars.c!
#define VV_COUNT 0
#define VV_COUNT1 1
#define VV_PREVCOUNT 2
@@ -1992,7 +1997,8 @@ typedef int sock_T;
#define VV_VERSIONLONG 92
#define VV_ECHOSPACE 93
#define VV_ARGV 94
-#define VV_LEN 95 // number of v: vars
+#define VV_COLLATE 95
+#define VV_LEN 96 // number of v: vars
// used for v_number in VAR_BOOL and VAR_SPECIAL
#define VVAL_FALSE 0L // VAR_BOOL
@@ -2669,4 +2675,10 @@ long elapsed(DWORD start_tick);
#define FSK_IN_STRING 0x04 // TRUE in string, double quote is escaped
#define FSK_SIMPLIFY 0x08 // simplify <C-H> and <A-x>
+// Flags for the readdirex function, how to sort the result
+#define READDIR_SORT_NONE 0 // do not sort
+#define READDIR_SORT_BYTE 1 // sort by byte order (strcmp), default
+#define READDIR_SORT_IC 2 // sort ignoring case (strcasecmp)
+#define READDIR_SORT_COLLATE 3 // sort according to collation (strcoll)
+
#endif // VIM__H