API: Refactor: Register/unregister created/destroyed buffers

- Add the 'handle' field to `buf_T`
- Add declare/implement functions for registering/unregistering/retrieving
  buffers
- Register/unregister buffers when they are created/destroyed.
This commit is contained in:
Thiago de Arruda
2014-05-23 15:49:30 -03:00
parent 7dfc7bc2e1
commit ed99198ff1
4 changed files with 13 additions and 0 deletions

View File

@@ -2,13 +2,17 @@
#define NVIM_API_HANDLE_H
#include "nvim/vim.h"
#include "nvim/buffer_defs.h"
#define HANDLE_DECLS(type, name) \
type *handle_get_##name(uint64_t handle); \
void handle_register_##name(type *name); \
void handle_unregister_##name(type *name);
HANDLE_DECLS(buf_T, buffer)
void handle_init(void);
#endif // NVIM_API_HANDLE_H