Data Structures | Macros
helpers.h File Reference
#include <stdbool.h>
#include "nvim/api/private/defs.h"
#include "nvim/vim.h"
#include "nvim/getchar.h"
#include "nvim/memory.h"
#include "nvim/ex_eval.h"
#include "nvim/lib/kvec.h"

Go to the source code of this file.

Data Structures

struct  TryState
 

Macros

#define OBJECT_OBJ(o)   o
 
#define BOOLEAN_OBJ(b)
 
#define INTEGER_OBJ(i)
 
#define FLOAT_OBJ(f)
 
#define STRING_OBJ(s)
 
#define BUFFER_OBJ(s)
 
#define WINDOW_OBJ(s)
 
#define TABPAGE_OBJ(s)
 
#define ARRAY_OBJ(a)
 
#define DICTIONARY_OBJ(d)
 
#define LUAREF_OBJ(r)
 
#define NIL   ((Object) {.type = kObjectTypeNil})
 
#define PUT(dict, k, v)   kv_push(dict, ((KeyValuePair) { .key = cstr_to_string(k), .value = v }))
 
#define ADD(array, item)   kv_push(array, item)
 
#define STATIC_CSTR_AS_STRING(s)   ((String) {.data = s, .size = sizeof(s) - 1})
 
#define STATIC_CSTR_TO_STRING(s)
 
#define api_init_boolean
 
#define api_init_integer
 
#define api_init_float
 
#define api_init_string   = STRING_INIT
 
#define api_init_buffer
 
#define api_init_window
 
#define api_init_tabpage
 
#define api_init_object   = NIL
 
#define api_init_array   = ARRAY_DICT_INIT
 
#define api_init_dictionary   = ARRAY_DICT_INIT
 
#define api_free_boolean(value)
 
#define api_free_integer(value)
 
#define api_free_float(value)
 
#define api_free_buffer(value)
 
#define api_free_window(value)
 
#define api_free_tabpage(value)
 

Macro Definition Documentation

#define ADD (   array,
  item 
)    kv_push(array, item)
#define api_free_boolean (   value)
#define api_free_buffer (   value)
#define api_free_float (   value)
#define api_free_integer (   value)
#define api_free_tabpage (   value)
#define api_free_window (   value)
#define api_init_array   = ARRAY_DICT_INIT
#define api_init_boolean
#define api_init_buffer
#define api_init_dictionary   = ARRAY_DICT_INIT
#define api_init_float
#define api_init_integer
#define api_init_object   = NIL
#define api_init_string   = STRING_INIT
#define api_init_tabpage
#define api_init_window
#define ARRAY_OBJ (   a)
Value:
((Object) { \
.type = kObjectTypeArray, \
.data.array = a })
struct object Object
Definition: defs.h:85
Definition: defs.h:105
#define BOOLEAN_OBJ (   b)
Value:
((Object) { \
.type = kObjectTypeBoolean, \
.data.boolean = b })
Definition: defs.h:101
struct object Object
Definition: defs.h:85
#define BUFFER_OBJ (   s)
Value:
((Object) { \
.type = kObjectTypeBuffer, \
.data.integer = s })
char * s
Definition: message.c:738
Definition: defs.h:109
struct object Object
Definition: defs.h:85
#define DICTIONARY_OBJ (   d)
Value:
((Object) { \
.data.dictionary = d })
Definition: defs.h:106
dict_T * d
Definition: eval.c:15062
struct object Object
Definition: defs.h:85
#define FLOAT_OBJ (   f)
Value:
((Object) { \
.type = kObjectTypeFloat, \
.data.floating = f })
Definition: defs.h:103
struct object Object
Definition: defs.h:85
#define INTEGER_OBJ (   i)
Value:
((Object) { \
.type = kObjectTypeInteger, \
.data.integer = i })
Definition: defs.h:102
struct object Object
Definition: defs.h:85
int i
Definition: typval.c:868
#define LUAREF_OBJ (   r)
Value:
((Object) { \
.type = kObjectTypeLuaRef, \
.data.luaref = r })
Definition: defs.h:107
struct object Object
Definition: defs.h:85
#define NIL   ((Object) {.type = kObjectTypeNil})
#define OBJECT_OBJ (   o)    o
#define PUT (   dict,
  k,
  v 
)    kv_push(dict, ((KeyValuePair) { .key = cstr_to_string(k), .value = v }))
#define STATIC_CSTR_AS_STRING (   s)    ((String) {.data = s, .size = sizeof(s) - 1})
#define STATIC_CSTR_TO_STRING (   s)
Value:
((String){ \
.data = xmemdupz(s, sizeof(s) - 1), \
.size = sizeof(s) - 1 })
Definition: defs.h:76
void * xmemdupz(const void *data, size_t len) FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
Definition: memory.c:195
char * s
Definition: message.c:738

Create a new String instance, putting data in allocated memory

Parameters
[in]sString to work with. Must be a string literal.
#define STRING_OBJ (   s)
Value:
((Object) { \
.type = kObjectTypeString, \
.data.string = s })
char * s
Definition: message.c:738
Definition: defs.h:104
struct object Object
Definition: defs.h:85
#define TABPAGE_OBJ (   s)
Value:
((Object) { \
.type = kObjectTypeTabpage, \
.data.integer = s })
char * s
Definition: message.c:738
struct object Object
Definition: defs.h:85
Definition: defs.h:111
#define WINDOW_OBJ (   s)
Value:
((Object) { \
.type = kObjectTypeWindow, \
.data.integer = s })
Definition: defs.h:110
char * s
Definition: message.c:738
struct object Object
Definition: defs.h:85