refactor: move StringBuilder to types_defs.h (#33745)

This commit is contained in:
Gregory Anders
2025-05-01 10:06:08 -05:00
committed by GitHub
parent d567f899ef
commit d1fed989f2
8 changed files with 6 additions and 10 deletions

View File

@ -879,7 +879,6 @@ def CheckIncludes(filename, lines, error):
"mpack/mpack_core.h", "mpack/mpack_core.h",
"mpack/object.h", "mpack/object.h",
"nvim/func_attr.h", "nvim/func_attr.h",
"nvim/strings.h",
"termkey/termkey.h", "termkey/termkey.h",
"vterm/vterm.h", "vterm/vterm.h",
"xdiff/xdiff.h", "xdiff/xdiff.h",

View File

@ -139,8 +139,6 @@
&& memmove(&kv_A(v, (i)), &kv_A(v, (i)+(n)), \ && memmove(&kv_A(v, (i)), &kv_A(v, (i)+(n)), \
((v).size-(i))*sizeof(kv_A(v, i)))) ((v).size-(i))*sizeof(kv_A(v, i))))
#define kv_printf(v, ...) kv_do_printf(&(v), __VA_ARGS__)
/// Type of a vector with a few first members allocated on stack /// Type of a vector with a few first members allocated on stack
/// ///
/// Is compatible with #kv_A, #kv_pop, #kv_size, #kv_max, #kv_last. /// Is compatible with #kv_A, #kv_pop, #kv_size, #kv_max, #kv_last.

View File

@ -80,7 +80,6 @@
#include "nvim/state.h" #include "nvim/state.h"
#include "nvim/statusline.h" #include "nvim/statusline.h"
#include "nvim/statusline_defs.h" #include "nvim/statusline_defs.h"
#include "nvim/strings.h"
#include "nvim/terminal.h" #include "nvim/terminal.h"
#include "nvim/types_defs.h" #include "nvim/types_defs.h"
#include "nvim/ui.h" #include "nvim/ui.h"

View File

@ -8,7 +8,6 @@
#include "nvim/gettext_defs.h" // IWYU pragma: keep #include "nvim/gettext_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h" #include "nvim/macros_defs.h"
#include "nvim/marktree_defs.h" #include "nvim/marktree_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h" #include "nvim/types_defs.h"
/// Values for buflist_getfile() /// Values for buflist_getfile()

View File

@ -8,7 +8,6 @@
#include "nvim/macros_defs.h" #include "nvim/macros_defs.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/pos_defs.h" #include "nvim/pos_defs.h"
#include "nvim/strings.h"
#include "xdiff/xdiff.h" #include "xdiff/xdiff.h"
#define LN_MAX_BUFS 8 #define LN_MAX_BUFS 8

View File

@ -4,14 +4,11 @@
#include <string.h> #include <string.h>
#include "auto/config.h" #include "auto/config.h"
#include "klib/kvec.h"
#include "nvim/api/private/defs.h" // IWYU pragma: keep #include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep #include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/os/os_defs.h" #include "nvim/os/os_defs.h"
#include "nvim/types_defs.h" // IWYU pragma: keep #include "nvim/types_defs.h" // IWYU pragma: keep
typedef kvec_t(char) StringBuilder;
// Return the length of a string literal // Return the length of a string literal
#define STRLEN_LITERAL(s) (sizeof(s) - 1) #define STRLEN_LITERAL(s) (sizeof(s) - 1)
@ -65,3 +62,5 @@ static inline char *strappend(char *const dst, const char *const src)
# define STRNICMP(d, s, n) vim_strnicmp((char *)(d), (char *)(s), (size_t)(n)) # define STRNICMP(d, s, n) vim_strnicmp((char *)(d), (char *)(s), (size_t)(n))
# endif # endif
#endif #endif
#define kv_printf(v, ...) kv_do_printf(&(v), __VA_ARGS__)

View File

@ -10,7 +10,6 @@
#include "nvim/ascii_defs.h" #include "nvim/ascii_defs.h"
#include "nvim/charset.h" #include "nvim/charset.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/strings.h"
#include "nvim/tui/terminfo.h" #include "nvim/tui/terminfo.h"
#include "nvim/tui/terminfo_defs.h" #include "nvim/tui/terminfo_defs.h"

View File

@ -2,6 +2,8 @@
#include <stdint.h> #include <stdint.h>
#include "klib/kvec.h"
// dummy to pass an ACL to a function // dummy to pass an ACL to a function
typedef void *vim_acl_T; typedef void *vim_acl_T;
@ -66,3 +68,5 @@ typedef struct {
uint32_t nbytes; uint32_t nbytes;
char data[]; char data[];
} AdditionalData; } AdditionalData;
typedef kvec_t(char) StringBuilder;