aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/map.h
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-01-16 15:31:05 +0100
committerGitHub <noreply@github.com>2020-01-16 15:31:05 +0100
commit6e78b2162382718b638c4532a155e5c3f9ed7515 (patch)
tree5868096a30a61deed1765e1c9ec93072a4d0c34b /src/nvim/map.h
parent8ba3354d74a8f90ded0997100bdbe845a8c5382f (diff)
parentca1a00edd6d6345b848a28d077d6a192528f811e (diff)
downloadrneovim-6e78b2162382718b638c4532a155e5c3f9ed7515.tar.gz
rneovim-6e78b2162382718b638c4532a155e5c3f9ed7515.tar.bz2
rneovim-6e78b2162382718b638c4532a155e5c3f9ed7515.zip
Merge pull request #11563 from bfredl/mark_madness
extmarks: mark sanity/madness
Diffstat (limited to 'src/nvim/map.h')
-rw-r--r--src/nvim/map.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/nvim/map.h b/src/nvim/map.h
index 75ab64cca4..761938776d 100644
--- a/src/nvim/map.h
+++ b/src/nvim/map.h
@@ -4,9 +4,9 @@
#include <stdbool.h>
#include "nvim/map_defs.h"
+#include "nvim/mark_extended_defs.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/dispatch.h"
-#include "nvim/bufhl_defs.h"
#include "nvim/highlight_defs.h"
#if defined(__NetBSD__)
@@ -38,6 +38,18 @@ MAP_DECLS(int, int)
MAP_DECLS(cstr_t, ptr_t)
MAP_DECLS(ptr_t, ptr_t)
MAP_DECLS(uint64_t, ptr_t)
+MAP_DECLS(uint64_t, ssize_t)
+MAP_DECLS(uint64_t, uint64_t)
+
+// NB: this is the only way to define a struct both containing and contained
+// in a map...
+typedef struct ExtmarkNs { // For namespacing extmarks
+ Map(uint64_t, uint64_t) *map; // For fast lookup
+ uint64_t free_id; // For automatically assigning id's
+} ExtmarkNs;
+
+MAP_DECLS(uint64_t, ExtmarkNs)
+MAP_DECLS(uint64_t, ExtmarkItem)
MAP_DECLS(handle_T, ptr_t)
MAP_DECLS(String, MsgpackRpcRequestHandler)
MAP_DECLS(HlEntry, int)
@@ -53,6 +65,8 @@ MAP_DECLS(String, handle_T)
#define map_del(T, U) map_##T##_##U##_del
#define map_clear(T, U) map_##T##_##U##_clear
+#define map_size(map) ((map)->table->size)
+
#define pmap_new(T) map_new(T, ptr_t)
#define pmap_free(T) map_free(T, ptr_t)
#define pmap_get(T) map_get(T, ptr_t)