#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/gettext.h"
#include "nvim/hashtab.h"
#include "nvim/lib/queue.h"
#include "nvim/macros.h"
#include "nvim/mbyte.h"
#include "nvim/message.h"
#include "nvim/pos.h"
#include "nvim/profile.h"
#include "nvim/types.h"
Go to the source code of this file.
Data Structures | |
struct | Callback |
struct | dict_watcher |
Structure holding dictionary watcher. More... | |
struct | typval_T |
Structure that holds an internal variable value. More... | |
union | typval_T::typval_vval_union |
struct | listitem_S |
struct | listwatch_S |
struct | listvar_S |
struct | staticList10_T |
struct | dictvar_S |
Structure representing a Dictionary. More... | |
struct | blobvar_S |
Structure to hold info about a Blob. More... | |
struct | sctx_T |
struct | funccall_S |
struct | ufunc |
Structure to hold info for a user function. More... | |
struct | partial_S |
struct | ht_stack_S |
Structure used for explicit stack while garbage collecting hash tables. More... | |
struct | list_stack_S |
Structure used for explicit stack while garbage collecting lists. More... | |
struct | ListSortItem |
Structure representing one list item, used for sort array. More... | |
Macros | |
#define | VARNUMBER_MAX INT64_MAX |
Maximal possible value of varnumber_T variable. More... | |
#define | UVARNUMBER_MAX UINT64_MAX |
#define | VARNUMBER_MIN INT64_MIN |
Minimal possible value of varnumber_T variable. More... | |
#define | PRIdVARNUMBER PRId64 |
d printf format specifier for varnumber_T More... | |
#define | CALLBACK_INIT { .type = kCallbackNone } |
#define | CALLBACK_NONE ((Callback)CALLBACK_INIT) |
#define | TV_LIST_STATIC10_INIT |
#define | TV_DICTITEM_STRUCT(...) |
#define | PRIdSCID "d" |
Format argument for scid_T. More... | |
#define | MAX_FUNC_ARGS 20 |
Maximum number of function arguments. More... | |
#define | VAR_SHORT_LEN 20 |
Short variable name length. More... | |
#define | FIXVAR_CNT 12 |
Number of fixed variables used for arguments. More... | |
#define | list_log(...) |
#define | list_write_log(...) |
#define | list_free_log() |
#define | TV_DICT_HI2DI(hi) ((dictitem_T *)((hi)->hi_key - offsetof(dictitem_T, di_key))) |
Convert a hashitem pointer to a dictitem pointer. More... | |
#define | TV_INITIAL_VALUE |
#define | _TV_LIST_ITER_MOD(modifier, l, li, code) |
#define | TV_LIST_ITER(l, li, code) _TV_LIST_ITER_MOD( , l, li, code) |
#define | TV_LIST_ITER_CONST(l, li, code) _TV_LIST_ITER_MOD(const, l, li, code) |
#define | TV_LIST_ITEM_TV(li) (&(li)->li_tv) |
#define | TV_LIST_ITEM_NEXT(l, li) ((li)->li_next) |
#define | TV_LIST_ITEM_PREV(l, li) ((li)->li_prev) |
#define | TV_DICT_ITER(d, di, code) |
#define | TV_TRANSLATE (SIZE_MAX) |
#define | TV_CSTRING (SIZE_MAX - 1) |
Typedefs | |
typedef int64_t | varnumber_T |
Type used for VimL VAR_NUMBER values. More... | |
typedef uint64_t | uvarnumber_T |
typedef double | float_T |
Type used for VimL VAR_FLOAT values. More... | |
typedef struct listvar_S | list_T |
typedef struct dictvar_S | dict_T |
typedef struct partial_S | partial_T |
typedef struct blobvar_S | blob_T |
typedef struct ufunc | ufunc_T |
typedef struct dict_watcher | DictWatcher |
Structure holding dictionary watcher. More... | |
typedef struct listitem_S | listitem_T |
Structure to hold an item of a list. More... | |
typedef struct listwatch_S | listwatch_T |
Structure used by those that are using an item in a list. More... | |
typedef int | scid_T |
Type used for script ID. More... | |
typedef int(* | cfunc_T) (int argcount, typval_T *argvars, typval_T *rettv, void *state) |
typedef void(* | cfunc_free_T) (void *state) |
Callback to clear cfunc_T and any associated state. More... | |
typedef struct funccall_S | funccall_T |
typedef struct ht_stack_S | ht_stack_T |
Structure used for explicit stack while garbage collecting hash tables. More... | |
typedef struct list_stack_S | list_stack_T |
Structure used for explicit stack while garbage collecting lists. More... | |
typedef int(* | ListSorter) (const void *, const void *) |
Functions | |
typedef | TV_DICTITEM_STRUCT (1) ScopeDictDictItem |
typedef | TV_DICTITEM_STRUCT () dictitem_T |
bool | semsg (const char *const fmt,...) |
Print an error message with unknown number of arguments. More... | |
Variables | |
const char *const | tv_empty_string |
bool | tv_in_free_unref_items |
Specifies that free_unref_items() function has (not) been entered. More... | |
Iterate over a list
modifier | Modifier: expected to be const or nothing, volatile should also work if you have any uses for the volatile list. | |
[in] | l | List to iterate over. |
li | Name of the variable with current listitem_T entry. | |
code | Cycle body. |
#define CALLBACK_INIT { .type = kCallbackNone } |
#define CALLBACK_NONE ((Callback)CALLBACK_INIT) |
#define FIXVAR_CNT 12 |
Number of fixed variables used for arguments.
#define list_free_log | ( | ) |
#define list_log | ( | ... | ) |
#define list_write_log | ( | ... | ) |
#define MAX_FUNC_ARGS 20 |
Maximum number of function arguments.
#define PRIdSCID "d" |
Format argument for scid_T.
#define PRIdVARNUMBER PRId64 |
d printf format specifier for varnumber_T
#define TV_CSTRING (SIZE_MAX - 1) |
Specify that argument is a NUL-terminated C string
Used for size_t length arguments to avoid calling strlen() unless needed.
#define TV_DICT_HI2DI | ( | hi | ) | ((dictitem_T *)((hi)->hi_key - offsetof(dictitem_T, di_key))) |
Convert a hashitem pointer to a dictitem pointer.
#define TV_DICT_ITER | ( | d, | |
di, | |||
code | |||
) |
Iterate over a dictionary
[in] | d | Dictionary to iterate over. |
di | Name of the variable with current dictitem_T entry. | |
code | Cycle body. |
#define TV_DICTITEM_STRUCT | ( | ... | ) |
#define TV_INITIAL_VALUE |
Get next list item given the current one
[in] | l | List to get item from. |
[in] | li | List item to get typval_T from. |
Get previous list item given the current one
[in] | l | List to get item from. |
[in] | li | List item to get typval_T from. |
#define TV_LIST_ITER | ( | l, | |
li, | |||
code | |||
) | _TV_LIST_ITER_MOD( , l, li, code) |
Iterate over a list
To be used when you need to modify list or values you iterate over, use TV_LIST_ITER_CONST if you don’t.
[in] | l | List to iterate over. |
li | Name of the variable with current listitem_T entry. | |
code | Cycle body. |
#define TV_LIST_ITER_CONST | ( | l, | |
li, | |||
code | |||
) | _TV_LIST_ITER_MOD(const, l, li, code) |
Iterate over a list
To be used when you don’t need to modify list or values you iterate over, use TV_LIST_ITER if you do.
[in] | l | List to iterate over. |
li | Name of the variable with current listitem_T entry. | |
code | Cycle body. |
#define TV_LIST_STATIC10_INIT |
#define TV_TRANSLATE (SIZE_MAX) |
Specify that argument needs to be translated
Used for size_t length arguments to avoid calling gettext() and strlen() unless needed.
#define UVARNUMBER_MAX UINT64_MAX |
#define VAR_SHORT_LEN 20 |
Short variable name length.
#define VARNUMBER_MAX INT64_MAX |
Maximal possible value of varnumber_T variable.
#define VARNUMBER_MIN INT64_MIN |
Minimal possible value of varnumber_T variable.
Callback interface for C function reference> Used for managing functions that were registered with |register_cfunc|
typedef struct dict_watcher DictWatcher |
Structure holding dictionary watcher.
typedef double float_T |
Type used for VimL VAR_FLOAT values.
typedef struct funccall_S funccall_T |
typedef struct ht_stack_S ht_stack_T |
Structure used for explicit stack while garbage collecting hash tables.
typedef struct list_stack_S list_stack_T |
Structure used for explicit stack while garbage collecting lists.
typedef struct listitem_S listitem_T |
Structure to hold an item of a list.
typedef struct listwatch_S listwatch_T |
Structure used by those that are using an item in a list.
typedef int scid_T |
Type used for script ID.
typedef uint64_t uvarnumber_T |
typedef int64_t varnumber_T |
Type used for VimL VAR_NUMBER values.
enum BoolVarValue |
enum CallbackType |
enum DictItemFlags |
enum ListLenSpecials |
Additional values for tv_list_alloc() len argument.
enum ScopeType |
Values for (struct dictvar_S).dv_scope.
Enumerator | |
---|---|
VAR_NO_SCOPE | Not a scope dictionary. |
VAR_SCOPE | Scope dictionary which requires prefix (a:, v:, …). |
VAR_DEF_SCOPE | Scope dictionary which may be accessed without prefix (l:, g:). |
enum SpecialVarValue |
enum VarLockStatus |
Variable lock status for typval_T.v_lock.
Enumerator | |
---|---|
VAR_UNLOCKED | Not locked. |
VAR_LOCKED | User lock, can be unlocked. |
VAR_FIXED | Locked forever. |
enum VarType |
VimL variable types, for use in typval_T.v_type.
Enumerator | |
---|---|
VAR_UNKNOWN | Unknown (unspecified) value. |
VAR_NUMBER | Number, .v_number is used. |
VAR_STRING | String, .v_string is used. |
VAR_FUNC | Function reference, .v_string is used as function name. |
VAR_LIST | List, .v_list is used. |
VAR_DICT | Dictionary, .v_dict is used. |
VAR_FLOAT | Floating-point value, .v_float is used. |
VAR_BOOL | true, false |
VAR_SPECIAL | Special value (null), .v_special is used. |
VAR_PARTIAL | Partial, .v_partial is used. |
VAR_BLOB | Blob, .v_blob is used. |
bool semsg | ( | const char *const | fmt, |
... | |||
) |
Print an error message with unknown number of arguments.
typedef TV_DICTITEM_STRUCT | ( | ) |
Structure to hold an item of a Dictionary
Also used for a variable.
typedef TV_DICTITEM_STRUCT | ( | 1 | ) |
Structure to hold a scope dictionary
For use in find_var_in_ht to pretend that it found dictionary item when it finds scope dictionary.
const char* const tv_empty_string |
Empty string
Needed for hack which allows not allocating empty string and still not crashing when freeing it.
bool tv_in_free_unref_items |
Specifies that free_unref_items() function has (not) been entered.