1 | #ifndef DEFINE_FUNC_ATTRIBUTES |
2 | # define DEFINE_FUNC_ATTRIBUTES |
3 | #endif |
4 | #include "nvim/func_attr.h" |
5 | #undef DEFINE_FUNC_ATTRIBUTES |
6 | static inline kh_bufset_t *kh_init_bufset(void); |
7 | static inline void kh_dealloc_bufset(kh_bufset_t *h); |
8 | static inline void kh_destroy_bufset(kh_bufset_t *h); |
9 | static inline void kh_clear_bufset(kh_bufset_t *h); |
10 | static inline khint_t kh_get_bufset(const kh_bufset_t *h, khint64_t key); |
11 | static inline void kh_resize_bufset(kh_bufset_t *h, khint_t new_n_buckets); |
12 | static inline khint_t kh_put_bufset(kh_bufset_t *h, khint64_t key, int *ret); |
13 | static inline void kh_del_bufset(kh_bufset_t *h, khint_t x); |
14 | static inline kh_fnamebufs_t *kh_init_fnamebufs(void); |
15 | static inline void kh_dealloc_fnamebufs(kh_fnamebufs_t *h); |
16 | static inline void kh_destroy_fnamebufs(kh_fnamebufs_t *h); |
17 | static inline void kh_clear_fnamebufs(kh_fnamebufs_t *h); |
18 | static inline khint_t kh_get_fnamebufs(const kh_fnamebufs_t *h, kh_cstr_t key); |
19 | static inline void kh_resize_fnamebufs(kh_fnamebufs_t *h, khint_t new_n_buckets); |
20 | static inline khint_t kh_put_fnamebufs(kh_fnamebufs_t *h, kh_cstr_t key, int *ret); |
21 | static inline void kh_del_fnamebufs(kh_fnamebufs_t *h, khint_t x); |
22 | static inline kh_strset_t *kh_init_strset(void); |
23 | static inline void kh_dealloc_strset(kh_strset_t *h); |
24 | static inline void kh_destroy_strset(kh_strset_t *h); |
25 | static inline void kh_clear_strset(kh_strset_t *h); |
26 | static inline khint_t kh_get_strset(const kh_strset_t *h, kh_cstr_t key); |
27 | static inline void kh_resize_strset(kh_strset_t *h, khint_t new_n_buckets); |
28 | static inline khint_t kh_put_strset(kh_strset_t *h, kh_cstr_t key, int *ret); |
29 | static inline void kh_del_strset(kh_strset_t *h, khint_t x); |
30 | static inline kh_hmll_entries_t *kh_init_hmll_entries(void); |
31 | static inline void kh_dealloc_hmll_entries(kh_hmll_entries_t *h); |
32 | static inline void kh_destroy_hmll_entries(kh_hmll_entries_t *h); |
33 | static inline void kh_clear_hmll_entries(kh_hmll_entries_t *h); |
34 | static inline khint_t kh_get_hmll_entries(const kh_hmll_entries_t *h, kh_cstr_t key); |
35 | static inline void kh_resize_hmll_entries(kh_hmll_entries_t *h, khint_t new_n_buckets); |
36 | static inline khint_t kh_put_hmll_entries(kh_hmll_entries_t *h, kh_cstr_t key, int *ret); |
37 | static inline void kh_del_hmll_entries(kh_hmll_entries_t *h, khint_t x); |
38 | static inline kh_file_marks_t *kh_init_file_marks(void); |
39 | static inline void kh_dealloc_file_marks(kh_file_marks_t *h); |
40 | static inline void kh_destroy_file_marks(kh_file_marks_t *h); |
41 | static inline void kh_clear_file_marks(kh_file_marks_t *h); |
42 | static inline khint_t kh_get_file_marks(const kh_file_marks_t *h, kh_cstr_t key); |
43 | static inline void kh_resize_file_marks(kh_file_marks_t *h, khint_t new_n_buckets); |
44 | static inline khint_t kh_put_file_marks(kh_file_marks_t *h, kh_cstr_t key, int *ret); |
45 | static inline void kh_del_file_marks(kh_file_marks_t *h, khint_t x); |
46 | static inline void hmll_init(HMLList *const hmll, const size_t size) FUNC_ATTR_NONNULL_ALL; |
47 | static inline void hmll_remove(HMLList *const hmll, HMLListEntry *const hmll_entry) FUNC_ATTR_NONNULL_ALL; |
48 | static inline void hmll_insert(HMLList *const hmll, HMLListEntry *hmll_entry, const ShadaEntry data, const _Bool can_free_entry) FUNC_ATTR_NONNULL_ARG(1); |
49 | static inline void hmll_dealloc(HMLList *const hmll) FUNC_ATTR_NONNULL_ALL; |
50 | static ptrdiff_t read_file(ShaDaReadDef *const sd_reader, void *const dest, const size_t size) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
51 | static int read_char(ShaDaReadDef *const sd_reader) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
52 | static ptrdiff_t write_file(ShaDaWriteDef *const sd_writer, const void *const dest, const size_t size) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
53 | static void close_sd_reader(ShaDaReadDef *const sd_reader) FUNC_ATTR_NONNULL_ALL; |
54 | static void close_sd_writer(ShaDaWriteDef *const sd_writer) FUNC_ATTR_NONNULL_ALL; |
55 | static int sd_reader_skip_read(ShaDaReadDef *const sd_reader, const size_t offset) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
56 | static ShaDaReadResult sd_reader_skip(ShaDaReadDef *const sd_reader, const size_t offset) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL; |
57 | static int open_shada_file_for_reading(const char *const fname, ShaDaReadDef *sd_reader) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL; |
58 | static void close_file(void *cookie); |
59 | static inline _Bool in_bufset(const kh_bufset_t *const set, const buf_T *buf) FUNC_ATTR_PURE; |
60 | static inline _Bool in_strset(const kh_strset_t *const set, char *str) FUNC_ATTR_PURE; |
61 | static int msgpack_sd_writer_write(void *data, const char *buf, size_t len); |
62 | static _Bool shada_disabled(void) FUNC_ATTR_PURE; |
63 | static int shada_read_file(const char *const file, const int flags) FUNC_ATTR_WARN_UNUSED_RESULT; |
64 | static const void *shada_hist_iter(const void *const iter, const uint8_t history_type, const _Bool zero, ShadaEntry *const hist) FUNC_ATTR_NONNULL_ARG(4) FUNC_ATTR_WARN_UNUSED_RESULT; |
65 | static void hms_insert(HistoryMergerState *const hms_p, const ShadaEntry entry, const _Bool do_iter, const _Bool can_free_entry) FUNC_ATTR_NONNULL_ALL; |
66 | static inline void hms_init(HistoryMergerState *const hms_p, const uint8_t history_type, const size_t num_elements, const _Bool do_merge, const _Bool reading) FUNC_ATTR_NONNULL_ALL; |
67 | static inline void hms_insert_whole_neovim_history(HistoryMergerState *const hms_p) FUNC_ATTR_NONNULL_ALL; |
68 | static inline void hms_to_he_array(const HistoryMergerState *const hms_p, histentry_T *const hist_array, int *const new_hisidx, int *const new_hisnum) FUNC_ATTR_NONNULL_ALL; |
69 | static inline void hms_dealloc(HistoryMergerState *const hms_p) FUNC_ATTR_NONNULL_ALL; |
70 | static buf_T *find_buffer(kh_fnamebufs_t *const fname_bufs, const char *const fname) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL; |
71 | static inline _Bool marks_equal(const pos_T a, const pos_T b); |
72 | static void shada_read(ShaDaReadDef *const sd_reader, const int flags) FUNC_ATTR_NONNULL_ALL; |
73 | static const char *shada_get_default_file(void) FUNC_ATTR_WARN_UNUSED_RESULT; |
74 | static char *shada_filename(const char *file) FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET FUNC_ATTR_WARN_UNUSED_RESULT; |
75 | static ShaDaWriteResult shada_pack_entry(msgpack_packer *const packer, ShadaEntry entry, const size_t max_kbyte) FUNC_ATTR_NONNULL_ALL; |
76 | static inline ShaDaWriteResult shada_pack_pfreed_entry(msgpack_packer *const packer, PossiblyFreedShadaEntry entry, const size_t max_kbyte) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_ALWAYS_INLINE; |
77 | static int compare_file_marks(const void *a, const void *b) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE; |
78 | static inline ShaDaReadResult shada_parse_msgpack(ShaDaReadDef *const sd_reader, const size_t length, msgpack_unpacked *ret_unpacked, char **const ret_buf) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ARG(1); |
79 | static const char *shada_format_entry(const ShadaEntry entry) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_UNUSED FUNC_ATTR_NONNULL_RET; |
80 | static const char *shada_format_pfreed_entry(const PossiblyFreedShadaEntry pfs_entry) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_UNUSED FUNC_ATTR_NONNULL_RET; |
81 | static inline ShaDaWriteResult shada_read_when_writing(ShaDaReadDef *const sd_reader, const unsigned srni_flags, const size_t max_kbyte, WriteMergerState *const wms, msgpack_packer *const packer) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
82 | static inline _Bool ignore_buf(const buf_T *const buf, kh_bufset_t *const removable_bufs) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALWAYS_INLINE; |
83 | static inline ShadaEntry shada_get_buflist(kh_bufset_t *const removable_bufs) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALWAYS_INLINE; |
84 | static inline void add_search_pattern(PossiblyFreedShadaEntry *const ret_pse, const SearchPatternGetter get_pattern, const _Bool is_substitute_pattern, const _Bool search_last_used, const _Bool search_highlighted) FUNC_ATTR_ALWAYS_INLINE; |
85 | static inline void shada_initialize_registers(WriteMergerState *const wms, int max_reg_lines) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_ALWAYS_INLINE; |
86 | static inline void replace_numbered_mark(WriteMergerState *const wms, const size_t idx, const PossiblyFreedShadaEntry entry) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_ALWAYS_INLINE; |
87 | static inline void find_removable_bufs(kh_bufset_t *removable_bufs); |
88 | static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer, ShaDaReadDef *const sd_reader) FUNC_ATTR_NONNULL_ARG(1); |
89 | static void shada_free_shada_entry(ShadaEntry *const entry); |
90 | static ShaDaReadResult fread_len(ShaDaReadDef *const sd_reader, char *const buffer, const size_t length) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
91 | static ShaDaReadResult msgpack_read_uint64(ShaDaReadDef *const sd_reader, const int first_char, uint64_t *const result) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
92 | static ShaDaReadResult shada_read_next_item(ShaDaReadDef *const sd_reader, ShadaEntry *const entry, const unsigned flags, const size_t max_kbyte) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
93 | static _Bool shada_removable(const char *name) FUNC_ATTR_WARN_UNUSED_RESULT; |
94 | static inline size_t shada_init_jumps(PossiblyFreedShadaEntry *jumps, kh_bufset_t *const removable_bufs); |
95 | static ptrdiff_t read_sbuf(ShaDaReadDef *const sd_reader, void *const dest, const size_t size) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
96 | static int sd_sbuf_reader_skip_read(ShaDaReadDef *const sd_reader, const size_t offset) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT; |
97 | static void open_shada_sbuf_for_reading(const msgpack_sbuffer *const sbuf, ShaDaReadDef *sd_reader) FUNC_ATTR_NONNULL_ALL; |
98 | #include "nvim/func_attr.h" |
99 | |