mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00

Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
43 lines
791 B
C
43 lines
791 B
C
#ifndef NVIM_UGRID_H
|
|
#define NVIM_UGRID_H
|
|
|
|
#include "nvim/globals.h"
|
|
#include "nvim/grid_defs.h"
|
|
#include "nvim/ui.h"
|
|
|
|
struct ucell;
|
|
struct ugrid;
|
|
|
|
typedef struct ucell UCell;
|
|
typedef struct ugrid UGrid;
|
|
|
|
#define CELLBYTES (sizeof(schar_T))
|
|
|
|
struct ucell {
|
|
char data[CELLBYTES + 1];
|
|
sattr_T attr;
|
|
};
|
|
|
|
struct ugrid {
|
|
int row, col;
|
|
int width, height;
|
|
UCell **cells;
|
|
};
|
|
|
|
// -V:UGRID_FOREACH_CELL:625
|
|
|
|
#define UGRID_FOREACH_CELL(grid, row, startcol, endcol, code) \
|
|
do { \
|
|
UCell *row_cells = (grid)->cells[row]; \
|
|
for (int curcol = startcol; curcol < endcol; curcol++) { \
|
|
UCell *cell = row_cells + curcol; \
|
|
(void)(cell); \
|
|
code; \
|
|
} \
|
|
} while (0)
|
|
|
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
|
# include "ugrid.h.generated.h"
|
|
#endif
|
|
#endif // NVIM_UGRID_H
|