aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/typval.h
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-12-31 01:11:50 +0100
committerGitHub <noreply@github.com>2017-12-31 01:11:50 +0100
commit9ad557fb2d4a1ef3101c7894a1038aa2eb932a48 (patch)
tree0664208e25fd4672c05527e4521299452da44961 /src/nvim/eval/typval.h
parent46f432074e739a0eca9bb204e9c7769935669dbd (diff)
parent8ac7c23b7dd7c435fb80315921e3704c8e0a7448 (diff)
downloadrneovim-9ad557fb2d4a1ef3101c7894a1038aa2eb932a48.tar.gz
rneovim-9ad557fb2d4a1ef3101c7894a1038aa2eb932a48.tar.bz2
rneovim-9ad557fb2d4a1ef3101c7894a1038aa2eb932a48.zip
Merge pull request #7762 from ZyX-I/remove-some-listitems
Remove some tv_list_item_…() functions
Diffstat (limited to 'src/nvim/eval/typval.h')
-rw-r--r--src/nvim/eval/typval.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h
index 2bce7bd6b2..c9a9a3e7e8 100644
--- a/src/nvim/eval/typval.h
+++ b/src/nvim/eval/typval.h
@@ -296,6 +296,14 @@ typedef struct list_stack_S {
struct list_stack_S *prev;
} list_stack_T;
+/// Structure representing one list item, used for sort array.
+typedef struct {
+ listitem_T *item; ///< Sorted list item.
+ int idx; ///< Sorted list item index.
+} ListSortItem;
+
+typedef int (*ListSorter)(const void *, const void *);
+
// In a hashtab item "hi_key" points to "di_key" in a dictitem.
// This avoids adding a pointer to the hashtab item.
@@ -403,20 +411,6 @@ static inline list_T *tv_list_latest_copy(const list_T *const l)
return l->lv_copylist;
}
-/// Clear the list without freeing anything at all
-///
-/// For use in sort() which saves items to a separate array and readds them back
-/// after sorting via a number of tv_list_append() calls.
-///
-/// @param[out] l List to clear.
-static inline void tv_list_clear(list_T *const l)
-{
- l->lv_first = NULL;
- l->lv_last = NULL;
- l->lv_idx_item = NULL;
- l->lv_len = 0;
-}
-
static inline int tv_list_uidx(const list_T *const l, int n)
REAL_FATTR_PURE REAL_FATTR_WARN_UNUSED_RESULT;