summaryrefslogtreecommitdiffstats
path: root/src/globals.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-17 14:57:05 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-17 14:57:05 +0200
commitcd52459c387785796713826c63174cdeed295dd4 (patch)
treef2c964f83534a80d539b44826baea085a41fa595 /src/globals.h
parent42ebd066422d73cdb7bda6a1dc828a3dd022dec8 (diff)
patch 7.4.2055v7.4.2055
Problem: eval.c is too big. Solution: Move Dictionary functions to dict.c.
Diffstat (limited to 'src/globals.h')
-rw-r--r--src/globals.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/globals.h b/src/globals.h
index 3c92510f1c..0493bd2be6 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1534,6 +1534,7 @@ EXTERN char_u e_readonly[] INIT(= N_("E45: 'readonly' option is set (add ! to ov
EXTERN char_u e_readonlyvar[] INIT(= N_("E46: Cannot change read-only variable \"%s\""));
EXTERN char_u e_readonlysbx[] INIT(= N_("E794: Cannot set variable in the sandbox: \"%s\""));
EXTERN char_u e_emptykey[] INIT(= N_("E713: Cannot use empty key for Dictionary"));
+EXTERN char_u e_dictreq[] INIT(= N_("E715: Dictionary required"));
#endif
#ifdef FEAT_QUICKFIX
EXTERN char_u e_readerrf[] INIT(= N_("E47: Error while reading errorfile"));
@@ -1644,6 +1645,21 @@ EXTERN int did_add_timer INIT(= FALSE);
#ifdef FEAT_EVAL
EXTERN time_T time_for_testing INIT(= 0);
+
+/*
+ * In a hashtab item "hi_key" points to "di_key" in a dictitem.
+ * This avoids adding a pointer to the hashtab item.
+ * DI2HIKEY() converts a dictitem pointer to a hashitem key pointer.
+ * HIKEY2DI() converts a hashitem key pointer to a dictitem pointer.
+ * HI2DI() converts a hashitem pointer to a dictitem pointer.
+ */
+EXTERN dictitem_T dumdi;
+# define DI2HIKEY(di) ((di)->di_key)
+# define HIKEY2DI(p) ((dictitem_T *)(p - (dumdi.di_key - (char_u *)&dumdi)))
+# define HI2DI(hi) HIKEY2DI((hi)->hi_key)
+
+/* Abort conversion to string after a recursion error. */
+EXTERN int did_echo_string_emsg INIT(= FALSE);
#endif
/*