Data Structures | Macros | Typedefs | Functions
map.h File Reference
#include <stdbool.h>
#include "nvim/api/private/defs.h"
#include "nvim/api/private/dispatch.h"
#include "nvim/extmark_defs.h"
#include "nvim/highlight_defs.h"
#include "nvim/map_defs.h"

Go to the source code of this file.

Data Structures

struct  ExtmarkNs
 

Macros

#define MAP_DECLS(T, U)
 
#define MAP_INIT   { { 0, 0, 0, 0, NULL, NULL, NULL } }
 
#define map_init(k, v, map)   do { *(map) = (Map(k, v)) MAP_INIT; } while (false)
 
#define map_destroy(T, U)   map_##T##_##U##_destroy
 
#define map_get(T, U)   map_##T##_##U##_get
 
#define map_has(T, U)   map_##T##_##U##_has
 
#define map_key(T, U)   map_##T##_##U##_key
 
#define map_put(T, U)   map_##T##_##U##_put
 
#define map_ref(T, U)   map_##T##_##U##_ref
 
#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_destroy(T)   map_destroy(T, ptr_t)
 
#define pmap_get(T)   map_get(T, ptr_t)
 
#define pmap_has(T)   map_has(T, ptr_t)
 
#define pmap_key(T)   map_key(T, ptr_t)
 
#define pmap_put(T)   map_put(T, ptr_t)
 
#define pmap_ref(T)   map_ref(T, ptr_t)
 
#define pmap_del(T)   map_del(T, ptr_t)
 
#define pmap_clear(T)   map_clear(T, ptr_t)
 
#define pmap_init(k, map)   map_init(k, ptr_t, map)
 
#define map_foreach(map, key, value, block)   kh_foreach(&(map)->table, key, value, block)
 
#define map_foreach_value(map, value, block)   kh_foreach_value(&(map)->table, value, block)
 

Typedefs

typedef struct ExtmarkNs ExtmarkNs
 

Functions

void pmap_del2 (PMap(cstr_t) *map, const char *key)
 

Macro Definition Documentation

◆ map_clear

#define map_clear (   T,
 
)    map_##T##_##U##_clear

◆ MAP_DECLS

#define MAP_DECLS (   T,
 
)
Value:
KHASH_DECLARE(T##_##U##_map, T, U) \
typedef struct { \
khash_t(T##_##U##_map) table; \
} Map(T, U); \
Map(T, U) *map_##T##_##U##_new(void); \
void map_##T##_##U##_free(Map(T, U) *map); \
void map_##T##_##U##_destroy(Map(T, U) *map); \
U map_##T##_##U##_get(Map(T, U) *map, T key); \
bool map_##T##_##U##_has(Map(T, U) *map, T key); \
T map_##T##_##U##_key(Map(T, U) *map, T key); \
U map_##T##_##U##_put(Map(T, U) *map, T key, U value); \
U *map_##T##_##U##_ref(Map(T, U) *map, T key, bool put); \
U map_##T##_##U##_del(Map(T, U) *map, T key); \
void map_##T##_##U##_clear(Map(T, U) *map);

◆ map_del

#define map_del (   T,
 
)    map_##T##_##U##_del

◆ map_destroy

#define map_destroy (   T,
 
)    map_##T##_##U##_destroy

◆ map_foreach

#define map_foreach (   map,
  key,
  value,
  block 
)    kh_foreach(&(map)->table, key, value, block)

◆ map_foreach_value

#define map_foreach_value (   map,
  value,
  block 
)    kh_foreach_value(&(map)->table, value, block)

◆ map_get

#define map_get (   T,
 
)    map_##T##_##U##_get

◆ map_has

#define map_has (   T,
 
)    map_##T##_##U##_has

◆ MAP_INIT

#define MAP_INIT   { { 0, 0, 0, 0, NULL, NULL, NULL } }

◆ map_init

#define map_init (   k,
  v,
  map 
)    do { *(map) = (Map(k, v)) MAP_INIT; } while (false)

◆ map_key

#define map_key (   T,
 
)    map_##T##_##U##_key

◆ map_put

#define map_put (   T,
 
)    map_##T##_##U##_put

◆ map_ref

#define map_ref (   T,
 
)    map_##T##_##U##_ref

◆ map_size

#define map_size (   map)    ((map)->table.size)

◆ pmap_clear

#define pmap_clear (   T)    map_clear(T, ptr_t)

◆ pmap_del

#define pmap_del (   T)    map_del(T, ptr_t)
See also
pmap_del2

◆ pmap_destroy

#define pmap_destroy (   T)    map_destroy(T, ptr_t)

◆ pmap_get

#define pmap_get (   T)    map_get(T, ptr_t)

◆ pmap_has

#define pmap_has (   T)    map_has(T, ptr_t)

◆ pmap_init

#define pmap_init (   k,
  map 
)    map_init(k, ptr_t, map)

◆ pmap_key

#define pmap_key (   T)    map_key(T, ptr_t)

◆ pmap_put

#define pmap_put (   T)    map_put(T, ptr_t)

◆ pmap_ref

#define pmap_ref (   T)    map_ref(T, ptr_t)

Typedef Documentation

◆ ExtmarkNs

typedef struct ExtmarkNs ExtmarkNs

Function Documentation

◆ pmap_del2()

void pmap_del2 ( PMap(cstr_t) *  map,
const char *  key 
)

Deletes a key:value pair from a string:pointer map, and frees the storage of both key and value.

put
void put(String str) FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY
_
#define _(x)
Definition: gettext.h:20
KHASH_DECLARE
#define KHASH_DECLARE(name, khkey_t, khval_t)
Definition: khash.h:420
Map
#define Map(T, U)
Definition: map_defs.h:9
T
#define T
Definition: marktree.c:56