refactor(IWYU): create {ex_getln,rbuffer,os/fileio}_defs.h (#26338)

This commit is contained in:
zeertzjq
2023-12-01 08:06:37 +08:00
committed by GitHub
parent b32b5b2711
commit 09e93d7c4d
15 changed files with 174 additions and 153 deletions

View File

@@ -16,6 +16,8 @@
#include <stddef.h>
#include <stdint.h>
#include "nvim/rbuffer_defs.h" // IWYU pragma: export
// Macros that simplify working with the read/write pointers directly by hiding
// ring buffer wrap logic. Some examples:
//
@@ -64,22 +66,6 @@
i-- > 0 ? ((int)(c = *rbuffer_get(buf, i))) || 1 : 0; \
)
typedef struct rbuffer RBuffer;
/// Type of function invoked during certain events:
/// - When the RBuffer switches to the full state
/// - When the RBuffer switches to the non-full state
typedef void (*rbuffer_callback)(RBuffer *buf, void *data);
struct rbuffer {
rbuffer_callback full_cb, nonfull_cb;
void *data;
size_t size;
// helper memory used to by rbuffer_reset if required
char *temp;
char *end_ptr, *read_ptr, *write_ptr;
char start_ptr[];
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "rbuffer.h.generated.h"
#endif