From 1635c9e75e21e07c4331cf983e14a11c7e09b119 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 26 Aug 2023 11:13:20 +0800 Subject: refactor: move some structs out of buffer_defs.h (#24878) --- src/nvim/arglist_defs.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/nvim/arglist_defs.h (limited to 'src/nvim/arglist_defs.h') diff --git a/src/nvim/arglist_defs.h b/src/nvim/arglist_defs.h new file mode 100644 index 0000000000..28f2c3cf69 --- /dev/null +++ b/src/nvim/arglist_defs.h @@ -0,0 +1,22 @@ +#ifndef NVIM_ARGLIST_DEFS_H +#define NVIM_ARGLIST_DEFS_H + +#include "nvim/garray.h" + +/// Argument list: Array of file names. +/// Used for the global argument list and the argument lists local to a window. +typedef struct arglist { + garray_T al_ga; ///< growarray with the array of file names + int al_refcount; ///< number of windows using this arglist + int id; ///< id of this arglist +} alist_T; + +/// For each argument remember the file name as it was given, and the buffer +/// number that contains the expanded file name (required for when ":cd" is +/// used). +typedef struct argentry { + char *ae_fname; ///< file name as specified + int ae_fnum; ///< buffer number with expanded file name +} aentry_T; + +#endif // NVIM_ARGLIST_DEFS_H -- cgit From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/arglist_defs.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/arglist_defs.h') diff --git a/src/nvim/arglist_defs.h b/src/nvim/arglist_defs.h index 28f2c3cf69..02651954db 100644 --- a/src/nvim/arglist_defs.h +++ b/src/nvim/arglist_defs.h @@ -1,5 +1,4 @@ -#ifndef NVIM_ARGLIST_DEFS_H -#define NVIM_ARGLIST_DEFS_H +#pragma once #include "nvim/garray.h" @@ -18,5 +17,3 @@ typedef struct argentry { char *ae_fname; ///< file name as specified int ae_fnum; ///< buffer number with expanded file name } aentry_T; - -#endif // NVIM_ARGLIST_DEFS_H -- cgit From 6361806aa28edca55ad3316a58bc3e936df9c0eb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 26 Nov 2023 22:58:52 +0800 Subject: refactor: move garray_T to garray_defs.h (#26227) --- src/nvim/arglist_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/arglist_defs.h') diff --git a/src/nvim/arglist_defs.h b/src/nvim/arglist_defs.h index 02651954db..a79d540a6e 100644 --- a/src/nvim/arglist_defs.h +++ b/src/nvim/arglist_defs.h @@ -1,6 +1,6 @@ #pragma once -#include "nvim/garray.h" +#include "nvim/garray_defs.h" /// Argument list: Array of file names. /// Used for the global argument list and the argument lists local to a window. -- cgit