aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/garray.h
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-26 22:58:52 +0800
committerGitHub <noreply@github.com>2023-11-26 22:58:52 +0800
commit6361806aa28edca55ad3316a58bc3e936df9c0eb (patch)
treefed82d95b3cadb76112b6a1124e7d7def6b7bc2c /src/nvim/garray.h
parent34509bbea3e8c6a8033911aea645b1b5579f7d1a (diff)
downloadrneovim-6361806aa28edca55ad3316a58bc3e936df9c0eb.tar.gz
rneovim-6361806aa28edca55ad3316a58bc3e936df9c0eb.tar.bz2
rneovim-6361806aa28edca55ad3316a58bc3e936df9c0eb.zip
refactor: move garray_T to garray_defs.h (#26227)
Diffstat (limited to 'src/nvim/garray.h')
-rw-r--r--src/nvim/garray.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/nvim/garray.h b/src/nvim/garray.h
index d5322053bb..bebf6fc35f 100644
--- a/src/nvim/garray.h
+++ b/src/nvim/garray.h
@@ -3,24 +3,11 @@
#include <stdbool.h>
#include <stddef.h>
+#include "nvim/garray_defs.h"
#include "nvim/log.h"
#include "nvim/memory.h"
#include "nvim/types.h"
-/// Structure used for growing arrays.
-/// This is used to store information that only grows, is deleted all at
-/// once, and needs to be accessed by index. See ga_clear() and ga_grow().
-typedef struct growarray {
- int ga_len; // current number of items used
- int ga_maxlen; // maximum number of items possible
- int ga_itemsize; // sizeof(item)
- int ga_growsize; // number of items to grow each time
- void *ga_data; // pointer to the first item
-} garray_T;
-
-#define GA_EMPTY_INIT_VALUE { 0, 0, 0, 1, NULL }
-#define GA_INIT(itemsize, growsize) { 0, 0, (itemsize), (growsize), NULL }
-
#define GA_EMPTY(ga_ptr) ((ga_ptr)->ga_len <= 0)
#define GA_APPEND(item_type, gap, item) \