mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 23:08:16 +00:00
refactor: format header files with uncrustify #15877
* refactor: format header files with uncrustify * fixup(justin): skip formatting of terminfo_defs.h * fixup: force winsock2 to be included first * fixup: simplify disable/enable directive to "uncrustify:off/on"
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
#ifndef NVIM_API_PRIVATE_DEFS_H
|
#ifndef NVIM_API_PRIVATE_DEFS_H
|
||||||
#define NVIM_API_PRIVATE_DEFS_H
|
#define NVIM_API_PRIVATE_DEFS_H
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
|
|
||||||
#define ARRAY_DICT_INIT {.size = 0, .capacity = 0, .items = NULL}
|
#define ARRAY_DICT_INIT { .size = 0, .capacity = 0, .items = NULL }
|
||||||
#define STRING_INIT {.data = NULL, .size = 0}
|
#define STRING_INIT { .data = NULL, .size = 0 }
|
||||||
#define OBJECT_INIT { .type = kObjectTypeNil }
|
#define OBJECT_INIT { .type = kObjectTypeNil }
|
||||||
#define ERROR_INIT { .type = kErrorTypeNone, .msg = NULL }
|
#define ERROR_INIT { .type = kErrorTypeNone, .msg = NULL }
|
||||||
#define REMOTE_TYPE(type) typedef handle_T type
|
#define REMOTE_TYPE(type) typedef handle_T type
|
||||||
|
@@ -4,12 +4,12 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/vim.h"
|
|
||||||
#include "nvim/getchar.h"
|
|
||||||
#include "nvim/memory.h"
|
|
||||||
#include "nvim/decoration.h"
|
#include "nvim/decoration.h"
|
||||||
#include "nvim/ex_eval.h"
|
#include "nvim/ex_eval.h"
|
||||||
|
#include "nvim/getchar.h"
|
||||||
#include "nvim/lib/kvec.h"
|
#include "nvim/lib/kvec.h"
|
||||||
|
#include "nvim/memory.h"
|
||||||
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
#define OBJECT_OBJ(o) o
|
#define OBJECT_OBJ(o) o
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
name.size = fixsize; \
|
name.size = fixsize; \
|
||||||
name.items = name##__items; \
|
name.items = name##__items; \
|
||||||
|
|
||||||
#define STATIC_CSTR_AS_STRING(s) ((String) {.data = s, .size = sizeof(s) - 1})
|
#define STATIC_CSTR_AS_STRING(s) ((String) { .data = s, .size = sizeof(s) - 1 })
|
||||||
|
|
||||||
/// Create a new String instance, putting data in allocated memory
|
/// Create a new String instance, putting data in allocated memory
|
||||||
///
|
///
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
#ifndef NVIM_EVAL_DECODE_H
|
#ifndef NVIM_EVAL_DECODE_H
|
||||||
#define NVIM_EVAL_DECODE_H
|
#define NVIM_EVAL_DECODE_H
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#include <msgpack.h>
|
#include <msgpack.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/globals.h"
|
#include "nvim/globals.h"
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
#ifndef NVIM_EVAL_ENCODE_H
|
#ifndef NVIM_EVAL_ENCODE_H
|
||||||
#define NVIM_EVAL_ENCODE_H
|
#define NVIM_EVAL_ENCODE_H
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#include <msgpack.h>
|
#include <msgpack.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
@@ -49,8 +48,7 @@ static inline ListReaderState encode_init_lrstate(const list_T *const list)
|
|||||||
.offset = 0,
|
.offset = 0,
|
||||||
.li_length = (TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string == NULL
|
.li_length = (TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string == NULL
|
||||||
? 0
|
? 0
|
||||||
: STRLEN(TV_LIST_ITEM_TV(
|
: STRLEN(TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string)),
|
||||||
tv_list_first(list))->vval.v_string)),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,23 +1,23 @@
|
|||||||
#ifndef NVIM_EVAL_TYPVAL_H
|
#ifndef NVIM_EVAL_TYPVAL_H
|
||||||
#define NVIM_EVAL_TYPVAL_H
|
#define NVIM_EVAL_TYPVAL_H
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "nvim/types.h"
|
|
||||||
#include "nvim/hashtab.h"
|
|
||||||
#include "nvim/garray.h"
|
|
||||||
#include "nvim/mbyte.h"
|
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
#include "nvim/lib/queue.h"
|
#include "nvim/garray.h"
|
||||||
#include "nvim/profile.h" // for proftime_T
|
|
||||||
#include "nvim/pos.h" // for linenr_T
|
|
||||||
#include "nvim/gettext.h"
|
#include "nvim/gettext.h"
|
||||||
#include "nvim/message.h"
|
#include "nvim/hashtab.h"
|
||||||
|
#include "nvim/lib/queue.h"
|
||||||
#include "nvim/macros.h"
|
#include "nvim/macros.h"
|
||||||
|
#include "nvim/mbyte.h"
|
||||||
|
#include "nvim/message.h"
|
||||||
|
#include "nvim/pos.h" // for linenr_T
|
||||||
|
#include "nvim/profile.h" // for proftime_T
|
||||||
|
#include "nvim/types.h"
|
||||||
#ifdef LOG_LIST_ACTIONS
|
#ifdef LOG_LIST_ACTIONS
|
||||||
# include "nvim/memory.h"
|
# include "nvim/memory.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -206,7 +206,7 @@ typedef struct {
|
|||||||
.lv_used_next = NULL, \
|
.lv_used_next = NULL, \
|
||||||
.lv_used_prev = NULL, \
|
.lv_used_prev = NULL, \
|
||||||
}, \
|
}, \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TV_DICTITEM_STRUCT(...) \
|
#define TV_DICTITEM_STRUCT(...) \
|
||||||
struct { \
|
struct { \
|
||||||
@@ -452,10 +452,8 @@ static inline void list_log(const list_T *const l,
|
|||||||
/// @param[in] li1 List item 1.
|
/// @param[in] li1 List item 1.
|
||||||
/// @param[in] li2 List item 2, often used for integers and not list items.
|
/// @param[in] li2 List item 2, often used for integers and not list items.
|
||||||
/// @param[in] action Logged action.
|
/// @param[in] action Logged action.
|
||||||
static inline void list_log(const list_T *const l,
|
static inline void list_log(const list_T *const l, const listitem_T *const li1,
|
||||||
const listitem_T *const li1,
|
const listitem_T *const li2, const char *const action)
|
||||||
const listitem_T *const li2,
|
|
||||||
const char *const action)
|
|
||||||
{
|
{
|
||||||
ListLog *tgt;
|
ListLog *tgt;
|
||||||
if (list_log_first == NULL) {
|
if (list_log_first == NULL) {
|
||||||
@@ -538,8 +536,7 @@ static inline VarLockStatus tv_list_locked(const list_T *const l)
|
|||||||
///
|
///
|
||||||
/// @param[out] l List to modify.
|
/// @param[out] l List to modify.
|
||||||
/// @param[in] lock New lock status.
|
/// @param[in] lock New lock status.
|
||||||
static inline void tv_list_set_lock(list_T *const l,
|
static inline void tv_list_set_lock(list_T *const l, const VarLockStatus lock)
|
||||||
const VarLockStatus lock)
|
|
||||||
{
|
{
|
||||||
if (l == NULL) {
|
if (l == NULL) {
|
||||||
assert(lock == VAR_FIXED);
|
assert(lock == VAR_FIXED);
|
||||||
@@ -554,8 +551,7 @@ static inline void tv_list_set_lock(list_T *const l,
|
|||||||
///
|
///
|
||||||
/// @param[out] l List to modify.
|
/// @param[out] l List to modify.
|
||||||
/// @param[in] copyid New copyID.
|
/// @param[in] copyid New copyID.
|
||||||
static inline void tv_list_set_copyid(list_T *const l,
|
static inline void tv_list_set_copyid(list_T *const l, const int copyid)
|
||||||
const int copyid)
|
|
||||||
FUNC_ATTR_NONNULL_ALL
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
l->lv_copyID = copyid;
|
l->lv_copyID = copyid;
|
||||||
@@ -907,8 +903,7 @@ bool emsgf(const char *const fmt, ...);
|
|||||||
/// @param[out] ret_f Location where resulting float is stored.
|
/// @param[out] ret_f Location where resulting float is stored.
|
||||||
///
|
///
|
||||||
/// @return true in case of success, false if tv is not a number or float.
|
/// @return true in case of success, false if tv is not a number or float.
|
||||||
static inline bool tv_get_float_chk(const typval_T *const tv,
|
static inline bool tv_get_float_chk(const typval_T *const tv, float_T *const ret_f)
|
||||||
float_T *const ret_f)
|
|
||||||
{
|
{
|
||||||
if (tv->v_type == VAR_FLOAT) {
|
if (tv->v_type == VAR_FLOAT) {
|
||||||
*ret_f = tv->vval.v_float;
|
*ret_f = tv->vval.v_float;
|
||||||
|
@@ -240,15 +240,15 @@
|
|||||||
///
|
///
|
||||||
/// This name will only be used by one of the above macros which are defined by
|
/// This name will only be used by one of the above macros which are defined by
|
||||||
/// the caller. Functions defined here do not use first argument directly.
|
/// the caller. Functions defined here do not use first argument directly.
|
||||||
#include <stddef.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "nvim/lib/kvec.h"
|
|
||||||
#include "nvim/eval/typval.h"
|
|
||||||
#include "nvim/eval/encode.h"
|
#include "nvim/eval/encode.h"
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/eval/typval_encode.h"
|
#include "nvim/eval/typval_encode.h"
|
||||||
|
#include "nvim/func_attr.h"
|
||||||
|
#include "nvim/lib/kvec.h"
|
||||||
|
|
||||||
/// Dummy variable used because some macros need lvalue
|
/// Dummy variable used because some macros need lvalue
|
||||||
///
|
///
|
||||||
@@ -262,7 +262,7 @@ static inline int _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(
|
|||||||
const MPConvStack *const mpstack, const int copyID,
|
const MPConvStack *const mpstack, const int copyID,
|
||||||
const MPConvStackValType conv_type,
|
const MPConvStackValType conv_type,
|
||||||
const char *const objname)
|
const char *const objname)
|
||||||
REAL_FATTR_NONNULL_ARG(2, 3, 4, 7) REAL_FATTR_WARN_UNUSED_RESULT
|
REAL_FATTR_NONNULL_ARG(2, 3, 4, 7) REAL_FATTR_WARN_UNUSED_RESULT
|
||||||
REAL_FATTR_ALWAYS_INLINE;
|
REAL_FATTR_ALWAYS_INLINE;
|
||||||
|
|
||||||
/// Function for checking whether container references itself
|
/// Function for checking whether container references itself
|
||||||
@@ -280,10 +280,8 @@ static inline int _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(
|
|||||||
///
|
///
|
||||||
/// @return NOTDONE in case of success, what to return in case of failure.
|
/// @return NOTDONE in case of success, what to return in case of failure.
|
||||||
static inline int _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(
|
static inline int _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(
|
||||||
TYPVAL_ENCODE_FIRST_ARG_TYPE TYPVAL_ENCODE_FIRST_ARG_NAME,
|
TYPVAL_ENCODE_FIRST_ARG_TYPE TYPVAL_ENCODE_FIRST_ARG_NAME, void *const val, int *const val_copyID,
|
||||||
void *const val, int *const val_copyID,
|
const MPConvStack *const mpstack, const int copyID, const MPConvStackValType conv_type,
|
||||||
const MPConvStack *const mpstack, const int copyID,
|
|
||||||
const MPConvStackValType conv_type,
|
|
||||||
const char *const objname)
|
const char *const objname)
|
||||||
{
|
{
|
||||||
if (*val_copyID == copyID) {
|
if (*val_copyID == copyID) {
|
||||||
@@ -299,7 +297,7 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
|||||||
MPConvStack *const mpstack, MPConvStackVal *const cur_mpsv,
|
MPConvStack *const mpstack, MPConvStackVal *const cur_mpsv,
|
||||||
typval_T *const tv, const int copyID,
|
typval_T *const tv, const int copyID,
|
||||||
const char *const objname)
|
const char *const objname)
|
||||||
REAL_FATTR_NONNULL_ARG(2, 4, 6) REAL_FATTR_WARN_UNUSED_RESULT;
|
REAL_FATTR_NONNULL_ARG(2, 4, 6) REAL_FATTR_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
/// Convert single value
|
/// Convert single value
|
||||||
///
|
///
|
||||||
@@ -319,36 +317,29 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
|||||||
///
|
///
|
||||||
/// @return OK in case of success, FAIL in case of failure.
|
/// @return OK in case of success, FAIL in case of failure.
|
||||||
static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
||||||
TYPVAL_ENCODE_FIRST_ARG_TYPE TYPVAL_ENCODE_FIRST_ARG_NAME,
|
TYPVAL_ENCODE_FIRST_ARG_TYPE TYPVAL_ENCODE_FIRST_ARG_NAME, MPConvStack *const mpstack,
|
||||||
MPConvStack *const mpstack, MPConvStackVal *const cur_mpsv,
|
MPConvStackVal *const cur_mpsv, typval_T *const tv, const int copyID, const char *const objname)
|
||||||
typval_T *const tv, const int copyID,
|
|
||||||
const char *const objname)
|
|
||||||
{
|
{
|
||||||
switch (tv->v_type) {
|
switch (tv->v_type) {
|
||||||
case VAR_STRING: {
|
case VAR_STRING:
|
||||||
TYPVAL_ENCODE_CONV_STRING(tv, tv->vval.v_string, tv_strlen(tv));
|
TYPVAL_ENCODE_CONV_STRING(tv, tv->vval.v_string, tv_strlen(tv));
|
||||||
break;
|
break;
|
||||||
}
|
case VAR_NUMBER:
|
||||||
case VAR_NUMBER: {
|
|
||||||
TYPVAL_ENCODE_CONV_NUMBER(tv, tv->vval.v_number);
|
TYPVAL_ENCODE_CONV_NUMBER(tv, tv->vval.v_number);
|
||||||
break;
|
break;
|
||||||
}
|
case VAR_FLOAT:
|
||||||
case VAR_FLOAT: {
|
|
||||||
TYPVAL_ENCODE_CONV_FLOAT(tv, tv->vval.v_float);
|
TYPVAL_ENCODE_CONV_FLOAT(tv, tv->vval.v_float);
|
||||||
break;
|
break;
|
||||||
}
|
case VAR_BLOB:
|
||||||
case VAR_BLOB: {
|
|
||||||
TYPVAL_ENCODE_CONV_BLOB(tv, tv->vval.v_blob,
|
TYPVAL_ENCODE_CONV_BLOB(tv, tv->vval.v_blob,
|
||||||
tv_blob_len(tv->vval.v_blob));
|
tv_blob_len(tv->vval.v_blob));
|
||||||
break;
|
break;
|
||||||
}
|
case VAR_FUNC:
|
||||||
case VAR_FUNC: {
|
|
||||||
TYPVAL_ENCODE_CONV_FUNC_START(tv, tv->vval.v_string);
|
TYPVAL_ENCODE_CONV_FUNC_START(tv, tv->vval.v_string);
|
||||||
TYPVAL_ENCODE_CONV_FUNC_BEFORE_ARGS(tv, 0);
|
TYPVAL_ENCODE_CONV_FUNC_BEFORE_ARGS(tv, 0);
|
||||||
TYPVAL_ENCODE_CONV_FUNC_BEFORE_SELF(tv, -1);
|
TYPVAL_ENCODE_CONV_FUNC_BEFORE_SELF(tv, -1);
|
||||||
TYPVAL_ENCODE_CONV_FUNC_END(tv);
|
TYPVAL_ENCODE_CONV_FUNC_END(tv);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case VAR_PARTIAL: {
|
case VAR_PARTIAL: {
|
||||||
partial_T *const pt = tv->vval.v_partial;
|
partial_T *const pt = tv->vval.v_partial;
|
||||||
(void)pt;
|
(void)pt;
|
||||||
@@ -391,25 +382,21 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
|||||||
TYPVAL_ENCODE_CONV_REAL_LIST_AFTER_START(tv, _mp_last(*mpstack));
|
TYPVAL_ENCODE_CONV_REAL_LIST_AFTER_START(tv, _mp_last(*mpstack));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VAR_BOOL: {
|
case VAR_BOOL:
|
||||||
switch (tv->vval.v_bool) {
|
switch (tv->vval.v_bool) {
|
||||||
case kBoolVarTrue:
|
case kBoolVarTrue:
|
||||||
case kBoolVarFalse: {
|
case kBoolVarFalse:
|
||||||
TYPVAL_ENCODE_CONV_BOOL(tv, tv->vval.v_bool == kBoolVarTrue);
|
TYPVAL_ENCODE_CONV_BOOL(tv, tv->vval.v_bool == kBoolVarTrue);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
case VAR_SPECIAL:
|
||||||
case VAR_SPECIAL: {
|
|
||||||
switch (tv->vval.v_special) {
|
switch (tv->vval.v_special) {
|
||||||
case kSpecialVarNull: {
|
case kSpecialVarNull:
|
||||||
TYPVAL_ENCODE_CONV_NIL(tv); // -V1037
|
TYPVAL_ENCODE_CONV_NIL(tv); // -V1037
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case VAR_DICT: {
|
case VAR_DICT: {
|
||||||
if (tv->vval.v_dict == NULL
|
if (tv->vval.v_dict == NULL
|
||||||
|| tv->vval.v_dict->dv_hashtab.ht_used == 0) {
|
|| tv->vval.v_dict->dv_hashtab.ht_used == 0) {
|
||||||
@@ -435,17 +422,15 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
|||||||
goto _convert_one_value_regular_dict;
|
goto _convert_one_value_regular_dict;
|
||||||
}
|
}
|
||||||
switch ((MessagePackType)i) {
|
switch ((MessagePackType)i) {
|
||||||
case kMPNil: {
|
case kMPNil:
|
||||||
TYPVAL_ENCODE_CONV_NIL(tv);
|
TYPVAL_ENCODE_CONV_NIL(tv);
|
||||||
break;
|
break;
|
||||||
}
|
case kMPBoolean:
|
||||||
case kMPBoolean: {
|
|
||||||
if (val_di->di_tv.v_type != VAR_NUMBER) {
|
if (val_di->di_tv.v_type != VAR_NUMBER) {
|
||||||
goto _convert_one_value_regular_dict;
|
goto _convert_one_value_regular_dict;
|
||||||
}
|
}
|
||||||
TYPVAL_ENCODE_CONV_BOOL(tv, val_di->di_tv.vval.v_number);
|
TYPVAL_ENCODE_CONV_BOOL(tv, val_di->di_tv.vval.v_number);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case kMPInteger: {
|
case kMPInteger: {
|
||||||
const list_T *val_list;
|
const list_T *val_list;
|
||||||
varnumber_T sign;
|
varnumber_T sign;
|
||||||
@@ -502,13 +487,12 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kMPFloat: {
|
case kMPFloat:
|
||||||
if (val_di->di_tv.v_type != VAR_FLOAT) {
|
if (val_di->di_tv.v_type != VAR_FLOAT) {
|
||||||
goto _convert_one_value_regular_dict;
|
goto _convert_one_value_regular_dict;
|
||||||
}
|
}
|
||||||
TYPVAL_ENCODE_CONV_FLOAT(tv, val_di->di_tv.vval.v_float);
|
TYPVAL_ENCODE_CONV_FLOAT(tv, val_di->di_tv.vval.v_float);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case kMPString:
|
case kMPString:
|
||||||
case kMPBinary: {
|
case kMPBinary: {
|
||||||
const bool is_string = ((MessagePackType)i == kMPString);
|
const bool is_string = ((MessagePackType)i == kMPString);
|
||||||
@@ -537,8 +521,7 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
|||||||
_TYPVAL_ENCODE_DO_CHECK_SELF_REFERENCE(val_di->di_tv.vval.v_list,
|
_TYPVAL_ENCODE_DO_CHECK_SELF_REFERENCE(val_di->di_tv.vval.v_list,
|
||||||
lv_copyID, copyID,
|
lv_copyID, copyID,
|
||||||
kMPConvList);
|
kMPConvList);
|
||||||
TYPVAL_ENCODE_CONV_LIST_START(
|
TYPVAL_ENCODE_CONV_LIST_START(tv, tv_list_len(val_di->di_tv.vval.v_list));
|
||||||
tv, tv_list_len(val_di->di_tv.vval.v_list));
|
|
||||||
assert(saved_copyID != copyID && saved_copyID != copyID - 1);
|
assert(saved_copyID != copyID && saved_copyID != copyID - 1);
|
||||||
_mp_push(*mpstack, ((MPConvStackVal) {
|
_mp_push(*mpstack, ((MPConvStackVal) {
|
||||||
.tv = tv,
|
.tv = tv,
|
||||||
@@ -606,8 +589,7 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
|||||||
size_t len;
|
size_t len;
|
||||||
char *buf;
|
char *buf;
|
||||||
if (!(
|
if (!(
|
||||||
encode_vim_list_to_buf(
|
encode_vim_list_to_buf(TV_LIST_ITEM_TV(tv_list_last(val_list))->vval.v_list, &len,
|
||||||
TV_LIST_ITEM_TV(tv_list_last(val_list))->vval.v_list, &len,
|
|
||||||
&buf))) {
|
&buf))) {
|
||||||
goto _convert_one_value_regular_dict;
|
goto _convert_one_value_regular_dict;
|
||||||
}
|
}
|
||||||
@@ -642,11 +624,10 @@ _convert_one_value_regular_dict: {}
|
|||||||
_mp_last(*mpstack));
|
_mp_last(*mpstack));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VAR_UNKNOWN: {
|
case VAR_UNKNOWN:
|
||||||
internal_error(STR(_TYPVAL_ENCODE_CONVERT_ONE_VALUE) "()");
|
internal_error(STR(_TYPVAL_ENCODE_CONVERT_ONE_VALUE) "()");
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
typval_encode_stop_converting_one_item:
|
typval_encode_stop_converting_one_item:
|
||||||
return OK;
|
return OK;
|
||||||
// Prevent “unused label” warnings.
|
// Prevent “unused label” warnings.
|
||||||
@@ -656,7 +637,7 @@ typval_encode_stop_converting_one_item:
|
|||||||
TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE(
|
TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE(
|
||||||
TYPVAL_ENCODE_FIRST_ARG_TYPE TYPVAL_ENCODE_FIRST_ARG_NAME,
|
TYPVAL_ENCODE_FIRST_ARG_TYPE TYPVAL_ENCODE_FIRST_ARG_NAME,
|
||||||
typval_T *const tv, const char *const objname)
|
typval_T *const tv, const char *const objname)
|
||||||
REAL_FATTR_NONNULL_ARG(2, 3) REAL_FATTR_WARN_UNUSED_RESULT;
|
REAL_FATTR_NONNULL_ARG(2, 3) REAL_FATTR_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
/// Convert the whole typval
|
/// Convert the whole typval
|
||||||
///
|
///
|
||||||
@@ -668,8 +649,8 @@ TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE(
|
|||||||
///
|
///
|
||||||
/// @return OK in case of success, FAIL in case of failure.
|
/// @return OK in case of success, FAIL in case of failure.
|
||||||
TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE(
|
TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE(
|
||||||
TYPVAL_ENCODE_FIRST_ARG_TYPE TYPVAL_ENCODE_FIRST_ARG_NAME,
|
TYPVAL_ENCODE_FIRST_ARG_TYPE TYPVAL_ENCODE_FIRST_ARG_NAME, typval_T *const top_tv,
|
||||||
typval_T *const top_tv, const char *const objname)
|
const char *const objname)
|
||||||
{
|
{
|
||||||
const int copyID = get_copyID();
|
const int copyID = get_copyID();
|
||||||
MPConvStack mpstack;
|
MPConvStack mpstack;
|
||||||
@@ -711,7 +692,7 @@ typval_encode_stop_converting_one_item:
|
|||||||
tv = &di->di_tv;
|
tv = &di->di_tv;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kMPConvList: {
|
case kMPConvList:
|
||||||
if (cur_mpsv->data.l.li == NULL) {
|
if (cur_mpsv->data.l.li == NULL) {
|
||||||
(void)_mp_pop(mpstack);
|
(void)_mp_pop(mpstack);
|
||||||
tv_list_set_copyid(cur_mpsv->data.l.list, cur_mpsv->saved_copyID);
|
tv_list_set_copyid(cur_mpsv->data.l.list, cur_mpsv->saved_copyID);
|
||||||
@@ -725,7 +706,6 @@ typval_encode_stop_converting_one_item:
|
|||||||
cur_mpsv->data.l.li = TV_LIST_ITEM_NEXT(cur_mpsv->data.l.list,
|
cur_mpsv->data.l.li = TV_LIST_ITEM_NEXT(cur_mpsv->data.l.list,
|
||||||
cur_mpsv->data.l.li);
|
cur_mpsv->data.l.li);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case kMPConvPairs: {
|
case kMPConvPairs: {
|
||||||
if (cur_mpsv->data.l.li == NULL) {
|
if (cur_mpsv->data.l.li == NULL) {
|
||||||
(void)_mp_pop(mpstack);
|
(void)_mp_pop(mpstack);
|
||||||
@@ -734,16 +714,14 @@ typval_encode_stop_converting_one_item:
|
|||||||
continue;
|
continue;
|
||||||
} else if (cur_mpsv->data.l.li
|
} else if (cur_mpsv->data.l.li
|
||||||
!= tv_list_first(cur_mpsv->data.l.list)) {
|
!= tv_list_first(cur_mpsv->data.l.list)) {
|
||||||
TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS(
|
TYPVAL_ENCODE_CONV_DICT_BETWEEN_ITEMS(cur_mpsv->tv, TYPVAL_ENCODE_NODICT_VAR);
|
||||||
cur_mpsv->tv, TYPVAL_ENCODE_NODICT_VAR);
|
|
||||||
}
|
}
|
||||||
const list_T *const kv_pair = (
|
const list_T *const kv_pair = (
|
||||||
TV_LIST_ITEM_TV(cur_mpsv->data.l.li)->vval.v_list);
|
TV_LIST_ITEM_TV(cur_mpsv->data.l.li)->vval.v_list);
|
||||||
TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK(
|
TYPVAL_ENCODE_SPECIAL_DICT_KEY_CHECK(encode_vim_to__error_ret,
|
||||||
encode_vim_to__error_ret, *TV_LIST_ITEM_TV(tv_list_first(kv_pair)));
|
*TV_LIST_ITEM_TV(tv_list_first(kv_pair)));
|
||||||
if (
|
if (
|
||||||
_TYPVAL_ENCODE_CONVERT_ONE_VALUE(
|
_TYPVAL_ENCODE_CONVERT_ONE_VALUE(TYPVAL_ENCODE_FIRST_ARG_NAME, &mpstack, cur_mpsv,
|
||||||
TYPVAL_ENCODE_FIRST_ARG_NAME, &mpstack, cur_mpsv,
|
|
||||||
TV_LIST_ITEM_TV(tv_list_first(kv_pair)), copyID, objname)
|
TV_LIST_ITEM_TV(tv_list_first(kv_pair)), copyID, objname)
|
||||||
== FAIL) {
|
== FAIL) {
|
||||||
goto encode_vim_to__error_ret;
|
goto encode_vim_to__error_ret;
|
||||||
@@ -760,7 +738,7 @@ typval_encode_stop_converting_one_item:
|
|||||||
tv = cur_mpsv->tv;
|
tv = cur_mpsv->tv;
|
||||||
(void)tv;
|
(void)tv;
|
||||||
switch (cur_mpsv->data.p.stage) {
|
switch (cur_mpsv->data.p.stage) {
|
||||||
case kMPConvPartialArgs: {
|
case kMPConvPartialArgs:
|
||||||
TYPVAL_ENCODE_CONV_FUNC_BEFORE_ARGS(tv,
|
TYPVAL_ENCODE_CONV_FUNC_BEFORE_ARGS(tv,
|
||||||
pt == NULL ? 0 : pt->pt_argc);
|
pt == NULL ? 0 : pt->pt_argc);
|
||||||
cur_mpsv->data.p.stage = kMPConvPartialSelf;
|
cur_mpsv->data.p.stage = kMPConvPartialSelf;
|
||||||
@@ -780,7 +758,6 @@ typval_encode_stop_converting_one_item:
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case kMPConvPartialSelf: {
|
case kMPConvPartialSelf: {
|
||||||
cur_mpsv->data.p.stage = kMPConvPartialEnd;
|
cur_mpsv->data.p.stage = kMPConvPartialEnd;
|
||||||
dict_T *const dict = pt == NULL ? NULL : pt->pt_dict;
|
dict_T *const dict = pt == NULL ? NULL : pt->pt_dict;
|
||||||
@@ -791,9 +768,9 @@ typval_encode_stop_converting_one_item:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const int saved_copyID = dict->dv_copyID;
|
const int saved_copyID = dict->dv_copyID;
|
||||||
const int te_csr_ret = _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(
|
const int te_csr_ret = _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(TYPVAL_ENCODE_FIRST_ARG_NAME,
|
||||||
TYPVAL_ENCODE_FIRST_ARG_NAME,
|
dict, &dict->dv_copyID,
|
||||||
dict, &dict->dv_copyID, &mpstack, copyID, kMPConvDict,
|
&mpstack, copyID, kMPConvDict,
|
||||||
objname);
|
objname);
|
||||||
if (te_csr_ret != NOTDONE) {
|
if (te_csr_ret != NOTDONE) {
|
||||||
if (te_csr_ret == FAIL) {
|
if (te_csr_ret == FAIL) {
|
||||||
@@ -825,15 +802,14 @@ typval_encode_stop_converting_one_item:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kMPConvPartialEnd: {
|
case kMPConvPartialEnd:
|
||||||
TYPVAL_ENCODE_CONV_FUNC_END(tv);
|
TYPVAL_ENCODE_CONV_FUNC_END(tv);
|
||||||
(void)_mp_pop(mpstack);
|
(void)_mp_pop(mpstack);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case kMPConvPartialList: {
|
case kMPConvPartialList:
|
||||||
if (!cur_mpsv->data.a.todo) {
|
if (!cur_mpsv->data.a.todo) {
|
||||||
(void)_mp_pop(mpstack);
|
(void)_mp_pop(mpstack);
|
||||||
TYPVAL_ENCODE_CONV_LIST_END(NULL);
|
TYPVAL_ENCODE_CONV_LIST_END(NULL);
|
||||||
@@ -845,7 +821,6 @@ typval_encode_stop_converting_one_item:
|
|||||||
cur_mpsv->data.a.todo--;
|
cur_mpsv->data.a.todo--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
assert(tv != NULL);
|
assert(tv != NULL);
|
||||||
if (_TYPVAL_ENCODE_CONVERT_ONE_VALUE(TYPVAL_ENCODE_FIRST_ARG_NAME, &mpstack,
|
if (_TYPVAL_ENCODE_CONVERT_ONE_VALUE(TYPVAL_ENCODE_FIRST_ARG_NAME, &mpstack,
|
||||||
cur_mpsv, tv, copyID, objname)
|
cur_mpsv, tv, copyID, objname)
|
||||||
|
@@ -5,14 +5,14 @@
|
|||||||
#ifndef NVIM_EVAL_TYPVAL_ENCODE_H
|
#ifndef NVIM_EVAL_TYPVAL_ENCODE_H
|
||||||
#define NVIM_EVAL_TYPVAL_ENCODE_H
|
#define NVIM_EVAL_TYPVAL_ENCODE_H
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "nvim/lib/kvec.h"
|
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
|
#include "nvim/lib/kvec.h"
|
||||||
|
|
||||||
/// Type of the stack entry
|
/// Type of the stack entry
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -87,7 +87,7 @@ static inline size_t tv_strlen(const typval_T *const tv)
|
|||||||
assert(tv->v_type == VAR_STRING);
|
assert(tv->v_type == VAR_STRING);
|
||||||
return (tv->vval.v_string == NULL
|
return (tv->vval.v_string == NULL
|
||||||
? 0
|
? 0
|
||||||
: strlen((char *) tv->vval.v_string));
|
: strlen((char *)tv->vval.v_string));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Code for checking whether container references itself
|
/// Code for checking whether container references itself
|
||||||
@@ -101,9 +101,9 @@ static inline size_t tv_strlen(const typval_T *const tv)
|
|||||||
#define _TYPVAL_ENCODE_DO_CHECK_SELF_REFERENCE(val, copyID_attr, copyID, \
|
#define _TYPVAL_ENCODE_DO_CHECK_SELF_REFERENCE(val, copyID_attr, copyID, \
|
||||||
conv_type) \
|
conv_type) \
|
||||||
do { \
|
do { \
|
||||||
const int te_csr_ret = _TYPVAL_ENCODE_CHECK_SELF_REFERENCE( \
|
const int te_csr_ret = _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(TYPVAL_ENCODE_FIRST_ARG_NAME, \
|
||||||
TYPVAL_ENCODE_FIRST_ARG_NAME, \
|
(val), &(val)->copyID_attr, mpstack, \
|
||||||
(val), &(val)->copyID_attr, mpstack, copyID, conv_type, objname); \
|
copyID, conv_type, objname); \
|
||||||
if (te_csr_ret != NOTDONE) { \
|
if (te_csr_ret != NOTDONE) { \
|
||||||
return te_csr_ret; \
|
return te_csr_ret; \
|
||||||
} \
|
} \
|
||||||
|
@@ -11,7 +11,7 @@ typedef struct message {
|
|||||||
argv_callback handler;
|
argv_callback handler;
|
||||||
void *argv[EVENT_HANDLER_MAX_ARGC];
|
void *argv[EVENT_HANDLER_MAX_ARGC];
|
||||||
} Event;
|
} Event;
|
||||||
typedef void(*event_scheduler)(Event event, void *data);
|
typedef void (*event_scheduler)(Event event, void *data);
|
||||||
|
|
||||||
#define VA_EVENT_INIT(event, h, a) \
|
#define VA_EVENT_INIT(event, h, a) \
|
||||||
do { \
|
do { \
|
||||||
|
@@ -2,12 +2,11 @@
|
|||||||
#define NVIM_EVENT_LOOP_H
|
#define NVIM_EVENT_LOOP_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
#include "nvim/event/multiqueue.h"
|
||||||
#include "nvim/lib/klist.h"
|
#include "nvim/lib/klist.h"
|
||||||
#include "nvim/os/time.h"
|
#include "nvim/os/time.h"
|
||||||
#include "nvim/event/multiqueue.h"
|
|
||||||
|
|
||||||
typedef void * WatcherPtr;
|
typedef void * WatcherPtr;
|
||||||
|
|
||||||
@@ -65,7 +64,7 @@ typedef struct loop {
|
|||||||
break; \
|
break; \
|
||||||
} else if (remaining > 0) { \
|
} else if (remaining > 0) { \
|
||||||
uint64_t now = os_hrtime(); \
|
uint64_t now = os_hrtime(); \
|
||||||
remaining -= (int) ((now - before) / 1000000); \
|
remaining -= (int)((now - before) / 1000000); \
|
||||||
before = now; \
|
before = now; \
|
||||||
if (remaining <= 0) { \
|
if (remaining <= 0) { \
|
||||||
break; \
|
break; \
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
#ifndef NVIM_EVENT_PROCESS_H
|
#ifndef NVIM_EVENT_PROCESS_H
|
||||||
#define NVIM_EVENT_PROCESS_H
|
#define NVIM_EVENT_PROCESS_H
|
||||||
|
|
||||||
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/event/loop.h"
|
#include "nvim/event/loop.h"
|
||||||
#include "nvim/event/rstream.h"
|
#include "nvim/event/rstream.h"
|
||||||
#include "nvim/event/wstream.h"
|
#include "nvim/event/wstream.h"
|
||||||
#include "nvim/eval/typval.h"
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
kProcessTypeUv,
|
kProcessTypeUv,
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
#include "nvim/event/loop.h"
|
#include "nvim/event/loop.h"
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
#include "nvim/event/loop.h"
|
#include "nvim/event/loop.h"
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
#ifndef NVIM_EVENT_WSTREAM_H
|
#ifndef NVIM_EVENT_WSTREAM_H
|
||||||
#define NVIM_EVENT_WSTREAM_H
|
#define NVIM_EVENT_WSTREAM_H
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
#include "nvim/event/loop.h"
|
#include "nvim/event/loop.h"
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/func_attr.h"
|
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
|
#include "nvim/func_attr.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
LuaRef func_ref;
|
LuaRef func_ref;
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
#ifndef NVIM_LUA_EXECUTOR_H
|
#ifndef NVIM_LUA_EXECUTOR_H
|
||||||
#define NVIM_LUA_EXECUTOR_H
|
#define NVIM_LUA_EXECUTOR_H
|
||||||
|
|
||||||
#include <lua.h>
|
|
||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
|
#include <lua.h>
|
||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/func_attr.h"
|
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
|
#include "nvim/func_attr.h"
|
||||||
#include "nvim/lua/converter.h"
|
#include "nvim/lua/converter.h"
|
||||||
|
|
||||||
// Generated by msgpack-gen.lua
|
// Generated by msgpack-gen.lua
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
#ifndef NVIM_LUA_TREESITTER_H
|
#ifndef NVIM_LUA_TREESITTER_H
|
||||||
#define NVIM_LUA_TREESITTER_H
|
#define NVIM_LUA_TREESITTER_H
|
||||||
|
|
||||||
|
#include <lauxlib.h>
|
||||||
#include <lua.h>
|
#include <lua.h>
|
||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
#include <lauxlib.h>
|
|
||||||
|
|
||||||
#include "tree_sitter/api.h"
|
#include "tree_sitter/api.h"
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
#ifndef NVIM_LUA_XDIFF_H
|
#ifndef NVIM_LUA_XDIFF_H
|
||||||
#define NVIM_LUA_XDIFF_H
|
#define NVIM_LUA_XDIFF_H
|
||||||
|
|
||||||
|
#include <lauxlib.h>
|
||||||
#include <lua.h>
|
#include <lua.h>
|
||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
#include <lauxlib.h>
|
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "lua/xdiff.h.generated.h"
|
# include "lua/xdiff.h.generated.h"
|
||||||
|
@@ -5,10 +5,10 @@
|
|||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/event/socket.h"
|
|
||||||
#include "nvim/event/process.h"
|
|
||||||
#include "nvim/vim.h"
|
|
||||||
#include "nvim/channel.h"
|
#include "nvim/channel.h"
|
||||||
|
#include "nvim/event/process.h"
|
||||||
|
#include "nvim/event/socket.h"
|
||||||
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
#define METHOD_MAXLEN 512
|
#define METHOD_MAXLEN 512
|
||||||
|
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
#ifndef NVIM_MSGPACK_RPC_CHANNEL_DEFS_H
|
#ifndef NVIM_MSGPACK_RPC_CHANNEL_DEFS_H
|
||||||
#define NVIM_MSGPACK_RPC_CHANNEL_DEFS_H
|
#define NVIM_MSGPACK_RPC_CHANNEL_DEFS_H
|
||||||
|
|
||||||
|
#include <msgpack.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <msgpack.h>
|
|
||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/event/socket.h"
|
|
||||||
#include "nvim/event/process.h"
|
#include "nvim/event/process.h"
|
||||||
|
#include "nvim/event/socket.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
typedef struct Channel Channel;
|
typedef struct Channel Channel;
|
||||||
|
@@ -1,13 +1,12 @@
|
|||||||
#ifndef NVIM_MSGPACK_RPC_HELPERS_H
|
#ifndef NVIM_MSGPACK_RPC_HELPERS_H
|
||||||
#define NVIM_MSGPACK_RPC_HELPERS_H
|
#define NVIM_MSGPACK_RPC_HELPERS_H
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#include <msgpack.h>
|
#include <msgpack.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "nvim/event/wstream.h"
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
#include "nvim/event/wstream.h"
|
||||||
|
|
||||||
/// Value by which objects represented as EXT type are shifted
|
/// Value by which objects represented as EXT type are shifted
|
||||||
///
|
///
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef NVIM_OS_INPUT_H
|
#ifndef NVIM_OS_INPUT_H
|
||||||
#define NVIM_OS_INPUT_H
|
#define NVIM_OS_INPUT_H
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/event/multiqueue.h"
|
#include "nvim/event/multiqueue.h"
|
||||||
|
@@ -9,11 +9,11 @@
|
|||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
|
# include "os/env.h.generated.h"
|
||||||
# include "os/fs.h.generated.h"
|
# include "os/fs.h.generated.h"
|
||||||
# include "os/mem.h.generated.h"
|
# include "os/mem.h.generated.h"
|
||||||
# include "os/env.h.generated.h"
|
|
||||||
# include "os/users.h.generated.h"
|
|
||||||
# include "os/stdpaths.h.generated.h"
|
# include "os/stdpaths.h.generated.h"
|
||||||
|
# include "os/users.h.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // NVIM_OS_OS_H
|
#endif // NVIM_OS_OS_H
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#define BASENAMELEN (NAME_MAX - 5)
|
#define BASENAMELEN (NAME_MAX - 5)
|
||||||
|
|
||||||
// Use the system path length if it makes sense.
|
// Use the system path length if it makes sense.
|
||||||
# define DEFAULT_MAXPATHL 4096
|
#define DEFAULT_MAXPATHL 4096
|
||||||
#if defined(PATH_MAX) && (PATH_MAX > DEFAULT_MAXPATHL)
|
#if defined(PATH_MAX) && (PATH_MAX > DEFAULT_MAXPATHL)
|
||||||
# define MAXPATHL PATH_MAX
|
# define MAXPATHL PATH_MAX
|
||||||
#else
|
#else
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#define NVIM_OS_PROCESS_H
|
#define NVIM_OS_PROCESS_H
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef NVIM_OS_TIME_H
|
#ifndef NVIM_OS_TIME_H
|
||||||
#define NVIM_OS_TIME_H
|
#define NVIM_OS_TIME_H
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
typedef uint64_t Timestamp;
|
typedef uint64_t Timestamp;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#ifndef NVIM_OS_UNIX_DEFS_H
|
#ifndef NVIM_OS_UNIX_DEFS_H
|
||||||
#define NVIM_OS_UNIX_DEFS_H
|
#define NVIM_OS_UNIX_DEFS_H
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
// POSIX.1-2008 says that NAME_MAX should be in here
|
// POSIX.1-2008 says that NAME_MAX should be in here
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
@@ -7,11 +7,14 @@
|
|||||||
|
|
||||||
// winsock2.h must be first to avoid incompatibilities
|
// winsock2.h must be first to avoid incompatibilities
|
||||||
// with winsock.h (included by windows.h)
|
// with winsock.h (included by windows.h)
|
||||||
|
|
||||||
|
// uncrustify:off
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
// uncrustify:on
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
// Windows does not have S_IFLNK but libuv defines it
|
// Windows does not have S_IFLNK but libuv defines it
|
||||||
// and sets the flag for us when calling uv_fs_stat.
|
// and sets the flag for us when calling uv_fs_stat.
|
||||||
|
@@ -332,8 +332,8 @@ int do_in_path_and_pp(char_u *path, char_u *name, int flags, DoInRuntimepathCB c
|
|||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void push_path(RuntimeSearchPath *search_path, Map(String, handle_T) *rtp_used,
|
static void push_path(RuntimeSearchPath *search_path, Map(String, handle_T) *rtp_used, char *entry,
|
||||||
char *entry, bool after)
|
bool after)
|
||||||
{
|
{
|
||||||
handle_T h = map_get(String, handle_T)(rtp_used, cstr_as_string(entry));
|
handle_T h = map_get(String, handle_T)(rtp_used, cstr_as_string(entry));
|
||||||
if (h == 0) {
|
if (h == 0) {
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
#define NVIM_TUI_INPUT_H
|
#define NVIM_TUI_INPUT_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <termkey.h>
|
#include <termkey.h>
|
||||||
|
|
||||||
#include "nvim/event/stream.h"
|
#include "nvim/event/stream.h"
|
||||||
#include "nvim/event/time.h"
|
#include "nvim/event/time.h"
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -1,13 +1,13 @@
|
|||||||
#ifndef NVIM_VIML_PARSER_EXPRESSIONS_H
|
#ifndef NVIM_VIML_PARSER_EXPRESSIONS_H
|
||||||
#define NVIM_VIML_PARSER_EXPRESSIONS_H
|
#define NVIM_VIML_PARSER_EXPRESSIONS_H
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
#include "nvim/viml/parser/parser.h"
|
#include "nvim/viml/parser/parser.h"
|
||||||
#include "nvim/eval/typval.h"
|
|
||||||
|
|
||||||
// Defines whether to ignore case:
|
// Defines whether to ignore case:
|
||||||
// == kCCStrategyUseOption
|
// == kCCStrategyUseOption
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
#ifndef NVIM_VIML_PARSER_PARSER_H
|
#ifndef NVIM_VIML_PARSER_PARSER_H
|
||||||
#define NVIM_VIML_PARSER_PARSER_H
|
#define NVIM_VIML_PARSER_PARSER_H
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "nvim/lib/kvec.h"
|
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
|
#include "nvim/lib/kvec.h"
|
||||||
#include "nvim/mbyte.h"
|
#include "nvim/mbyte.h"
|
||||||
#include "nvim/memory.h"
|
#include "nvim/memory.h"
|
||||||
|
|
||||||
@@ -94,10 +94,8 @@ static inline void viml_parser_init(
|
|||||||
/// @param[in] cookie Argument for the get_line function.
|
/// @param[in] cookie Argument for the get_line function.
|
||||||
/// @param[in] colors Where to save highlighting. May be NULL if it is not
|
/// @param[in] colors Where to save highlighting. May be NULL if it is not
|
||||||
/// needed.
|
/// needed.
|
||||||
static inline void viml_parser_init(
|
static inline void viml_parser_init(ParserState *const ret_pstate, const ParserLineGetter get_line,
|
||||||
ParserState *const ret_pstate,
|
void *const cookie, ParserHighlight *const colors)
|
||||||
const ParserLineGetter get_line, void *const cookie,
|
|
||||||
ParserHighlight *const colors)
|
|
||||||
{
|
{
|
||||||
*ret_pstate = (ParserState) {
|
*ret_pstate = (ParserState) {
|
||||||
.reader = {
|
.reader = {
|
||||||
@@ -194,8 +192,7 @@ static inline void viml_parser_advance(ParserState *const pstate,
|
|||||||
///
|
///
|
||||||
/// @param pstate Parser state to advance.
|
/// @param pstate Parser state to advance.
|
||||||
/// @param[in] len Number of bytes to advance.
|
/// @param[in] len Number of bytes to advance.
|
||||||
static inline void viml_parser_advance(ParserState *const pstate,
|
static inline void viml_parser_advance(ParserState *const pstate, const size_t len)
|
||||||
const size_t len)
|
|
||||||
{
|
{
|
||||||
assert(pstate->pos.line == kv_size(pstate->reader.lines) - 1);
|
assert(pstate->pos.line == kv_size(pstate->reader.lines) - 1);
|
||||||
const ParserLine pline = kv_last(pstate->reader.lines);
|
const ParserLine pline = kv_last(pstate->reader.lines);
|
||||||
@@ -219,10 +216,8 @@ static inline void viml_parser_highlight(ParserState *const pstate,
|
|||||||
/// @param[in] start Start position of the highlight.
|
/// @param[in] start Start position of the highlight.
|
||||||
/// @param[in] len Highlighting chunk length.
|
/// @param[in] len Highlighting chunk length.
|
||||||
/// @param[in] group Highlight group.
|
/// @param[in] group Highlight group.
|
||||||
static inline void viml_parser_highlight(ParserState *const pstate,
|
static inline void viml_parser_highlight(ParserState *const pstate, const ParserPosition start,
|
||||||
const ParserPosition start,
|
const size_t len, const char *const group)
|
||||||
const size_t len,
|
|
||||||
const char *const group)
|
|
||||||
{
|
{
|
||||||
if (pstate->colors == NULL || len == 0) {
|
if (pstate->colors == NULL || len == 0) {
|
||||||
return;
|
return;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Uncrustify-0.73.0-195-1f883c691
|
# Uncrustify-0.73.0-199-0dfafb273
|
||||||
|
|
||||||
#
|
#
|
||||||
# General options
|
# General options
|
||||||
@@ -44,12 +44,12 @@ disable_processing_nl_cont = false # true/false
|
|||||||
# file.
|
# file.
|
||||||
#
|
#
|
||||||
# Default: *INDENT-OFF*
|
# Default: *INDENT-OFF*
|
||||||
disable_processing_cmt = "uncrustify:indent-off" # string
|
disable_processing_cmt = "uncrustify:off" # string
|
||||||
|
|
||||||
# Specify the marker used in comments to (re)enable processing in a file.
|
# Specify the marker used in comments to (re)enable processing in a file.
|
||||||
#
|
#
|
||||||
# Default: *INDENT-ON*
|
# Default: *INDENT-ON*
|
||||||
enable_processing_cmt = "uncrustify:indent-on" # string
|
enable_processing_cmt = "uncrustify:on" # string
|
||||||
|
|
||||||
# Enable parsing of digraphs.
|
# Enable parsing of digraphs.
|
||||||
enable_digraphs = false # true/false
|
enable_digraphs = false # true/false
|
||||||
@@ -472,9 +472,13 @@ sp_after_class_colon = ignore # ignore/add/remove/force/not_defined
|
|||||||
sp_before_class_colon = ignore # ignore/add/remove/force/not_defined
|
sp_before_class_colon = ignore # ignore/add/remove/force/not_defined
|
||||||
|
|
||||||
# Add or remove space after class constructor ':'.
|
# Add or remove space after class constructor ':'.
|
||||||
|
#
|
||||||
|
# Default: add
|
||||||
sp_after_constr_colon = ignore # ignore/add/remove/force/not_defined
|
sp_after_constr_colon = ignore # ignore/add/remove/force/not_defined
|
||||||
|
|
||||||
# Add or remove space before class constructor ':'.
|
# Add or remove space before class constructor ':'.
|
||||||
|
#
|
||||||
|
# Default: add
|
||||||
sp_before_constr_colon = ignore # ignore/add/remove/force/not_defined
|
sp_before_constr_colon = ignore # ignore/add/remove/force/not_defined
|
||||||
|
|
||||||
# Add or remove space before case ':'.
|
# Add or remove space before case ':'.
|
||||||
@@ -1103,11 +1107,16 @@ indent_class_on_colon = false # true/false
|
|||||||
# Whether to indent the stuff after a leading class initializer colon.
|
# Whether to indent the stuff after a leading class initializer colon.
|
||||||
indent_constr_colon = false # true/false
|
indent_constr_colon = false # true/false
|
||||||
|
|
||||||
# Virtual indent from the ':' for member initializers.
|
# Virtual indent from the ':' for leading member initializers.
|
||||||
#
|
#
|
||||||
# Default: 2
|
# Default: 2
|
||||||
indent_ctor_init_leading = 2 # unsigned number
|
indent_ctor_init_leading = 2 # unsigned number
|
||||||
|
|
||||||
|
# Virtual indent from the ':' for following member initializers.
|
||||||
|
#
|
||||||
|
# Default: 2
|
||||||
|
indent_ctor_init_following = 2 # unsigned number
|
||||||
|
|
||||||
# Additional indent for constructor initializer list.
|
# Additional indent for constructor initializer list.
|
||||||
# Negative values decrease indent down to the first column.
|
# Negative values decrease indent down to the first column.
|
||||||
indent_ctor_init = 0 # number
|
indent_ctor_init = 0 # number
|
||||||
@@ -3298,5 +3307,5 @@ set QUESTION REAL_FATTR_CONST
|
|||||||
set QUESTION REAL_FATTR_NONNULL_ALL
|
set QUESTION REAL_FATTR_NONNULL_ALL
|
||||||
set QUESTION REAL_FATTR_PURE
|
set QUESTION REAL_FATTR_PURE
|
||||||
set QUESTION REAL_FATTR_WARN_UNUSED_RESULT
|
set QUESTION REAL_FATTR_WARN_UNUSED_RESULT
|
||||||
# option(s) with 'not default' value: 62
|
# option(s) with 'not default' value: 64
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user